https://github.com/lynn/cfunc
A Norvig-y Lisp implementation I tried to write in C in 2015 or so
https://github.com/lynn/cfunc
Last synced: 2 months ago
JSON representation
A Norvig-y Lisp implementation I tried to write in C in 2015 or so
- Host: GitHub
- URL: https://github.com/lynn/cfunc
- Owner: lynn
- License: mit
- Created: 2020-09-17T14:12:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T01:32:16.000Z (over 4 years ago)
- Last Synced: 2025-02-28T20:39:50.781Z (3 months ago)
- Language: C
- Homepage:
- Size: 36.1 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
I dug this weird little unfinished C implementation of a Lisp out of my Dropbox (dated 2015). It seems to be based on that one [Peter Norvig article](https://norvig.com/lispy.html). Writing C is tricky.
Looking back, it has a fun way of parsing code and making an S-expression tree in one pass. The output is nice and colorful, too. Sadly, it just keeps allocating stuff on a heap until it runs out and dies.
It's 2020 as I write this, so maybe if I let it sit on GitHub for five more years, by 2025 I'll have figured out how to implement garbage collection.
**EDIT**: psych, I implemented mark-and-sweep, maybe
# Usage
```
make
./cfunc examples/map.lisp
```