Threaded code: Difference between revisions

Content deleted Content added
mention counter-intuitive result.
m ref name fixed WP:REFNAME
Line 27:
[https://muforth.nimblemachines.com/readme/ "muforth readme"].
section "Simple and tail-recursive native compiler".
</ref><ref name="heller">
Steve Heller.
[https://books.google.com/books?id=gaajBQAAQBAJ "Efficient C/C++ Programming: Smaller, Faster, Better"].
Line 254:
Counter-intuitively, token-threaded code can sometimes run faster than the equivalent machine code --
when the machine code is too large to fit in cache, but the higher [[code density]] of threaded code, especially token-threaded code, allows it to fit entirely in high-speed cache.
<ref name="heller "/>
 
===Huffman threading===
Line 264:
===RPL===
 
[[Hewlett-Packard|HP]]'s [[RPL_RPL (programming_languageprogramming language)|RPL]], first introduced in the [[HP-18C]] calculator in 1986, is a type of proprietary hybrid direct-threaded and indirect-threaded threaded-interpreted language that, unlike others TILs, allows embedding of RPL "objects" into the "runstream" ie. The stream of addresses through which the interpreter pointer advances. An RPL "object" can be thought of as a special data type whose in-memory structure contains an address to an "object prolog" at the start of the object, and then data or executable code follows. The object prolog determines how the object's body should be executed or processed. Using the "RPL inner loop"<ref name="RPL1">Busby, Jonathan. [https://www.hpmuseum.org/forum/thread-11358.html "The RPL inner loop explained"], [http://www.hpmuseum.org/ "The Museum of HP Calculators"], 7 September 2018, Retrieved on 27 December 2019</ref>, which was invented and published ( and patented <ref>{{cite web | last = Wickes | first = William C. | title = Data processing system and method for the direct and indirect execution of uniformly structured object types | website = uspto.gov | date = May 30, 1986 | url = http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FPTO%2Fsearch-adv.htm&r=8&p=1&f=G&l=50&d=PTXT&S1=((%22Hewlett+Packard%22.ASNM.)+AND+Wickes.INNM.)&OS=AN/%22Hewlett+Packard%22+and+IN/Wickes&RS=(AN/%22Hewlett+Packard%22+AND+IN/Wickes) | access-date = December 27, 2019 }}</ref> ) by William C. Wickes in 1986 and published in "Programming Environments", Institute for Applied Forth Research, Inc., 1988, execution follows like so :
 
# Dereference the IP ( instruction pointer ) and store it into O ( current object pointer )
Line 293:
</pre>
 
On HP's [[HP_SaturnHP Saturn|Saturn]] microprocessors that use RPL, there is a third level of indirection made possible by an architectural / programming trick which allows faster execution.<ref name="RPL1"/>.
 
==Branches==