Skip to content

simple and inaccurate interpreter in ± 800 lines of code

License

Notifications You must be signed in to change notification settings

Stasenko-Konstantin/lisp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lisp

desing is very human. very easy to use
simple lisp from scratch in ± 800 lines of code (including some tests)

Build & Run

Go

git clone https://github.com/Stasenko-Konstantin/lisp
cd lisp/go
go build -o lisp cmd/lisp/main.go

usage: ./lisp [*.scm] [arg] where arg:
        --help   -- prints the help
        --past   -- prints intermediate 
        

Racket (WIP)

git clone https://github.com/Stasenko-Konstantin/lisp
cd lisp/racket
raco exe -o lisp main.rkt

usage: ./lisp [*.scm] [arg] where arg:
        --help   -- prints the help
        --past   -- prints intermediate 

Usage

./lisp
<<< :h
>>> :l, :load *.scm      -- evaluate file
>>> :h, :help            -- prints the help
>>> :p, :past            -- prints intermediate ast
>>> :q, :quit            -- program exit
<<< :p
>>> OK
<<< (println 1)

type = LIST_O, content = 
        type = NAME_O, content = println, x = 1, y = 0;
        type = NUM_O, content = 1, x = 10, y = 0;, x = 0, y = 0;

1 
>>> ( 1 )
<<<