Hey /prog/, I'm building a language. Here's an example, its the factorial function:
def is-zero [id, #0] =
def decr [id, #1] -
def ! is-zero -> #1 ; [id, decr!]
This should give you a feel for the syntax of the language. All of it. There are no variables, everything is a function application. Tuples, denoted [a,b … z] provide a way of destructing and restructuring data without explicit variables. Here's the basic evaluation rules:
[f1, f2, … fn] applied to a is equal to [f1 applied to a, f2 applied to a, … fn applied to a]
f g applied to a is g applied to f applied to a (composition)
Elements are accessed through the 1, 2, 3 … n functions.
When # is before a constant it is interpreted as a function that when given any argument will return that constant.
Here's paul graham's make-adder function in this language, which makes use of the postpone operator (^) that is used to make closures/delay evaluation:
def make-adder [id, ^id] +
That's basically the whole language.