Developer and Lisp fanatic Dr. Robert van Engelen has launched the very appropriately-named tinylisp — an implementation of the traditional language in simply 99 strains of C code, and simply expanded so as to add extra options.
“In honor of the contributions made by [Alonzo] Church and [John] McCarthy, I wrote this undertaking and the accompanying article to indicate how anybody can write a tiny Lisp interpreter in just a few strains of C or in any ‘C-like’ programming language for that matter,” van Engelen explains. “I tried to protect the unique that means and taste of Lisp as a lot as doable. Because of this, the C code on this undertaking is strongly Lisp-like in compact type.”
A traditional Sharp “Pocket Pc” has gained a brand new language, because of a Lisp interpreter applied in simply 99 strains of C. (📷: Dr. Robert van Engelen)
Initially styled LISP, an abbreviation of “checklist processor,” the Lisp programming language was created by John McCarthy, Steve Russell, Timothy P. Hart, and Mike Levin within the Nineteen Sixties as a language for mathematical notation impressed by the lambda calculus of Alonzo Church some 20 years prior. It is a easy sufficient language to implement that interpreters could be discovered for a variety of resource-constrained units — however van Engelen’s tinylisp takes issues to an excessive.
Tinylisp takes up, in its commonplace type, a mere 99 strains of C code, but delivers 21 Lisp primitives — expandable, do you have to need and do not thoughts going into triple-figure lines-of-code — a easy rubbish assortment system, and a working read-evaluate-print-loop (REPL). This, van Engelen factors out, makes it significantly extra usable than rival “toy instance” implementations — and, to show it, has proven tinylisp working interactively on a Sharp Pocket Pc PC-G850VS, a turn-of-the-century calculator-slash-computer with BASIC, CASL, Z80 meeting, and C programming language assist.
“[Tinylisp] is written in a Lisp-like practical model of structured C, strains are 55 columns broad on common and by no means wider than 120 columns for handy modifying,” van Engelen explains. “It helps static scoping, double precision floating level, has 21 built-in Lisp primitives, a REPL, and a easy rubbish collector. Tail-call optimized variations are included for velocity and lowered reminiscence use.”
The undertaking is documented in full on GitHub, together with the supply code underneath the permissive BSD three-clause license.