Talk:Threaded code: Difference between revisions

Content deleted Content added
Guenthert (talk | contribs)
History - TRW-133: new section
 
(20 intermediate revisions by 13 users not shown)
Line 1:
{{WikiProject Computingbanner shell|class=startStart|importance=}}
{{WikiProject Computing|importance=}}
}}
== subroutine call techniques: All code is threaded code? ==
 
Line 60 ⟶ 62:
--[[User:DavidCary|DavidCary]] 12:37, 13 July 2005 (UTC)
 
: Yes; see [[Stack machine]] and hardware specifically designed to run threaded code. [[User:Alextangent|Alex]] 12:03, 27 March 2006 (UTC)
 
:: Sorry, [[stack machine]] [[User:Alextangent|Alex]] 14:29, 27 March 2006 (UTC)
:: Can anyone give me a direct link to "hardware specifically designed to run threaded code"?
:: I looked at [[stack machine]], and I see "threaded code" mentioned twice.
:: Once in a section describing interpreters for virtual stack machines running on pre-existing register-machine hardware, which is clearly *not* "special hardware to directly process threaded code".
:: Once in a section describing hybrid machines that combine register-machine architecture with an additional "memory address mode which emulates the push or pop operations of stack machines", which I admit is *helpful* in an interpreter that processes threaded code, but as far as I can tell still *indirectly*.
:: Is there some other section that *alludes* to "threaded code" without specifically mentioning that phrase?
:: Did perhaps the [[stack machine]] article once described hardware specifically designed to directly run threaded code, but that information somehow got lost in the 14 years (!) since the above comments?
:: --[[User:DavidCary|DavidCary]] ([[User talk:DavidCary|talk]]) 22:22, 1 July 2020 (UTC)
::: Well, the "PC=(A)" and "PC=(C)" instructions on the [[HP Saturn]] microprocessors are ''specifically'' designed to run [[RPL (programming_language)|RPL]] ( specifically, see eg. [[Threaded code#RPL|the threaded code RPL section]] ), which is a combination of direct and indirect threaded code. [[User:Jdbtwo|Jdbtwo]] ([[User talk:Jdbtwo|talk]]) 19:46, 2 July 2020 (UTC)
 
== Brad Rodriquez's articles ==
Could someone add a link to Brad Rodriquez's "Moving Forth" articles?
 
http://www.zetetics.com/bj/papers/
https://www.bradrodriguez.com/papers/moving1.htm
 
Also, I think 'w' is 'working register' not 'word pointer'.
Line 82 ⟶ 93:
--[[Special:Contributions/68.0.124.33|68.0.124.33]] ([[User talk:68.0.124.33|talk]]) 18:33, 18 January 2008 (UTC)
 
The [[Parallax_Propeller]] has a 'CALL' assembler instruction (which shares the instruction bits with the op-code of 'JMP'), but no stack pointer (that instruction cannot be used for re-entrant code), so I think it qualifies ;-} <small><span class="autosigned">—&nbsp;Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Guenthert|Guenthert]] ([[User talk:Guenthert|talk]] • [[Special:Contributions/Guenthert|contribs]]) 20:41, 20 July 2015 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
 
== some redundancies cannot be eliminated by subroutines ==
Line 141 ⟶ 152:
Would this article be easier to understand if we revert to approach (b), or if we delete those dangling references and try to switch to approach (a)?
--[[User:DavidCary|DavidCary]] ([[User talk:DavidCary|talk]]) 18:23, 15 May 2011 (UTC)
 
I've switched to (a) but the dangling references remain in source (commented out), just in case. It might be prudent to move the text down, where a bytecode interpreter is in fact given after threaded code discussion is done. [[User:Eritain|eritain]] ([[User talk:Eritain|talk]]) 19:09, 12 June 2019 (UTC)
 
== Notation ==
Line 151 ⟶ 164:
 
C and Forth are at opposite ends of the spectrum on so many issues. It just seems *wrong* to give examples of threaded code using C idioms.[[Special:Contributions/87.68.22.118|87.68.22.118]] ([[User talk:87.68.22.118|talk]]) 19:39, 23 February 2014 (UTC)
 
== Example from register based Parrot VM ==
 
