Anton Ertl wrote:
> But of course, if you have an intelligent COMPILE, (in contrast to
> Bernd Paysan's "smart COMPILE,")
This is not my idea, this is originally Stephen Pelc's idea. I like the
idea, and you did show some considerably sympathy more than 10 years ago,
too.
https://www.complang.tuwien.ac.at/forth/header-ideas.html
I took up the idea after you made that posting which suggested a new header
structure, that includes that compile,-field, but also had a separate
compilation semantics field, but didn't find time to implement it until
2011. When implementing it, it became obvious that you also need a TO-
action (or action pair, one for interpretation, one for compilation), and
that the compilation semantics action in Gforth better can be represented by
a NAME>INT and NAME>COMP action pair; which might also be a unified xt with
EXECUTE for NAME>INT and COMPILE, for NAME>COMP, as I do it for the TO
action.
So the original credit goes to Stephen Pelc (or someone else at MPE),
followed by Anton Ertl, and I'm only third in the chain. For me,
"intelligent COMPILE," is what we had in Gforth 20 years ago, with a
deferred COMPILE, and a CASE statement to do different things for a small
list of doers, and allowed to implement the primitive-centric version of
Gforth. Ugly, maybe "intelligent", but certainly not "smart".
http://dict.leo.org/#/search=smart&searchLoc=0&resultOrder=basic&multiwordShowSingle=on
(look at the adjective translations). "Smart" is also "elegant" and
"proper".
In Stephen Pelc's approach, COMPILE, does perform the compilation semantics
- which normally is appending the execution semantics, and therefore
normally not different from the standard's COMPILE, - and where it *is*
different, only one case of standard words have well-specified properties:
IMMEDIATE words. In his approach, there's a fairly small set of clearly
different concepts. That's not exactly what you want, but it's IMHO a good
idea. And that's why I defend his idea.
IMHO, your idea is too much about preserving backwards compatibility to
something you read into the standard (not something that really exists
outside Gforth), without evidence that people did put that deliberately and
as an informed decision into the standard. The latter is necessary, because
standards come by votes. Only an informed decision can result in a valid
vote, everything else is an accident.
Your concept "breaks symmetry" at two points:
* You distinguish between named and unnamed words
* You distinguish between text interpreter and the usage of xts.
Both are related.
Stephen Pelc showed that unifying that works remarkable well. It is hard to
identify real code breakage (unlike e.g. his source tokenizer, where we have
not only academic examples of broken code, but broken real-world code), and
we made sure that the Forth-2012 is sufficiently ambiguous to fully allow
his apprach. This approach is standard, with the limitation that you can't
do
: immediate ['] execute set-compiler ;
So the old immediate/state concept is a wart here. But at least it is a
legacy concept we can declare obsolescent.
--
Bernd Paysan
"If you want it done right, you have to do it yourself"
net2o ID: kQusJzA;7*?t=uy@X}1GWr!+0qqp_Cn176t4(dQ*
http://bernd-paysan.de/