- No semicolons at the end of each line.
- Blocks are determined by the indentation marker '|'.
- Function call arguments are not enclosed in parenthesis.
- Variables are mutable always and can change type depending on what value it holds.
number
: represents a numerical value.boolean
: represents a Boolean value, which can be eithertrue
orfalse
.string
: represents a sequence of characters.list
: represents a collection of values, which can be of different types.
- There is only
if
statement. There are noelse
orelse if
. - Conditional expressions can use the
&&
and||
operators.
- For loops can be used to iterate over a range of values or a list.
- Infinite loops can be created using the
loop
keyword.
- A
break
statement can be used to exit a loop.
- Functions are defined using the
fn
keyword followed by the function name and its arguments. - A function can return a value using the
return
keyword. - Functions can also be defined as caching functions using the
cfn
keyword.
print
: prints a message to the console with a newline character at the end.printnobr
: prints a message to the console without a newline character at the end.filer
: reads a file.filew
: writes to a file.tonum
: converts a value to a number.read
: reads user input from the command line.eval
: evaluates a string as source code for this language and runs it.sys
: provides access to make system calls.
BLACK
,RED
,GREEN
,BLUE
,YELLOW
,CYAN
,MAGENTA
,WHITE
,BLACKBG
,REDBG
,GREENBG
,BLUEBG
,YELLOWBG
,CYANBG
,MAGENTABG
- provide easy color formatting when printingRESET
- provides the reset keyword to stop - color formattingCOLS
- provides terminal widthLINES
- provides terminal height
- There is no operator precedence. Operations are evaluated left to right.
- There is no error handling.
print "Hello, World!"
fn add a b
| return = a + b
add 1 2 output
print output
fn getfromdict dict key
| let dictlen = key len
| dictlen /= 2
| let item
| let valueindex
| for i dictlen
| | item = dict at i
| | valueindex = i + 1
| | if item == key
| | | return = dict at valueindex
let dict = []
dict += "key"
dict += 1
getfromdict "key" out
print out
import "helper"
helperfunction argument output
Limitations
- Operator precedence does not exist here. Operations are evaluated left to right.
- Variables are dynamically typed, which can make code more error-prone.
- There is no error handling, which can make debugging difficult. but interpreter will most likely tell you what's going wrong