Get the latest tech news

A Lisp in 99LOC


Lisp in 99 lines of C and how to write one yourself. Includes 21 Lisp primitives, garbage collection and REPL. Includes tail-call optimized versions for speed and reduced memory use. - Robert-van-E...

In honor of the contributions made by Church and McCarthy, I wrote this project and the accompanying article to show how anyone can write a tiny Lisp interpreter in a few lines of C or in any "C-like" programming language for that matter. It supports static scoping, double precision floating point, has 21 built-in Lisp primitives, a REPL and a simple garbage collector. The garbage collector frees up stack and heap space by copying the active cons pair cells, atoms and strings to a new stack/heap.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Lisp

Lisp

Photo of 99LOC

99LOC

Related news:

News photo

Lists and Lists: Basics of Lisp through interactive fiction (1996)

News photo

Compiling a Lisp: Lambda lifting

News photo

Build Your Own Lisp