Sujet : Re: EXECUTE implementation in native-code systems
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forthDate : 17. Mar 2025, 18:46:56
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Mar17.184656@mips.complang.tuwien.ac.at>
References : 1 2 3 4 5 6
User-Agent : xrn 10.11
dxf <
dxforth@gmail.com> writes:
Also for optimizing native-code it may be 'xt EXECUTE' itself will
be optimized away.
Yes:
Gforth (development):
: foo ['] . execute ; ok
see foo
: foo
. ; ok
That's a result of the constant-folding optimization. I wonder how
often it triggers. Probably not much in real-world code.
Since the Standard doesn't specify a nest-sys in
relation to EXECUTE we can safely assume there isn't one?
That's the question: The standard does not specify the nest-sys, so
how can the native-code systems get away with implementing EXECUTE as
call? It's because there is no standard way to observe the return
address pushed by that call.
The way the standard describes what happens corresponds to an
indirect-threaded code system: EXECUTE does not push a return
address/nest-sys, and for, e.g., constants, there is never a return
address pushed. The initiation semantics of a colon definition (i.e.,
docol) pushes the return address/nest-sys.
Native-code systems deal with it a little differently, but that
difference causes no standard-observable change in behaviour.
- anton
-- M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.htmlcomp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html New standard: https://forth-standard.org/EuroForth 2023 proceedings: http://www.euroforth.org/ef23/papers/EuroForth 2024 proceedings:
http://www.euroforth.org/ef24/papers/