- comments start with
#and continue until the end of the line - everything else is either a function call, an atom or a variable
- function call syntax:
FUNCTION_NAME(ARG_1, ARG_2, ...)- functions are commonly called
FUNCTION_NAME(ARGC), e.g.+(2)orprint(_)(variable number of arguments allowed)
- functions are commonly called
- variable: any identifier that does not contain forbidden characters (including, but not limited to
(,),#,,) - atom: one of:
- integer:
1,-5, ... - string:
"hello, world", ... - null:
null - bool:
true,false - (other non-literal atoms: lists, objects, function pointers)
- integer:
- all meaningful operations and statements are function calls
- every program is implicitly wrapped in
_(and)for convenience - every program except for the STL itself automatically imports
__builtin_prelude
- are present in every program without having to import them
- fundamental language features like
=(2)ordef(_)are among them - see
src/builtinsfor a list of them
- constructable with
global(1), exampleglobal(x) - can be read and written from anywhere
- value is shared between all imported modules and function scopes, unlike regular local variables with
=(2) - there is no language mechanism to prevent name collisions at the moment
- naming conventions are required (see below)
- still extremely minimal
- STL modules can be imported with
import(1), exampleimport(range)
- any fallible operation can
raiseanException - exceptions bubble up unless stopped with
catch - note: rust panics in Regulus outside of the
StateAPI are generally bugs and should be exceptions instead
- identifiers starting with
__stlare reserved (this is not enforced though) for internal use in the STL, manipulating them is expected to cause panics or crashes - identifiers starting with
__builtinare similarly reserved for internal APIs and may be added, changed or removed at any time