Re: The IMMEDIATE mess




Alex McDonald wrote:

<snip>
In a dual xt system, something like IF would work as follows;

: IF -14 throw compilation> ( xt of IF -- ) ... ; \ do IF when
compiling stuff

The part before compilation> is interpret time (and is the xt returned
by FIND), the part after is compile time. It's not immediate (it has
non-standard compilation semantics) and it's not state-smart either.
The outer interpreter is state smart, and has enough carnal knowledge
of the dual XT to know which half to execute. In this system, you can
count interpret, compilation and execution uses with (tested on an
experimental STC version of W32F that supports this)

<snip>

That's more or less what my system does. Every word has a pointer to a
semantics class, which contains, amongst other things, two methods
called interpret() and
compile(). Each of these is defined with a :noname definition.
Therefore if::interpret() throws an exception, if::compile() does what
it should. The text interpreter calls interpret() or compile()
depending on the value of STATE or immediacy of the found word.

Perhaps I should make the semantics base class visible to the user, at
present it's hidden.

Gerry

.



Relevant Pages

  • Re: The IMMEDIATE mess
    ... Usually what we need is not IMMEDIATE words or state-smart words. ... The issue doesn't come up after you execute the words. ... -3 normal compilation behavior, do not interpret. ... The part before compilation> is interpret time (and is the xt returned ...
    (comp.lang.forth)
  • Re: JIT Question
    ... >>I believe the options do exist on the Sun JRE, ... >>Mark Thornton ... I interpret that as meaning that it still uses the interpreter to start ... but when it decides a method is worth compiling the compilation is ...
    (comp.lang.java)
  • Re: interpreter vs. compiled
    ... The CPython implementation happens to interpret. ... static compilation to machine code difficult. ... The big problem is "hidden dynamism", ...
    (comp.lang.python)
  • Re: Question about compilation/evaluation environments
    ... Compilation ... Since our differences seem to boil down to how we interpret ... standard may have damaged my brain somewhat. ... along and say "That's nice Dan, but _this_ is how the Lisp community ...
    (comp.lang.lisp)
  • Re: Semantics (interpretation/compilation/execution/etc.)
    ... So I was reading the standard and two old c.l.f. ... interpretation and compilation semantics. ... Its execution semantics are defined by the standard, ...
    (comp.lang.forth)