Re:Fitting a FORTH in 512 bytes
by hyperhopper on Friday June 11, 2021 @05:02PM
(#27478449)
I find it amusing how often trying to do complex tasks with simple constraints, always ends up back at stack based languages. Probably why the stack based turing machine is academically important.
[ Parent
| on HN ]
> Probably why the stack based turing machine is academically important.
A Turing machine is not stack-based, but tape-based. A pushdown automaton (PDA) is stack-based.
Although turing machine tape emulatable via 2 stacks
Two stacks make an automaton Turing Complete. Which is an interesting result.
Re:Fitting a FORTH in 512 bytes
by NieDzejkob on Friday June 11, 2021 @06:47PM
(#27479448)
I suppose that prior art influences things. In my case, I went "a separate text editor won't fit, I need a REPL", and that basically filtered to just Forth and Lisp. It would be interesting to see what subset of Lisp would fit in a bootsector, but I wouldn't get my hopes up.
There's sectorlisp that appears to fit into two sectors but is yet shy of their single-sector goal: https://github.com/jart/sectorlisp
sectorlisp right now is 800 bytes but it implements LISP well enough that you can use its built-in LISP IDE to implement your own LISP engine on top of sectorlisp using high-level functional programming techniques. https://youtu.be/hvTHZ6E0Abo If we can trim down the code size another 250 bytes then all this will fit in the master boot record.