A LISP/Scheme dialect is implemented as a surface-syntax for uFork programs. A compiler (written in JavaScript) generates loadable IR just like ASM does.
Since this dialect is focused on expressing actor behaviors,
it is a mostly-pure functional expression language.
Most data-structures (including pairs) are immutable,
and mutation features (e.g.: set!
) are not supported.
The language is extended with actor primitives.
It is expected that mutation generally will be confined
to the state of actors, managed with BECOME
.
#?
— undefined value#nil
— empty list, abbreviated()
#f
— boolean false#t
— boolean true#unit
— inert result#literal_t
— type of literal values#type_t
— type of types#fixnum_t
— type of fixnums (31-bit signed integers)#actor_t
— type of actor reference/capabilities#instr_t
— type of machine instructions#pair_t
— type of pairs (cons
cells)#dict_t
— type of dictionary entries- fixnums (31-bit signed integers)
(import
<prefix>)
(define
<symbol>)
(quote
<expr>)
— abbreviated'
<expr>(lambda
<formal>.
<body>)
(let ((
<var>) .
<bindings>) .
<body>)
(seq .
<body>)
(list .
values)
(cons
head)
(car
pair)
(cdr
pair)
(cadr
pair)
(caar
pair)
(cdar
pair)
(cddr
pair)
(caddr
pair)
(cadar
pair)
(cdddr
pair)
(cadddr
pair)
(eq?
value)
(null?
value)
(pair?
value)
(boolean?
value)
(number?
value)
(actor?
value)
(symbol?
value)
(procedure?
value)
(behavior?
value)
(if
<test>)
(cond (
<test>.
<body>) .
<clauses>)
(and .
<exprs>)
(or .
<exprs>)
(not
bool)
(+
number)
(-
number)
(*
number)
(<
number)
(<=
number)
(=
number)
(>=
number)
(>
number)
(export .
<symbols>)
(nth
index)
(equal?
value)
(append .
lists)
(length
list)
(filter
pred)
(reduce
binop)
(foldl
binop)
(foldr
binop)
(map
proc.
lists)
(reverse
list)
(letrec ((
<var>) .
<bindings>) .
<body>)
(current-env)
(print .
values)
(CREATE
behavior)
(SEND
actor)
(BECOME
behavior)
SELF
(BEH
<formal>.
<body>)
(CALL
actor)
(DEVICE
id)
(par .
<exprs>)
(zip
formal)
(gensym)
a-print