Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stijlist/roots
a lisp interpreter in C
https://github.com/stijlist/roots
Last synced: 3 months ago
JSON representation
a lisp interpreter in C
- Host: GitHub
- URL: https://github.com/stijlist/roots
- Owner: stijlist
- Created: 2014-07-27T04:48:49.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T07:01:56.000Z (over 7 years ago)
- Last Synced: 2024-04-24T15:16:14.394Z (6 months ago)
- Language: C
- Size: 97.7 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeInterpreter - roots
README
This is a toy lisp implementation loosely based on Paul Graham's [The Roots of Lisp](http://ep.yimg.com/ty/cdn/paulgraham/jmc.ps) (postscript file).
Working:
- car (head)
- cdr (tail)
- cons
- if
- quote
- atom
- eq
- let
- lambda
- recursion
- lexical scope
- closures
- define (for repl only)
- integer arithmetic
- add
- subtract
- multiply
- divide
- non-alphabetical symbols
- inspect
- variadic functions
- repl works on multiline functions
- cond
- program termination with nonzero return in error casesTODO:
- bootstrap
- strings
- garbage collectionknown bugs:
Side-effects in "if" or "cond" forms don't work:
```
(define l (quote (1 2)))
(if (inspect (cons 3 l)) 1 0)
(inspect l)
```Updated testing strategy:
- input and expected output files
- shell script that executes the input files with the current version of roots and runs diff on the input and output, printing the filenames of the diffs
- git precommit hook that updates the diffs