Content deleted Content added
m fixed ambiguous link |
m Charles Moore -> Charles H. Moore |
||
Line 23:
To save even more space, programmers squeezed those lists of subroutine calls into simple lists of subroutine addresses (leaving out the "call" instruction on each one), and used a small interpreter (later called a [[virtual machine]]) to call each subroutine in turn. This is called ''DTC (Direct Threaded Code)''.
[[
He said (in published remarks, Byte Magazine's Forth Issue) that he found it so convenient that he propagated it into all later Forth designs.
Line 46:
Less often used are
*String threading: In which operations are identified by strings, usually looked-up by a hash table. This was used in Charles H. Moore's earliest Forth implementations and in the [[University of Illinois]]'s experimental hardware-interpreted computer language. It is also used in [[Bashforth]].
*[[return threading]]
*Call Threaded Code uses a list of addresses that refers directly to machine language primitives, just like Direct Threaded code. However, the interpreter, instead of ''jumping'' to the primitive, ''calls'' it with a microprocessor subroutine call instruction instead. This system is slower than direct threading, and may even be slower than indirect threading on some systems. However, it is convenient because it allows for implementations written entirely in high-level languages, like C or Oberon. For example, here is an implementation written in both C and Oberon (untested):
Line 124:
*[http://cm.bell-labs.com/cm/cs/who/dmr/chist.html The Development of the C Language] by [[Dennis Ritchie|Dennis M. Ritchie]] also puts B in the context of BCPL and C.
*[http://thinking-forth.sourceforge.net/ Thinking Forth Project] includes the seminal (but out of print) book Thinking Forth by [http://home.earthlink.net/~lbrodie/ Leo Brodie] published in 1984.
*Anton Ertl's explanatory page [http://www.complang.tuwien.ac.at/forth/threaded-code.html
[[Category:Computer science]]
|