r/Forth • u/ekipan85 • 19d ago
My 500 bytes Forth that wants to be fun to read and hack on.
https://github.com/ekipan/nictoforth(Permalink as of this post, and diff with latest.)
I present Nictoforth: a space-and-pedagogy-constrained art Forth. It's carefully crafted to be read top-to-bottom:
- The repo README sets the stage. Boot sector, serial IO via BIOS.
- The assembly source is packed with narrative, rationale, and cross-reference. Search for:
- "[0]" architecture if you want to dig in.
- "[5]" interpreter, the heart of a Forth.
- "[7]" the lovely straightforward compiler.
- "[8]" the extremely wacky bootstrap. It's full of character but damn dense!
- If you clone the repo you can do
make terse | bat -l nasmor| lessto cut away all the asides and just read the code. - An example demo session log. See it working.
u/s1nical posted their Milliforth fork the other day so I figured why not post mine too. It was lots of fun to write and educational besides!
27
Upvotes
2
u/ekipan85 19d ago edited 19d ago
Shortly after I shared to the Forth discord a few months ago u/mykesx quickly bought me a big pile of bytes that I spent on swap and the ok prompt. Somehow I've managed to scrouge for a few more lately and am considering experimenting with re-adding a numbers parser! Mostly the docs burden makes me not wanna. Still mulling it over.