4 ms·
> However, milliFORTH appears to be the smallest programming language implementation ever, beating out sectorLISP2, a mind-blowing 436 byte implementation of LI
by tromp 3y ago
> However, milliFORTH appears to be the smallest programming language implementation ever, beating out sectorLISP2, a mind-blowing 436 byte implementation of LISP, by 14 bytes.
The sectorlambda implementation of Binary Lambda Calculus is shorter yet at 383 bytes [1].
And the BLC self-interpreter is only 29 bytes [2].
> A FORTH in 422 bytes — the smallest real programming language ever, as of yet.
That may still be true, as BLC is an esoteric programming language.
[1] https://justine.lol/lambda/ https://justine.lol/lambda/
[2] https://ioccc.org/2012/tromp/hint.html https://ioccc.org/2012/tromp/hint.html
- n_plus_1_acc 3y ago[flagged]
- ikari_pl 3y agoum, sir... please show us the implementation of eval.
- eichin 3y agoHmm, I'd be a little surprised if this was smaller than some of the 8-bit era forths (the TIL book had a 50ish-byte "inner interpreter" for Z80 but that didn't include any of the baseline "words" that this does.) I'm sure it wins for 32-bit systems though.
- sitkack 3y agoTIL Book https://archive.org/details/R.G.LoeligerThreadedInterpretiveLanguagesTheirDesignAndImplementationByteBooks1981 https://archive.org/details/R.G.LoeligerThreadedInterpretive... I own a couple hard copies of this before it got popular. Most folks will only ever encounter the above PDF. It is absolutely wonderful book written in such a matter of fact style, the only thing comparable are the works of Nils Holm. https://t3x.org/ https://t3x.org/
- RodgerTheGreat 3y agoThe main advantage of a miniature Forth like this over BLC, Lisp, Brainfuck, etc, is that Forth grants low-level access to the hardware; you can easily bootstrap from it to something indistinguishable from a feature-rich Forth with a full suite of metaprogramming capabilities, or implement an entire operating system on top of it.
- mepian 3y agoNothing is stopping Lisp from having low-level access to hardware.
- tromp 3y agoIs low-level hardware access part of the language definition [1] ? [1] https://forth-standard.org/standard/words https://forth-standard.org/standard/words ?
- jlokier 3y agoMiniature Lisps are similar to Forth in this way. Having worked with both I'm inclined to favour Lisps for providing cleaner structure and abstractions for code and data to build up from, with low overhead despite the superfical differences. (See SectorLisp2 (436 bytes) vs SectorForth (491 bytes) size: https://justine.lol/sectorlisp2/ https://justine.lol/sectorlisp2/). Lisps are given low-level hardware access primitives (peek/poke etc) when they are designed for bootstrapping an OS, and low-level OS primitives (such as system calls) when they are designed for bootstrapping a rich environment on a different OS. Basically the same primitives as Forth for the same purposes.
- fuzzballcat 3y agoAuthor here! I was trying to be very careful about making sure to phrase things in a way that was clear I was referring to "real" languages (ones that are used for actual production purposes), but inevitably I forgot to do so where you've highlighted. I've updated the wording so it's more clear.
- zahllos 3y agoAnd for those that aren't aware: https://en.m.wikipedia.org/wiki/Open_Firmware https://en.m.wikipedia.org/wiki/Open_Firmware was a forth based bootloader for PowerPC. This is a very cool project, author, love it!
- fuzzballcat 3y agoFunnily enough, milliFORTH is now smaller than the Binary Lambda Calculus 383 byte implementation.