Skip to content

BowenFu/lisp.cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lisp.cpp

lisp.cpp : a simple lisp interpreter / compiler in C++ with scheme style syntax + quote / unquote style macros.

The interpreter is inspired by SICP.

The macro system and the compiler is inspired by Writing an interpreter / a compiler in Go.

Interpreter sample

$ build/bin/interpret

;;; M-Eval input:
(define x '(2 3))

;;; M-Eval value:
(2 3)

;;; M-Eval input:
`(,@x 1)

;;; M-Eval value:
(2 3 1)

;;; M-Eval input:

Compiler sample

$ build/bin/compile "(define x '(2 3)) \`(,@x 1)" 
(2 3 1)

Refer to core.lisp and sample/CMakeLists.txt for more samples.

All macros are defined in core.lisp.

Standard Type

Platform Platform Platform

CMake CMake GitHub license codecov