Path: csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.forth Subject: Re: Avoid treating the stack as an array [Re: "Back & Forth" is back!] Date: Sun, 29 Sep 2024 11:33:10 -0700 Organization: A noiseless patient Spider Lines: 21 Message-ID: <87cykmcntl.fsf@nightsong.com> References: <87zfo4zps8.fsf@nightsong.com> <66eba538$1@news.ausics.net> <87h69zcxlh.fsf@nightsong.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 29 Sep 2024 20:33:11 +0200 (CEST) Injection-Info: dont-email.me; posting-host="2f881d26a6f94e9bd1e19c8f3a5f18ce"; logging-data="1948046"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/vilY6TEXVRCxUuZT8UPAk" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cancel-Lock: sha1:TuBzDCcPz8FHz7P2hqCGksZwa6Y= sha1:GtApOB+h0rMh75aXCACkT/aGSkQ= Xref: csiph.com comp.lang.forth:132360 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.