Regina Page on Nostr: For the past couple days I've been on the Forth side-quest... I'm interested in ...
For the past couple days I've been on the Forth side-quest... I'm interested in having Forth in my pocket as a way of generating machine code that fits entirely in my head.
While trying to come up with a model that would make use of the hardware stack to its fullest I've come up with the realization that:
- Argument stack can be abstracted as a global variable;
- Call stack can be the C/hardware stack;
- The code field of a word can be an array of function pointers that take no arguments and modify the global argument stack;
- Executing a word is literally just iterating over that array and calling each function.
I used the C terminology there because that is the memory model I have the most intuition about, but it easily translates to the assembly.
We can even have an array of all known primitive functions into which word definitions can be indexing for maximum compactness at the cost of an extra indirection.
#Forth
Published at
2026-09-27 14:55:58 UTCEvent JSON
{
"id": "abf1a7ff885a9018bb9b064d86a4bd9f09c86b4f23b49489d857943a02f7be9a",
"pubkey": "f40fb3fa78c3a6f6f8da310570d80e9a857747972b1456ce77277c3b13339304",
"created_at": 1790520958,
"kind": 1,
"tags": [
[
"t",
"forth"
],
[
"proxy",
"https://merveilles.town/@regicidalplutophage/117343581566484304",
"web"
],
[
"proxy",
"https://merveilles.town/users/regicidalplutophage/statuses/117343581566484304",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://merveilles.town/users/regicidalplutophage/statuses/117343581566484304",
"pink.momostr"
],
[
"-"
]
],
"content": "For the past couple days I've been on the Forth side-quest... I'm interested in having Forth in my pocket as a way of generating machine code that fits entirely in my head.\n\nWhile trying to come up with a model that would make use of the hardware stack to its fullest I've come up with the realization that:\n- Argument stack can be abstracted as a global variable;\n- Call stack can be the C/hardware stack;\n- The code field of a word can be an array of function pointers that take no arguments and modify the global argument stack;\n- Executing a word is literally just iterating over that array and calling each function.\n\nI used the C terminology there because that is the memory model I have the most intuition about, but it easily translates to the assembly.\n\nWe can even have an array of all known primitive functions into which word definitions can be indexing for maximum compactness at the cost of an extra indirection.\n\n#Forth",
"sig": "138c5a3e8a550e82e9b68be044b7772f337cbdf27044158d3ee16978945ff04896a3ebeba4794779d7ed50d5152e7d1fd115d2219459a5549c34215eae01f64b"
}