

I hate Forth - dimitar
http://www.embedded.com/story/OEG20010731S0028

======
gvb
My observation of Forth is that it is used to write an _undocumented_ [1] DSL
and then solve the actual problem using that DSL.

This is great if you were the one that wrote the DSL and thus understand it
intimately (having a prodigious ability to memorize is pretty important too).
On the other hand, it sucks if you didn't write the DSL and have to understand
how to use it or fix bugs in it because you first have to reverse-engineer the
DSL. Reverse-engineering the DSL may take as long as writing it in the first
case.

[1] The biggest documentation failure I typically have seen in Forth is a
failure to document the word's parameters, i.e. the stack contents going into
and returning from words. This is aggravated by the stack manipulation
operations duping, swapping, etc. that look more like a game of "15 squares"
<http://en.wikipedia.org/wiki/Fifteen_puzzle> than an algorithm.

~~~
chipsy
Stack languages present a troublesome problem for documentation. Forth in
particular is untyped, but my own experience was with a small
compiler/interpreter I wrote over a dynamic language(haXe). The language was
easy to implement, and it solved one domain problem very well(in-game
dialogue) and another not so well(choreographing two-dimensional movement
patterns). I've filed it away as "cool experiment." My implementation allowed
the same syntax to be used with different semantics - a batch compiled word,
or words sliced up into lists of function calls, which made them usable in
continuation-passing style - very useful for my in-game dialogue.

The debugging I encountered mostly revolved around correcting stack
manipulations so that things lined up with the right parameters. The brevity
of these languages comes from the stack allowing implicit parametrization;
just list your data and then the word you want to use. The downside comes from
this property also allowing the stack to leak when under or over-parametrized
- enabling mystery behavior or crashes that you wouldn't see with C-style
calling conventions.

On the other hand, a major plus: Working with the stack lets you avoid
littering your code with named variables. This is what enables Forth words to
have extremely high density and readability, and I've incorporated more of
this style into my coding elsewhere, so that in the most extreme case, I might
go ahead and set up a stack in(for example) an object, and then list out
method calls like a high-level Forth operation:

obj.wordA(); obj.wordB(); obj.wordC();

Blending this with more imperative or functional constructs, I can get the
best of both worlds: something compact and readable but also self-documenting,
with decent type and parameter safeness.

------
CapitalistCartr
Reminds me of cats. Ask someone who hates cats to describe cats, and cat
lovers will agree with the description. Cat hater ends with something like,
"And that's why I hate cats," while cat lover ends with, "And that's why I
love cats." Both to the same description.

~~~
DannoHung
I like cats, but I am really allergic to them, and thus hate being around
them.

What is the similar situation for a programming language?

~~~
zck
I have had people assert that they are allergic to parentheses, causing them
to hate Lisp.

Of course, offering to make them a read macro to let them use any two other
characters in place of parentheses didn't help, but such is life.

------
jrockway
What a strange article. He's upset because it's easy to experiment and test
with Forth? OH NOES, TEH TERRIBLES!!

If you don't like interactive development, then just type everything into a
file, compile it, and run. The choice is yours.

If there's something to complain about with respect to Forth it's the
flakiness of concatenative programming. I'd rather write a program in terms of
function application or sending messages than in stack transforms. That's why
I don't like Forth, and is probably the only _real_ reason to dislike it.
Everything the author dislikes is in his coworkers, not in the language.

------
pvdm
He mentioned everything I like about Forth. Peek and poke machine registers.
Quick check out of hardware. Forth should be in the toolkit of any one
bringing up new hardware. What is there to hate about it ? Every tool has it's
limitations and should be judiciously applied to each task.

------
colig
Note the article was written in 2001.

------
csmeder
"Well, now when this all is over, I want to tell you that thisarticle
definitely was a joke. ... But why people did not take this article as a joke?
Because one has to know Forth to understand this joke. Given that most people
do not know Forth, distribution of such articles is anti-education."

The article was satire?

------
csmeder
Are any HN users using forth in your personal life at work? I haven't seen it
mentioned here much.

~~~
vineeth
It's used as a shell interface in Open Firmware. So, it's in more places than
most realize.

BTW, the phrase "personal life at work" is amusing.

~~~
csmeder
haha, oops. I meant to say "personal life or work"...

------
Daniel_Newby
This seems to be a rant about the limitations of certain language tools, not
the language itself.

