3 ms·
If you program Forth like it's C, and then use a non-optimizing compiler, you're going to have a bad time (e.g. 10/20x slowdowns). I've written Forth compilers
by asguy 6y ago
If you program Forth like it's C, and then use a non-optimizing compiler, you're going to have a bad time (e.g. 10/20x slowdowns).
I've written Forth compilers that generated output that was ~25% slower than optimized assembly, without putting that much work into it. There are companies that will sell you a much better compiler [0], at prices even approachable to hobbyists.
[0] - https://www.mpeforth.com/software/pc-systems/vfx-forth-for-linux/ https://www.mpeforth.com/software/pc-systems/vfx-forth-for-l...
- exikyut 6y agoFWIW: The URL is being truncated right at the "...for-linux" part. I was mildly surprised. This particular distribution also ships with GTK+. That being said, a simple "3 2 1 ?" (I was unsure what word would dump the stack) SIGSEGVs quite consistently. It's also 32-bit, and the backtrace handler produces "XXXX:XXXX" style addresses (?).
- asguy 6y agoYou’re dereferencing an invalid pointer with a variable lookup; try “3 2 1 .s” ... there’re some good ANS Forth gems here [0]. [0] - https://1scyem2bunjw1ghzsf1cjwwn-wpengine.netdna-ssl.com/wp-content/uploads/2018/01/Starting-FORTH.pdf https://1scyem2bunjw1ghzsf1cjwwn-wpengine.netdna-ssl.com/wp-...