guitarvydas
10/19/2025, 9:01 AMBeni Cherniavsky-Paskin
10/29/2025, 8:39 PMI'm not sure why you're reading this book. It's taken me a while to discover why I'm writing it. 😂 and constrained focus Let me warn you now that I'll be talking about programs that will fit comfortably in 4K words of core.
• I expected the book to be "Forth is a cool language, build your apps in it"; instead it was "make your native app extensible—and interactively controllable—by embedding an interpreter" 😮
◦ Moore says I'm going to tell you how to write a program. It is a specific program; that is, a program with a specific structure and capabilities. — the book describes a pattern, an architecture, but those terms hadn't entered programming then yet.
• Chapter 4: I love how already then (by ~1970) Moore understood the importance of being able to mint new callables at run time 👏. He does it by each word combining pointer to native code + parameters field. (https://www.bradrodriguez.com/papers/moving3.htm goes into deep details on this)
◦ Compare this to C much later insisting on parameter-less function pointers as the default callable thing, which can only be minted at compile time => having to pass void* parameters through APIs all around, which I think was part of the reason people jumped on C++... This is not quite fair comparison —C wants to be the low-level language in which you implement higher-level stuff— yet I wish we had skipped that detour...
• Chapter 7 is an interesting peek into the gone world of language-level multiuser time sharing. It was much easier than full-scale OS with native programs that are free to crash... afaik early BASIC systems started out that way too. (chicken-and-egg: time-sharing enabled multiple interactive users, but there was not much to do interactively before timesharing made it affordable! interpreter REPLs were one of the first use cases.)guitarvydas
10/30/2025, 12:12 PMBeni Cherniavsky-Paskin
11/19/2025, 9:01 AMdup = de Bruijn 0, over = de Bruijn 1, yeah.
But de Bruijn indexes came from lambda calculus where you have clear "bound" vs. "free variables".
def make_greeter(greeting='Hello, '):
def greeter(name): return greeting + name
return greeter
so in the inner function name is locally bound, index 0, but greeting is comes from the closure, index 1.
Forth is looser, every function gets the whole stack and tends to touch some portion of it:
: g ( greeting name -- greeting sentence ) over swap concat ;
"Hello, " ( pushed onto stack )
...
"Paul" g
it's a blurrier distinction whether you view it as 1-argument function peeking at "free context" or 2-argument function 'binding" both...Beni Cherniavsky-Paskin
11/19/2025, 9:24 AMguitarvydas
11/22/2025, 7:51 PMForth has 2 stacks /AND/ access to the input stream /AND/ the notion of "immediate words".
...
Just about every popular programming language (including Scheme, Racket, Clojure) have inadvertently discarded such aspects of programming by over-emphasizing production engineering and disregarding iterative design.
...Program Design and Engineering