: bar [ s" <word>" find-name name>compile execute ] ;
is equivalent to
: bar <word> ;
On 10/29/22 16:41, Ruvim wrote:
On 2022-10-29 16:10, Krishna Myneni wrote:
On 10/29/22 08:41, Anton Ertl wrote:
Krishna Myneni <krishna.myneni@ccreweb.org> writes:
What I should have said is that
compilation of a word should not be done with '(tick) and
"COMPILE," but
start with the name token, e.g. S" <name>" FIND-NAME and then use
NAME>COMPILE and EXECUTE to append the appropriate semantics.
These are two different operations in general:
: foo [ ' <word> compile, ] ;
makes FOO perform the interpretation semantics of <word>.
It is not true that FOO will perform the interpretation semantics of
<word> in Gforth if SET-OPTIMIZER has been used to change the
implementation of its compilation semantics. This is exactly my
objection to SET-OPTIMIZER -- it changes what COMPILE, does.
It's a weak argument, since it can be easily eliminated by a proper
specification for "set-optimizer" (or a similar word).
...
You can't unbreak "COMPILE," with a specification for SET-OPTIMIZER.
I expect "COMPILE," per the standard, to append exactly the semantics
given by xt,
in this case the xt corresponding to the interpretation
semantics of the word.
Although you are fixed on the term "execution
semantics", for a dual-semantics system, '(tick) returns the
interpretation semantics for the word.
The user (or programmer) must rely on "COMPILE," appending exactly the semantics of the xt that is specified, and not substitute some other xt.^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6.2.0945
COMPILE, “compile-comma” CORE EXT
Interpretation: Interpretation semantics for this word are undefined. Execution: ( xt – – )
Append the execution semantics of the definition represented by xt to
the execution semantics of the current definition.
On 2022-10-29 23:14, Krishna Myneni wrote:
On 10/29/22 16:41, Ruvim wrote:
On 2022-10-29 16:10, Krishna Myneni wrote:
On 10/29/22 08:41, Anton Ertl wrote:
Krishna Myneni <krishna.myneni@ccreweb.org> writes:
What I should have said is that
compilation of a word should not be done with '(tick) and
"COMPILE," but
start with the name token, e.g. S" <name>" FIND-NAME and then use
NAME>COMPILE and EXECUTE to append the appropriate semantics.
These are two different operations in general:
: foo [ ' <word> compile, ] ;
makes FOO perform the interpretation semantics of <word>.
It is not true that FOO will perform the interpretation semantics of
<word> in Gforth if SET-OPTIMIZER has been used to change the
implementation of its compilation semantics. This is exactly my
objection to SET-OPTIMIZER -- it changes what COMPILE, does.
It's a weak argument, since it can be easily eliminated by a proper
specification for "set-optimizer" (or a similar word).
...
You can't unbreak "COMPILE," with a specification for SET-OPTIMIZER.
I expect "COMPILE," per the standard, to append exactly the semantics
given by xt,
In what case does it append the semantics given by xt *inexactly*? Could
you provide an example?
in this case the xt corresponding to the interpretation semantics of
the word.
It makes impression that (according to your understanding) the
interpretation semantics of this word and the execution semantics of
this word are *not* the same in this case. It is right?
If they are the same, could you provide an example when they are not the same?
Although you are fixed on the term "execution semantics", for a
dual-semantics system, '(tick) returns the interpretation semantics
for the word.
I just use the language of the standard, and the terminology of the
standard.
The language of the standard is agnostic on whether a system employs the dual-xt or single-xt approach. There is no one reason to expose the
internal details of an dual-xt system when we talk about behavior of a
system that is observable by a standard program.
The user (or programmer) must rely on "COMPILE," appending exactly the^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
semantics of the xt that is specified, and not substitute some other xt.
6.2.0945
COMPILE, “compile-comma” CORE EXT
Interpretation: Interpretation semantics for this word are undefined.
Execution: ( xt – – )
Append the execution semantics of the definition represented by xt to
the execution semantics of the current definition.
BTW, take a look, during compilation of a definition, namely the
execution semantics of this definition are created. And Tick returns an identifier namely of these semantics (this behavior).
Please, don't tell me that in a dual-xt system it creates the
interpretation semantics — it does not matter how your system
intertwists things under the hood — it's its internal business.
From a standard program point of view, this behavior is execution
semantics of the word, which in some cases can be equivalent to the interpretation semantics of the word, of course. But there is no one
case when it's incorrect to call this behavior "execution semantics".
On 2022-10-30 20:02, Krishna Myneni wrote:
| If SET-OPTIMIZER is used to alter
| the compilation semantics of a word
If "set-optimizer" is proper specified, it's impossible to use it to
alter the compilation semantics for a word in a standard program.
Concerning nonstandard programs — they are not in the scope of the
standard at all.
...
From my point of view, "compile," and "execution semantics" are pretty adequate in the model that the standard describes.
There appears to be no immediate resolution for a consensus on these
topics, which is fine. However, I won't engage in an endless
discussion of these topics.
Thank you for the discussion, it was useful anyway :)
On 10/30/22 03:17, Ruvim wrote:
On 2022-10-29 23:14, Krishna Myneni wrote:
On 10/29/22 16:41, Ruvim wrote:
On 2022-10-29 16:10, Krishna Myneni wrote:
On 10/29/22 08:41, Anton Ertl wrote:
Krishna Myneni <krishna.myneni@ccreweb.org> writes:
What I should have said is that
compilation of a word should not be done with '(tick) and
"COMPILE," but
start with the name token, e.g. S" <name>" FIND-NAME and then use >>>>>>> NAME>COMPILE and EXECUTE to append the appropriate semantics.
These are two different operations in general:
: foo [ ' <word> compile, ] ;
makes FOO perform the interpretation semantics of <word>.
It is not true that FOO will perform the interpretation semantics
of <word> in Gforth if SET-OPTIMIZER has been used to change the
implementation of its compilation semantics. This is exactly my
objection to SET-OPTIMIZER -- it changes what COMPILE, does.
It's a weak argument, since it can be easily eliminated by a proper
specification for "set-optimizer" (or a similar word).
...
You can't unbreak "COMPILE," with a specification for SET-OPTIMIZER.
I expect "COMPILE," per the standard, to append exactly the semantics
given by xt,
In what case does it append the semantics given by xt *inexactly*?
Could you provide an example?
See
https://groups.google.com/g/comp.lang.forth/c/dh347IHLDtw/m/YQVN1g-kBAAJ
..
in this case the xt corresponding to the interpretation semantics of
the word.
It makes impression that (according to your understanding) the
interpretation semantics of this word and the execution semantics of
this word are *not* the same in this case. It is right?
If they are the same, could you provide an example when they are not
the same?
Even in a single-xt system with only one xt per word, it makes sense to
talk of interpretation semantics and compilation semantics. Depending on
the immediate flag, the compilation semantics are derived from either executing or compiling the xt. Both involve using the single xt as an argument to the xt of EXECUTE or COMPILE, . Thus tick can always simply return the single xt.
For a dual-xt system, one must choose which xt, xt-interp or xt-comp is returned by '(tick).
It makes sense for backwards compatibility to
return xt-interp for application of '(tick) (and for [']). Here it makes
no sense to say that '(tick) returns the "execution semantics" of the
word. '(tick) specifically returns xt-interp.
The language of the
standard is insufficient (imprecise) to describe the action of '(tick)
for a dual-xt system.
I've pretty much said all I have to say on both the matters of how I
think "COMPILE," should behave, and why "execution semantics" is no
longer an adequate term to use in the specification of some words, if
the standard is to be applicable to both single-xt and dual-xt system.
My views are expressed within my last three topical posts on c.l.f.
There appears to be no immediate resolution for a consensus on these
topics, which is fine. However, I won't engage in an endless discussion
of these topics.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 50:08:42 |
Calls: | 6,711 |
Calls today: | 4 |
Files: | 12,243 |
Messages: | 5,354,920 |
Posted today: | 1 |