An open API service indexing awesome lists of open source software.

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

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
```