4 ms·
I love Forth, but for me it is not a viable programming language to do general purpose work in. It is not even particularly good in the niches it once served in
by howerj 6y ago
I love Forth, but for me it is not a viable programming language to do general
purpose work in. It is not even particularly good in the niches it once served
in either, such as in the embedded realm and memory constrained systems.
Learning the language, and more importantly implementing my own Forth, has made
me a better programmer, but I do not think I would ever use it professionally.
It is quite a poor language for modern software development.
The advantages of Forth are nearly never useful to a modern application, mobile or
web developer. The advantages are; works well on a memory constrained system
(think kilobytes not megabytes), it is good for writing assemblers and cross
compilers for Forth (I think we can agree that most developers are not going
to be porting a programming language to a new architecture in order to write
a CRUD application), and poking hardware and hardware registers interactively
which goes without saying - the vast majority of programmers will never do,
only embedded and kernel developers on any regular basis.
Instead it has many disadvantages like poor string handling, global state
being the default and not the exception, poor support for structures (I
know you can make your own but that does not make them good), and even worse
memory safety than C. That is just that language itself, the ecosystem around
it is just as bad, there are few libraries for generic functions, and it is
most likely that they will require some kind of porting to the Forth you are
using, there is a saying within the Forth community - "If you have seen one
Forth, you have seen one Forth", they are different in quite fundamental ways.
It just does not solve modern problems but ones that were relevant in the
1980s on microcomputers.
The reason I like Forth is because I like reinventing the wheel, understanding
how systems are implemented, and puzzles. I do not like Forth because it is
good at getting things done.
- smoyer 6y agoI learned Forth specifically to get a posted job shortly after this book was published but my first exposure to the language was through a port someone in my local computer club did onto the ZX-81 (he also built a raster graphics system!). There are concepts in Forth that are included in some modern languages/environments but I agree that it's really not suited for much today. We used it in control systems and today would probably choose something like Erlang instead - it was perfect for this type of application.
- linschn 6y agoA new niche where forth's qualities shine is smart contracts. Michelson, the language for smart contract on the tezos blockchain is forth like. It is a pleasure to work with and it is relaricely easy to prove non trivial properties of a specific program.