4 ms·
Now the important question is...is that the fault of FORTH, or the fault of the developer? Are the developers novices who cannot handle the POWER of FORTH?!?!
by omouse 18y ago
Now the important question is...is that the fault of FORTH, or the fault of the developer? Are the developers novices who cannot handle the POWER of FORTH?!?!
- silentbicycle 18y agoCharles Moore himself said, "…FORTH is an amplifier. A good programmer can do a fantastic job with FORTH; a bad programmer can do a disastrous one." From my own experiments with it, I can certainly see where he's coming from - badly factored Forth rapidly collapses into an unintelligible mess, but when you work idiomatically with the language, it can be quite expressive. It's pretty low level, but worth considering in a project that would otherwise use assembler. I'd be wary of using it unless several team members were already familiar with it, though. I haven't done a great deal with Forth day-to-day because it's a pretty bad mismatch for the problem domains I usually work in, but getting into the mindset of it was as enlightening as learning, say, Scheme or ML. Forth has strong incentives for partitioning your code into functions ("words") that are each succinct enough to be trivially testable / verifiable, and then lets you define new words via composition, building up to your problem. It heavily favors the same bottom-up / "build your own DSL" programming style as Lisp. For such a minimalistic language it has several impressive tricks up its sleeve, on par with Lisp's code-is-data. The ease in parsing Forth-like code gives it a lot of potential as an embedded language, e.g. Zed Shaw's "stackish" (http://savingtheinternetwithhate.com/stackish.html http://savingtheinternetwithhate.com/stackish.html). This heavily-documented i386-assembly code implementing a simple, non-optimizing Forth interpreter is worth a look. (http://www.annexia.org/_file/jonesforth.s.txt http://www.annexia.org/_file/jonesforth.s.txt) There's something to be said for a language environment you can easily understand all the way down to the bare metal. It's not difficult to write your own interpreter for a Forth-like language (which is kind of the point).
- eru 18y agoAnd Forth is fun. It's a loveable language. Did you know that 'Open Firmware' uses Forth - as a shell and for configuration code, device drivers etc?
- silentbicycle 18y agoYes, and the FreeBSD bootloader, and no doubt several other things I'm not aware of.