Re:StoneKnifeForth (With a Metacircular Compiler)
by rwmj on Thursday February 18, 2021 @11:48AM
(#26182132)
> It is completely possible to implement [FORTH] in assembly language
I know because I did :-) https://news.ycombinator.com/item?id=10187248
Re:StoneKnifeForth (With a Metacircular Compiler)
by mikewarot on Thursday February 18, 2021 @12:40PM
(#26182914)
Me Too - For OS/2, and it was direct threaded code
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