Sujet : Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!]
De : no.email (at) *nospam* nospam.invalid (Paul Rubin)
Groupes : comp.lang.forthDate : 16. Sep 2024, 07:32:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87h6ag1537.fsf@nightsong.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
dxf <
dxforth@gmail.com> writes:
With apparently little issue for the case presented. The push is
to write idiot-proof code that can be used anywhere. Moore calls
that 'solving the general problem' - which he eschews.
Didn't one of the Chuck Moore quotes you posted say using the stacks was
better for information hiding than using globals? That includes the
return or locals stack, of course. Your computer hardware has the
capability of accessing inside the stack randomly, and Forth has words
like 2ROT which reach up to 6 levels deep in the parameter stack.
What's wrong with being able to give names to the cells? I don't
understand the obsession with refusing to use those capabilities of your
hardware.
The central idea of Forth to me is its traditional implementation as a
threaded interpreter with its extremely simple one-pass compiler. That
made it possible to make a complete interactive development environment
on a 1970s minicomputer with a floppy disc. All the language features
like the stack oriented VM are just incidental affordances on the route
to that simple interpreter. To the extent that there is a cult of the
stack machine, I don't belong to it.
Moore calls that 'solving the general problem' - which he eschews.
The idea as I saw it was don't do extra work to solve the general
problem, if a simpler approach solves the immediate problem at hand.
If the general solution takes LESS work then the limited one, then doing
the extra work for the limited solution is just masochism.