~yerinalexey/sushi

Small Scheme interpreter and REPL

cffbc42 env: implement string-len

4 months ago
4 months ago

#Sushi

Small Scheme interpreter/REPL.

#Install

Sushi requires a C11 compiler to build on any system.

$ make
# make install

#Example

;; Returns a factorial of a given number (n!)
(define factorial
    (lambda (n)
        (if (= n 1)
            n
            (* (factorial (- n 1)) n))))

(display (factorial 4))
(newline)

Place the source in a file like factorial.scm and run it with:

$ ./sushi factorial.scm
24

You can also open a REPL by passing no arguments to sushi:

$ ./sushi
> (+ 2 2)
= 4