/Pluto24

Pluto24 is a highly customizable programming language, written in just 24 lines of code.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Pluto24 Language

Pluto24 is a highly customizable programming language, written in just 24 lines of code.

Syntax

<digit> => pushed to stack
<*:>    => function declaration
<&*>    => function reference
<:>     => comment (nameless function)
<*>     => calls the function

Basic program

basic Source basic.pluto

Builtin functions

add  => adds two integers
sub  => subtracts two integers
mul  => multiplies two integers
div  => divides two integers, using integer division
mod  => modulus of two integers
copy => copies the nth element
drop => drops the nth element
if   => runs the function(at 1) if condition(at 2) > 0
get  => reads a single byte into the stack
put  => prints a single byte from the stack

Running Pluto programs

$ python main.py <program.pluto, ...>

Running examples

Programs under /examples assumes std.pluto is included

$ python main.py std.pluto examples/hello.pluto

std.pluto

This is an optional pluto library, which contains commonly used functions.

operators.pluto

This library contains function alias as operators, enables the usage of operators instead of keywords.

e.g. 1 2 add => 1 2 +

Examples

hello

fib

max

sum

operators_sum