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 : 29. Sep 2024, 19:33:10
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <87cykmcntl.fsf@nightsong.com>
References : 1 2 3 4 5
User-Agent : Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
albert@spenarnc.xs4all.nl writes:
My own idea of purity says to use a simple interpreter and accept the
speed penalty, using CODE when needed.
>
Indirect threaded code is a clear expression of programmers intent.
The only requirement for an optimiser is that the results are the
same. The program can be shorter or faster. Locals are a hindrance.
Well, the philsophical idea I'm coming from is that Forth is a difficult
languge that makes unusual demands on the programmer. That is a cost of
using it. In exchange it gives extreme simplicity and clarity of
implementation, and the ability to host itself on very limited machines.
Those are benefits.
If you're going to implement an optimizing compiler, you've got the
machine resources to host it and the willingness to deal with its
complexity. That is, you're not really in need of Forth's benefits. So
maybe you can also bypass some of its costs.
Thus, I think of a "pure" Forth as a simple interpreter (maybe not
ITC). Once I have a bigger machine etc., I start thinking about Lisp.