Author here, happy that someone finds this interesting and happy to answer questions.
While Fennel does use other files for tests, fennelview, and the CLI tool, the compiler itself is a single Lua file.
picol, a Tcl interpreter in 550 lines of C code
Jones’s Forth implementation is one file: https://github.com/nornagon/jonesforth/blob/master/jonesforth.S
Also microkanren a logic programming language https://github.com/jasonhemann/microKanren-DLS-16/blob/master/mk.rkt
You might consider including TRAC - a fascinating language by Calvin Moers, that proves at the very least that making something FLOSS will protect against total extinction.
His actual implementation of TRAC died with him since he kept it 100% proprietary.
I’d love to find a single-file Prolog, preferably in C. I’m sure this exists.
I built and ran this last year, but I don’t have any strong memories of it:
Except it’s actually in C++ and not C.
Thanks! Seems worth a try.
Not C but nmh’s “LISPy things you can do in 64K bytes of core” describes an implementation in Kilo LISP’s extremely constrained conditions. The source is under 100 lines.
oh, neat, mLite adds to my small collection of languages with ML-style (and ML-syntaxed) algebraic datatypes but dynamic typing (pyret and pure are the other two).
I’ve been searching for a single-file implementation of ML in Standard ML that I once came across several years ago. I think it was written in the form of an email message or memo between developers of MLton or SML/NJ. Maybe it was Matthew Fluet or Andrew Appel? Has anyone else seen this?
Appel writes a compiler for Tiger (an ML-derivative) in his Modern Compiler Implementation books, maybe that’s what you’re looking for?
No, I’m familiar with Appel’s books but I’m remembering something that was an electronic ephemera, literally just a page of text, and only a fragment of the ML that Tiger supports.
It’s a fun excercise. Many years ago I implemented a parser and interpreter for a simple imperative language in 120 lines of python including comments. I don’t have the source any longer, but I really learned a lot.