Simple example (in [[Parrot virtual machine]] source) with function base opcodes, switched opcode core and [[Goto#Computed_GOTO|CGOTO]] core is [https://github.com/parrot/parrot/blob/master/examples/c/nanoparrot.c examples/c/nanoparrot.c]. I did some tests a long ago, see [http://perl6.cz/wiki/Nanoparrot Nanoparrot]. --[[User:Michal Jurosz|mj41]] ([[User talk:Michal Jurosz|talk]]) 22:01, 30 October 2015 (UTC)
 
== Psuedocode examples are confusing and possibly wrong ==
 
Currently, the psuedocode examples are C-like enough that people might assume they follow the rules of C. However, each one of these examples falls victim to undefined behavior, more specifically, unsequenced modification and access. In order to clarify to the readers of the article the exact behavior of what this would look like in a C-like language, I believe we should rewrite the C-like pseudocode so that it does not contain what is considered undefined behavior in C. However, to try and work towards a better article, I would like to know if anybody has potentially better ideas for what could be done. I was thinking maybe switching pseudocode styles altogether? Thanks!
 
[[User:Bulbazord|Bulbazord]] ([[User talk:Bulbazord|talk]]) 04:10, 11 November 2016 (UTC)
 
I've suggested a syntax modification below: specifically, not using the & character for every array element, and switching from a C-switch style to a C-procedure style: I specifically consider the use of named blocks syntactically beneficial. [[Special:Contributions/2602:301:7764:AC00:9ED:9E40:9294:D87|2602:301:7764:AC00:9ED:9E40:9294:D87]] ([[User talk:2602:301:7764:AC00:9ED:9E40:9294:D87|talk]]) 22:43, 1 June 2019 (UTC)
 
== Threading models and example syntax ==
 
The section describing Direct Threaded code says the following:
 
''This form is simple, but may have overheads because the thread consists only of machine addresses, so all further parameters must be loaded indirectly from memory.''<ref>https://en.wikipedia.org/wiki/Threaded_code#Direct_threading</ref>
 
before later giving an example of direct-threaded code that contains inlined constants (A and B), in direct contradiction to the quote I've provided above. I propose the following wording be used in it's place:
 
''This form is simple, but if the thread consists only of machine addresses, then all further parameters must be loaded indirectly from memory, which may impose overheads.''
 
 
Additionally, a grammar similar to C (in particular, using switches) is used, but constants appear to be referenced via address, yet used as values! I advise replacing instances of &A or &B with simple A or B, and using a C-procedure style grammar instead of a C-switch grammar, perhaps with something like "jump" or "jump to" at the start of a reference to another piece of code, to clarify the manner in which the code in question is being used.
 
[[Special:Contributions/2602:301:7764:AC00:9ED:9E40:9294:D87|2602:301:7764:AC00:9ED:9E40:9294:D87]] ([[User talk:2602:301:7764:AC00:9ED:9E40:9294:D87|talk]]) 22:39, 1 June 2019 (UTC)
 
{{reflist-talk}}
 
== Definition of threaded-interpreted language / TIL ==
 
Abbr. "TIL" is not introduced (sub section ''[[Threaded_code#RPL|RPL]]''). It is probably for ''"threaded-interpreted language"'', but this is not defined (what is it precisely?).
 
Or [http://wiki.c2.com/?ThreadedInterpretiveLanguage threaded-interpretive language], not threaded-interpreted language?
 
--[[User:Mortense|Mortense]] ([[User talk:Mortense|talk]]) 18:25, 20 May 2021 (UTC)
: I have reworded this paragraph to include a definition of the term. Yes, it's ''threaded interpretive language'', although some people erroneously use ''threaded-interpreted language''. --[[User:Matthiaspaul|Matthiaspaul]] ([[User talk:Matthiaspaul|talk]]) 19:55, 3 August 2023 (UTC)
 
== Does "bit" mean "little"? ==
 
The phrases "which reads the symbolic language a bit at a time" and "each bit exists in only one place" use the word "bit" which may be confused for the computing meaning, rather than e.g. "little". Just in case early machines did read single bits while interpreting, I opened this discussion rather than making the edit. [[Special:Contributions/47.154.80.218|47.154.80.218]] ([[User talk:47.154.80.218|talk]]) 18:49, 29 November 2022 (UTC)
 
== History - TRW-133 ==
 
Shouldn't {{alink||History}} mention the TRW-130 and TRW-133<ref>{{cite magazine
| title = The TRW-133 computer
| author = W. C. McGee
| date = February 1964
| magazine = [[Datamation]]
| number = 2
| volume = 10
| pages = 27-29
| editor = ROBERT B. FOREST
| publisher = GARDNER F. LANDON
}}
</ref> as early exemplars of threaded code? -- [[User:Chatul|Shmuel (Seymour J.) Metz Username:Chatul]] ([[User talk:Chatul|talk]]) 15:27, 8 May 2025 (UTC)
 
<!-- Keep after last sig -->
{{reflist-talk}}