|
|
|
|
|
by astrobe_
2587 days ago
|
|
Yes, sure. That's why you have VBA, Java, Perl, C, Newlisp, Fortran, Python projects that are maintenance nightmare. Forth is nothing special with regard to this concern. Code quality has a lot more to do with the skills of the writer than the peculiarities of the language. Except perhaps that you are more concerned with code quality when you know that it will be hard to read a couple of months later if you are sloppy. Forth is unforgiving in many ways like an old master. There are people who call him a bad teacher, and there are people who listen to him. This is the difference between good students and bad students. Anyway, the fact that Forth, Inc., has been in business for forty years and is still taking new commercial projects [1] is enough of a proof that Forth is more than just the code written by hobbyists you see on GitHub. [1] https://wiki.forth-ev.de/doku.php/events:ef2018:forth-in-tha... |
|
When we look at a clump of Forth code that's supposed to be a function, unless there is commentary, we don't know how many arguments it takes or how many values it leaves on the stack.
We don't have this problem with VBA, Java, Perl, C, Newlisp, Fortran or Python.
Forth is an assembly language for a pretty low level stack-based virtual machine. (And such machines are very popular, though rarely programmed by hand.)
It's not a good VM for compiling dynamic languages; it provides no run-time check on mismatched function arguments, and generating code to do that would be inefficient and incompatible with regular Forth function calls. (E.g. we can have a calling convention whereby we push the argument count that the callee will pop and check.)
Forth could be a good target for a static language where function calls are checked at compile time against declarations.
> Forth is unforgiving in many ways like an old master.
Forth is completely forgiving, like an old buffoon. Pass four arguments to a three-argument function? All is forgiven.