A Dynamic Forth Compiler for WebAssembly
el-tramo.be
el-tramo.be
Bonus for writing the core in Webassembly, but then writing some of the more tedious parts in Racket.
I was really impressed with the speed metrics. I would have guessed that it would be much faster than a JS version, but would have never guessed on those low numbers.
Congrats on a very cool project!
On older machines, you will find published benchmarks showing FORTH to be 10 times slower than assembly. Compare this to BASIC which was usually 30-40 times slower than assembly in the best bases.
I think your 3x speed difference between C and FORTH to be on the ball for these earlier machines.
The other advantage of FORTH on these old microcomputers/microcontrollers is that threaded code tends to be quite compact, so you can write larger programs. Efficient use of memory was tantamount on old machines and controllers.
Production Forths like SwiftForth apparently have optimizing compilers, but I've never used them.
Modern FORTHs are all compiled (as indeed are modern Javascripts). In my view FORTH is a pretty horrible language to write code in, and if you lose the advantage of the compact code for the embedded case then you might as well use a nice compiled language - whatever is your preference, but my preference would not be FORTH if I had to write code all day long in it.
Factor made a few waves a decade ago but has kind of lost steam[1]. It's still being developed though[2]. Kitten looks promising but develops at a snail pace because it's one guy doing it[3]. Not a dig against him, mind you!
[0] http://concatenative.org/wiki/view/Front%20Page
The documentation is first rate with exact descriptions in the code.
As far as the FORTH being a horrible language, to some extent it is. But if you are stuffing into a small chipset it's good. Granted there are things like Lua now, but back in the early years, FORTH was a huge tool for imbedded systems.
[1] https://github.com/remko/waforth/blob/master/src/waforth.wat
He is using Racket.
If more EEs had experience with REPL languages, they'd know what they're missing, and things probably would have turned out differently. His use of Scheme was not a surprise.
Thank you for fighting the good fight Remko.
Prolog classes were actual programming with SWI Prolog.
Additionally there are national competitions between universities in logic programming, with Prolog as the official language.