💾 Archived View for stack.tilde.cafe › gemlog › 2022-09-25.unortho.gmi captured on 2023-09-28 at 16:12:10. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-09-08)

-=-=-=-=-=-=-

Forth Unorthodoxia

I've been really enjoying myself neck-deep in Forth. After implementing the basics of a i386 Forth, to the point of being able to define new words and load files, I started digging through my pre-covid notes from my last Forth bender, and uncovered a bunch of forgotten treasures...

I do the round of languages with an orbital period of a few years. I'll tinker with some Forth-like language for a bit. Then, depending on which direction I was pushing, I will spend some time with Lisp, or maybe Smalltalk... Lisp if I was frustrated with being unable to transform and reason about code; Smalltalk if I was getting into the token interpreter aspects of Forth...

But I am still in Forth for now. Unorthodox Forth, but Forth nontheless.

Chuck Moore oftens says that there is no one true forth. If you have a datastack, practise minimalism, and are building bottom-up codebases, chances are you are working in Forth. Chuck was not fond of ANSI or any kind of standardization.

I am drawn to the weird corners of Forth, of course (and weird corners of everything, really). For many years I've experimented with native compilers, as well as slightly more readable recursive descent parsers, resulting in languages that could compete in readability and speed with C. But doing that I missed out on something else Forth offers.

The classic interpreted Forth is pretty interesting in how it allows you to switch levels between compiling and interpreting in ways you can only appreciate after doing some Forth yourself. So I am pretty excited about interpreted Forth, for the last two rounds now (maybe 5 years?).

The hyperstatic nature of Forth is really, really curious. Recently, immutable datastructures became de rigueur. Forth has always been about as immutable as it gets, to my great pleasure.

I also have a piece of wicked tech that's dying to be integrated into an interpreted Forth, especially when immutability is considered a benefit. It is a truly odd bytecode interpreter that uses sliding windows. It is magic - instead of restricting bytes to specific meanings as all other such interpreters do, it probabilistically changes the mapping as needed, with very little overhead.

I must get this done before I die.

index

home