News for hackers. Stuff that matters.
Re:Robot Game: Comparing 6502 C, Assembly, and Forth by zozbot234 on Sunday July 12, 2020 @01:06PM (#23812850)
Yes, FORTH is an elegant alternative to BASIC on very small systems, not something you should expect high performance from.
Re:Robot Game: Comparing 6502 C, Assembly, and Forth by MaxBarraclough on Sunday July 12, 2020 @01:16PM (#23812938)
To mirror asguy's comment, this only tells us about the performance of this particular FORTH engine, it doesn't tell us about the performance inherit to FORTH (which of course doesn't exist, it's down to the engine).

Whether anyone has made a sophisticated optimising FORTH for 6502, I don't know.

Re:Robot Game: Comparing 6502 C, Assembly, and Forth by Dr_Jefyll on Sunday July 12, 2020 @02:49PM (#23813721)
>this only tells us about the performance of this particular FORTH engine

Yes, exactly. Whatever its other qualities may be, I suspect this particular Forth has overlooked some pretty obvious low hanging fruit, performance-wise. In this[1] post we learn that LOOP puts a 1 on the stack then falls into +LOOP. Although there's elegance (and a memory saving) to that approach, I'm startled that they didn't provide a dedicated definition for LOOP instead. AIUI, implementing LOOP as an instance of +LOOP substantially and needlessly increases the complexity of what gets executed. Yes, I know premature optimization should be viewed with suspicion, but if profiling were performed it's hard to believe LOOP wouldn't be a hot spot! So, I constructively suggest that in this respect at least (and perhaps there are others) this Forth engine could benefit from some tuning up.

[1] http://forum.6502.org/viewtopic.php?p=76849#p76849