Forth code runs surprisingly fast. Here is a delay loop which does nothing:
: delay 0 do loop ; ok.
And this code:
10000000 delay ok.
… takes about 3.5 seconds before printing out the final “ok.” prompt. That’s some 3 million iterations per second. Not too shabby, if you consider that the LPC1114 runs at 12 MHz!
Edit: Oops, I did misunderstand - there's no repeated function call, so this is a counted but empty loop taking 4 ticks for each time round. Still not much by way of overhead.
[Previously: Am I missing something? That seems quite impressive, for an interpreted language, to call a function in just 4 ticks - even if the function does nothing, doesn't it still have to do the nothing? In effect this Forth is running very close to native speed, which is about as good as it gets.]
The Parallax Propeller chip has at least three Forth variants on it. The two most popular are PropForth and TachyonForth. PropForth is closer to standard Forths while Tachyon is much faster. I've done two projects in PropForth