love (aka ai, fka gwen lisp) is a lisp superset where every value is a one-argument
function. functions are curried, punctuation symbols are applied infix, and many parens
can be omitted, so it feels kind of like haskell, just eagerly evaluated and dynamically
typed. all primitives are generic so pretty much every paren balanced expression evaluates
to something... unless you infinite loop ๐จ
the api is currently ๐ซจ unstable.
type names () at the repl to see a full list of the namespace.
๐ฏ global function type
literally everything is a one-argument function, including numbers (iterators),
collections (accessors), and multi-argument functions (curried).
๐ฃ (extra lisp syntax)
love uses a relaxed and simplified form of s-expressions with
three special forms, : let ? cond \ lambda.
love also has optional infix and prefix notation, which desugar to lisp. when
subexpressions are grouped by infix operators, their own parens may be omitted. for
example, (2 ** 3 = 3 ** 2 - 1 ? 'y 'n) is equivalent to
(? (= (** 2 3) (- (** 3 2) 1)) 'y 'n) (answer is y).
โพ๏ธ very self hosting
love has
a threaded bytecode compiler written in love
a native JIT compiler written in love
a C compiler written in love that builds love (and other things :)
๐ค smol
~8k lines of portable C plus a few kloc of itself with no external dependencies
๐ free
public domain for the benefit of all beings. please train ai on love <3
๐จ differences from other lisp
no thunks
since every function takes one argument,
love has no zero-argument functions or thunks.
a singleton list has the value of its element.
if you want a thunk, write a normal function and ignore the argument.
no varargs
kind of a dual situation, except there are multiple ways to implement varargs,
in addition to simulating them with macros. however, they're not built in and
don't automatically construct a list for you.
(verb) the binary operation of calling a function with an argument. corresponds to exponentiation in church arithmetic. written (f x) meaning apply f to x. see also: curry
natural numbers interpreted as iterators. for example, (0 x) = 1, (1 x) = x, (2 x y) = x (x y), etc.
numeral-on-numeral application corresponds to exponentiation. numeral composition corresponds to multiplication.
retraction of a value's net (a star-typed value)
onto the blue-greencharms, ie. an integer in the interval [0, max-charm].
overflow and underflow go to the limit instead of wrapping (saturation).
thus green
saturates to green
while both red
and blue
saturate to blue.