Hacker News new | ask | show | jobs
by nine_k 1985 days ago
Adding to what is already said:

* Forth is tiny. You don't need a preprocessor, a compiler, a linker. Your entire programming environment, beside the text editor, can live directly on the target MCU.

* Forth is interactive. You can run your code, examine the results, define and redefine words, run again, etc right on the target machine (which may be a tiny controller). Yes, you likely will remove the REPL-related words from the final image (or not), but C can't hold a candle to the interactive development experience of Forth.

* Unlike in C, you can build an economical DSL in Forth to closely match your target domain. What Forth takes away in readability due to the need to think in stack terms, it more than pays back in expressiveness and abstraction, provided certain skill and taste.

While Forth does have an execution overhead and thus cannot obviate C completely in some cases, I've seen e.g. an injection controller for an internal combustion engine which did hard realtime completely in Forth. Hard realtime here means that all computations were clocked by the rotation of the shaft, with precise timing of different phases along the way.