Re: Actually... why not?

Liste des GroupesRevenir à cl forth 
Sujet : Re: Actually... why not?
De : anton (at) *nospam* mips.complang.tuwien.ac.at (Anton Ertl)
Groupes : comp.lang.forth
Date : 11. Jun 2025, 22:16:06
Autres entêtes
Organisation : Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID : <2025Jun11.231606@mips.complang.tuwien.ac.at>
References : 1
User-Agent : xrn 10.11
zbigniew2011@gmail.com (LIT) writes:
I mean: when a variable if found,
instead of its CFA - 'LIT PFA' should
be compiled directly. When a constant
is found — 'LIT <value>' should be compiled,
instead of constant's CFA.

That's what you get in Gforth since before 0.7:

variable v  ok
5 constant c  ok
: foo v c ;  ok
simple-see foo
$7FCBB58A0DF8 lit    0->0
$7FCBB58A0E00 v
$7FCBB58A0E08 lit    0->0
$7FCBB58A0E10 #5
$7FCBB58A0E18 ;s    0->0  ok

The disassembly varies a little by version.

Do I miss anything, any eventual problem?

It requires more work in COMPILE, than just doing a ",".  But having a
user-extensible intelligent COMPILE, (like Gforth) offers a number of
advantages, especially for native-code compilers.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.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/

Date Sujet#  Auteur
11 Jun 25 * Actually... why not?13LIT
11 Jun 25 `* Re: Actually... why not?12Anton Ertl
12 Jun 25  `* Re: Actually... why not?11LIT
12 Jun 25   `* Re: Actually... why not?10Anton Ertl
12 Jun 25    +* Re: Actually... why not?4LIT
12 Jun 25    i+- Re: Actually... why not?1LIT
12 Jun 25    i`* Re: Actually... why not?2Anton Ertl
12 Jun 25    i `- Re: Actually... why not?1LIT
12 Jun 25    `* Performance benefits of primitive-centric code (was: Actually... )5Anton Ertl
13 Jun 25     `* Re: Performance benefits of primitive-centric code4minforth
13 Jun 25      +* Re: Performance benefits of primitive-centric code2Paul Rubin
13 Jun 25      i`- Re: Performance benefits of primitive-centric code1Anton Ertl
13 Jun 25      `- Re: Performance benefits of primitive-centric code1Anton Ertl

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal