💾 Archived View for bbs.geminispace.org › s › FORTH › 5163 captured on 2023-11-14 at 08:35:35. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-04)

➡️ Next capture (2023-12-28)

🚧 View Differences

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

To nForth and Beyond

I've been hacking on my little nForth, which is a simple 32-bit indirect Forth with a few deviations from norm. In the process I shrunk it down to 3.5KB, which opened up my appetite for tiny Forths.

Come to think of it, I haven't written more than 64KB of forth for any forth project this century. Not even close. And 64K of forth is a huge amount of code, even with 32-bit tokens.

So I've been thinking of spinning up another forth, with 16-bit execution tokens and 64KB (or 128KB with even alignment). I will keep the heads in a separate area, and jettison them for deployment as they are useful for development only.

I like keeping heads separately, leaving the code space contiguous, as it allows for a lot of tricks such as piggibacking code. My favorite example is 2x prefix, which runs the code that follows twice by manipulating the return stack. 2x can be placed just before a definition, and you can pile up more than one. That is classic non-ANS kind of a trick that Jeff Fox would enjoy ranting about.

Another great thing about separate headspaces is that you can create temporaries during the definition, and get rid of them at the end - the heads are not locked in-between the code.

Damn it, now I really psyched myself up for it. I just might have to do it.

https://tildegit.org/stack/nforth

Posted in: s/FORTH

🚀 stack

Sep 08 · 2 months ago · 👍 skyjake, drh3xx, norayr

1 Comment

🐙 norayr · Nov 13 at 00:35:

i found milliforth yesterday: https://github.com/fuzzballcat/milliForth (: