Re: [stack] stOck
John Nowak <[email protected]>
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
On Mar 10, 2009, at 6:58 AM, spir wrote:
> * Naming, when carefully done, is an invaluable help to clarity.
Invaluable? It's unable to be valued?
The value of having names can be measured and compared with the value
of taking a pointfree approach. I don't think it's a given that we
need to have names.
> * Stack operations (swap, dup...) do not mean anything about the
> mental 'model'.
Neither do let statements, intermediate variables, or most anything
else. When was the last time you heard a conversation like this:
"Jim, we need a program to keep track of our medical records."
"So you're saying you want something with lexical scoping?"
"Of course; we need to keep track of medical records!"
> About the latter remark: I think that a good program is one that
> mirrors the 'model' it expresses.
You'll have to justify this for me. I'm of the opinion that software
should be easier to reason about than "real life". Once you start
throwing around phrases like "mirroring the model", you shirk
responsibility for coming up with the simplest solution.
> In other words, the choice of a stack to pass data from func to func
> introduces low-level code -- as opposed to high-level languages.
Maybe, but you're not making a convincing case.
> Let us imagine a "stOck" instead of a stack ;-); that could be a
> hash/map/dict, meaning that items are named. Then we get the
> following advantages:
> * naming
> * no stack juggling
> * no dup
But you also get the hell that is dynamic scoping. It might be fine
for pseudo-globals, but it's a disaster for local variables. There's a
reason virtually all Lisps have switched to lexical scoping.
> As a side-effect, this would also let postfix syntax and
> concatenation much more appealing to people used to other paradigms,
> *especially in difficult cases*.
I think the best way to make concatenative languages more appealing is
to focus on their strengths. Making them into postfix variants of
languages people are already using won't do much good.
- John