====
本文由 LearnShare 整理并在 CC BY-SA 3.0 协议下发布,主要为了给自己和各位朋友作为学习 Markdown 的入门及参考资料。
请各位遵循 Markdown: License 及其它参考文献的共享协议来使用、修改和发布。
implement a lisp interpreter with low level language in C.
-
design the data struct to represent the atom type, ATOM_NIL, ATOM_SYMBOL, ATOM_INTEGER, ATOM_PAIR, ATOM_FUNCTION, ATOM_CLOSURE
-
lexer and parser
-
support basic functional programming operate such as car cdr cons nil
-
extend to arithmetic (+, - , * ,/)
-
support boolean and if(which is a short-circuit evaluation), such as(< 1 2) (= (+ 1 2) (- 21 12))
-
expand to lambda expressions and closures(lambda (x) (* x x)). and simple syntatic sugar(such as ('(1 2)), which is a list)
-
use the mark sweep algorithm proposed by John McCarthy to implement a simle garbage collector .
more works deserve to be done, and i will do it later
-
support other type, such as float, big number, complex and so on
-
support variadic functions, such as(+ 1 2 3 4)
-
tail recursive optimization
-
environment use the hash table to speed up
-
alternative GC