Hacker News new | past | comments | ask | show | jobs | submit login

Very useful reading for anyone writing a Forth, and some interesting reading if you're curious about how different Forths are run or 'threaded'.



It seems like there should be a clarification in the article about the difference in the use of the term. These are not threads at all in the more typical sense used more in computing today.


Good point, that could be the source of confusion! The "Threaded" in "Threaded Interpretive Language" has a very different meaning than operating system or cpu "thread".

https://wiki.c2.com/?ThreadedInterpretiveLanguage

>A ThreadedInterpreter is an interpreter written using a technique called threading (not to be confused with threads for concurrency) that entwines the 'get next instruction' operation of the interpreter with the actual instruction. This reduces the 'get next instruction' overhead and generally results in a 10% performance increase. [...]

>An excellent work on this subject, containing a complete TIL implementation for the Z-80, is Loeliger's book ("Threaded Interpretive Languages" R.G. Loeliger, Byte Books 1981, ISBN 0-07-038360-X). I have a copy (I should have bought three) that I picked up in the years of Forth's waning "public" popularity. I've seldom had a such a lucid book that described the implementation details of a language.

"Threaded Interpretive Languages: Their Design and Implementation", by R.G. Loeliger:

https://archive.org/details/R.G.LoeligerThreadedInterpretive...

Some FORTHs do support the typical modern sense of "green threads" but they usually call them "tasks".

"FORTH MULTITASKING IN A NUTSHELL"

http://www.bradrodriguez.com/papers/mtasking.html

"multi-tasking: GForth Reference implementation of multi-tasking standard proposal"

https://theforth.net/package/multi-tasking

p. 26: "Multi-Tasking Part I, Henry Laxen"

http://www.forth.org/fd/FD-V05N4.pdf

p. 37: "Multi-Tasking Part II, Henry Laxen"

http://www.forth.org/fd/FD-V05N5.pdf




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: