A tiny, embeddable language implemented in ANSI C

(= reverse (fn (lst)
  (let res nil)
  (while lst
    (= res (cons (car lst) res))
    (= lst (cdr lst))
  )
  res
))

(= animals '("cat" "dog" "fox"))

(print (reverse animals)) ; => ("fox" "dog" "cat")

overview

  • Support numbers, symbols, strings, lambdas, macros
  • Lexically scoped variables, closures
  • Use a small amount of memory within a fixed-size memory region
  • Simple mark-and-sweep garbage collector
  • Easy-to-use C language API
  • Portable ANSI C – for 32-bit and 64-bit
  • Compact – less than 800 sloc

Create a new function:

> (= sqr (fn (n) (* n n)))
nil
> (sqr 4)
16

Create a new macro:

> (= incr (mac (x) (list '= x (list '+ x 1))))
nil
> (= n 0)
nil
> (incr n)
nil
> n
1

#Homepage #Documentation #Downloads #Embeddable #Language #Implemented #ANSI #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *