I really enjoyed reading Starting Forth when it came out. I've used Starting Forth together with Threaded Interpretive Languages: Their Design and Implementation by R. G. Loeliger to create my own Forth system. This second book is not about "threads" as we know them today; threading is a way to very efficiently dispatch the execution of Forth primitives.
Calvin Moores is a language inventor too. I've also implemented a version of his language TRAC. TRAC is mentioned prominently in a book that I really enjoyed while in grad school in the 70's, Computer Lib by Ted Nelson. Described by Wikipedia as the first book on personal computers.
The appeal of Forth, and even more so of TRAC, is that they are very simple languages to implement. It is completely possible to implement either language in assembly language, but C would be a bit easier. As a project to learn Perl, back when it was new, I wrote a TRAC interpreter over a couple of days.
TRAC, like the roughly contemporaneous language GPM invented by Christopher Strachey, is a macro processor. GPM and TRAC are "Turing complete" macro processors. So they can be used to write arbitrary programs and are in fact designed for this purpose.
Some links/references:
Leo Brodie, Starting FORTH : an introduction to the FORTH language and operating system for beginners and professionals, Prentice-Hall, 1987. https://www.forth.com/starting-forth/
Martin Campbell-Kelly, Christopher Strachey, 1916-1975: A Biographical Note, IEEE Annals of the History of Computing, 1985, https://www.computer.org/csdl/magazine/an/1985/01/man1985010...
R. G. Loeliger, Threaded Interpretive Languages: Their Design and Implementation, BYTE Books, 1979, https://www.abebooks.com/servlet/BookDetailsPL?bi=2253615473...
Calvin Moores, TRAC, A Procedure-Describing Language for the Reactive Typewriter, CACM Vol 9, Num 3, March 1966, https://dl.acm.org/doi/10.1145/365230.365270
Ted Nelson, Computer Lib/Dream Machines, self-published, 1974, https://en.wikipedia.org/wiki/Computer_Lib/Dream_Machines
I know because I did :-) https://news.ycombinator.com/item?id=10187248
IIRC the reason I only allowed single-byte identifiers was to simplify the symbol table, which is implemented by these four lines of code:
: Type Four* header 6144 + + ; ( Table of definition Types: 1=code, 2=data )
: Addr Type 1024 + ; ( table of definition Addresses )
( register a colon definition )
: Colon %flush dup Type 1 xchg ! HERE @ xchg Addr ! ;
( register a variable definition )
: Var %flush dup Type 2 xchg ! HERE @ xchg Addr ! ;
Abbreviating this as follows would clearly be highly immoral, so I would never do that: : T F h 6144 + + ; : A T 1024 + ; : C % d T 1 x ! H @ x A ! ; : V % d T 2 x ! H @ A ! ;
"Parsing" is kind of the same as it would be if more bytes in the name were significant, because the other bytes in the name are still there in the source and the compiler still has to skip them: : word getchar dup Isdigit [ ; ] dup '' = [ ; ] dup 0 1 - = [ ; ]
{ Getchar dup ' = [ pop ; ] dup 10 = [ pop ; ] 0 1 - = [ ; ] 1 }
What's simpler is that it doesn't have to store them anywhere, or implement any kind of string compare operation, and consequently doesn't use C@, and consequently doesn't have to implement C@ either. It implements @ and ! and C! (which it calls "store"; I should have called it "c!" since capital "C" was already taken for "colon"). It needs C! ("store") for emitting sub-word-length instructions and at any rate for backpatching jumps.It's definitely a questionable choice, though! I think it might be worth using two significant letters instead of one for a "tiny boot FORTH".
Traditional FORTHs, you probably recall, used a fixed-size four-byte "name" in their dictionaries: a length byte and the first three letters of the name. Chuck Moore received some criticism for this choice, in response to which he wrote a letter to a popular FORTH magazine arguing, effectively, that thr-- let---- was ade----- to tel- wor-- apa--; col------- bet---- wor-- wer- suf--------- rar- wit- the fir-- thr-- let---- bei-- sig--------, and of cou--- it was mor- eff------. FTP and SMTP commands are all four letters long for the same reason.
FORTH's a bit of an occupational hazard of hacking, you might say. Like suicide, or being burned at the stake. (It's been two days since the anniversary of Giordano Bruno being burned at the stake for being a hacker, though he was too early to write a FORTH himself.)
I've read through ancient, forgotten books in faraway lands; I've learned strange tongues and seen fortunes won and lost; I've comforted the grieving, and I've restrained deadly robots as they wriggled to escape my grasp.
I've comforted the suicidal, and I've broken the trust of those who placed their hopes in me.
After midnight, I danced in the moonlight with a beautiful Brazilian as we stood guard outside her now-demolished ecovillage; she told me she'd thought she'd lost the ability to fall in love. We didn't need any music.
I've studied at the knee of wise elders, meditated in monasteries, translated poetry, and embraced madmen who predicted my demise in their psychotic ravings.
I've made foolish mistakes whose consequences maimed those I loved, and I've averted catastrophe innumerable times.
And most of that is even true.
Thanks for asking! I hope you're doing well too :)
Think running into 5 kangaroos in a row in NYC.