Re:Jonesforth: Implementing Forth in Assembly
by voldacar on Tuesday April 07, 2020 @09:27AM
(#22802991)
So basically the opposite of APL.
[ Parent
| on HN ]
Re:Jonesforth: Implementing Forth in Assembly
by rwmj on Tuesday April 07, 2020 @09:46AM
(#22803140)
Any language that arranges data in arrays or large structs does well on modern machines, especially with vector and SIMD extensions. To be fair to Forth, there exist machines that are well-suited to running "threaded code"[1], it's just that they are not machines that are commonly available today.
[1] "threaded" has nothing to do with multithreaded: https://en.wikipedia.org/wiki/Threaded_code
Re:Jonesforth: Implementing Forth in Assembly
by throwaway_pdp09 on Tuesday April 07, 2020 @12:37PM
(#22804746)
I don't buy this. I understand the use of your term 'threaded', but these are unconditional and therefore can be incorporated into the instruction pipeline with little or no overhead. Here's a very old SO post, CPus won't have got worse since then
https://stackoverflow.com/questions/5127833/meaningful-cost-...
"But in general, on modern processors, there is minimal cost for an unconditional jump. It's basically pretty much free apart from a very small amount of instruction cache overhead. It will probably get executed in parallel with neighbouring instructions so might not even cost you a clock cycle. "
Re:Jonesforth: Implementing Forth in Assembly
by rwmj on Tuesday April 07, 2020 @01:03PM
(#22805080)
If they were all unconditional, that would be fine. The problem is they are all computed jumps (see jonesforth for details).
Re:Jonesforth: Implementing Forth in Assembly
by throwaway_pdp09 on Tuesday April 07, 2020 @01:15PM
(#22805228)
I see what you're getting at now, thanks