furs

Furs is a Lisp programming language written in Rust. It is a minimal subset of Lisp, which includes symbol, list, and functions (atom?, equal?, car, cdr, cons, quote, cond, lambda, and define) as described in McCarthy's Lisp paper. On top of that, Furs supports more data structures (e.g. number, boolean, string) and functions.

References:

Usage

Assuming the availability of cargo:

$ cargo run λ

Examples

λ (+ "hello" ", " "world!") => hello, world!

Square:

λ (define square (lambda (x) (* x x))) λ (square 8) => 64

cdar (cdr then car):

λ (define cdar (lambda (l) (cdr (car l)))) λ (cdar (cons '(1 b c) '(4))) => (b c)

Factorial (recursive):

``` λ (define fac (lambda (x) (cond ((equal? x 0) 1) (#t (* x (fac (- x 1))))))) λ (fac 10) => 3628800