Letter is a simple LISP-like programming language that supports functions, dynamic scope, and local variables.
There are no types; Letter only has integers.
There are two directories correspoding to 2 implementations of Letter.
The C++ directory has an LLVM IR-generating JIT execution environment.
The Haskell directory has an interpreter and REPL.
(def fact (n)
(if (= n 0)
1
(* n (fact (- n 1)))))
(fact 8)
def
(def fun (arg1 arg2) (* arg1 arg2))
fun
that accepts 2 arguments and yields the product of the two (by calling the *
function)do
(do (print 3) (print 5) 5)
5
let
(let var 4)
var
to 4
if
(if (= x 0) 3 4)
print
(print x)
not
(not x)
while
(while (> 0 x) (do (print x) (let x (- x 1))))
x
to 0
+
/ -
/ *
/ /
/ mod
/ =
/ >
/ <
/ >
/ >=
/ <=
All expressions reduce to a 64-bit integer in LLVM, or an arbitrary sized integer in the interpreter.