Forth200x: Serious design flaw in deferred words proposal.
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Forth200x: Serious design flaw in deferred words proposal.         


Date: Aug 16, 2007 05:34

Every word that plays with full qualified XTs is part of the compiler/
interpreter system. An XT may not only be an address of code in memory
but may point to additional informations. A word that plays with full
qualified XTs is not easy to target compile without to compile the
whole system of XTs (whatever this means for a specific system).

In the proposal there are only two words that need full qualified XTs:
DEFER@ and DEFER! .

I would suggest to introduce something like "lesser qualified XTs"
that are only to be used by the DEFER-words & friends, eg. a DXT. So
the stack diagrams would look like:

DEFER ( "name" -- ) CORE-EXT

IS CORE-EXT
Interpretation: ( dxt "name" -- )
Compilation: ( "name" -- )
Run-time: ( dxt -- )

DEFER@ ( xt -- dxt ) CORE-EXT

DEFER! ( dxt xt -- ) CORE-EXT
Show full article (1.03Kb)
71 Comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Anton Ertl
Date: Aug 17, 2007 02:00

helmwo@gmail.com writes:
>Every word that plays with full qualified XTs is part of the compiler/
>interpreter system. An XT may not only be an address of code in memory
>but may point to additional informations.

There are no full and lesser qualified XTs in Forth-94 and Forth200x,
there are only XTs, and they seem to correspond to what you call
lesser qualified XTs. You can only use an XT in EXECUTE, "COMPILE,",
and (with additional conditions) in >BODY, DEFER@, DEFER!. An
implementation of such an XT in a traditional-style system is the CFA,
and no name field or link field is necessary; that does not change
with X:deferred.
>A word that plays with full
>qualified XTs is not easy to target compile without to compile the
>whole system of XTs (whatever this means for a specific system).
Show full article (1.68Kb)
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Date: Aug 17, 2007 14:00

On Aug 17, 11:00 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> BTW, I really don't see what problem you see in X:deferred that are
> not already present because of the CORE word EXECUTE. After all, you
> can implement X:deferred in Forth-94
> <http://www.forth200x.org/reference-implementations/deferred.fs>.

I consider words using EXECUTE also as part of the compiler/
interpreter. I do not see much use of EXECUTE for normal programs if
they also could use DEFERs.
Well, the case that you can implement it in Forth-94 does not say
anythings about if it is a good design decision.

I want to explain a little more:
I do use defers a lot with nameless code. I do have some extensions
for it. So for example:
------------------
defer a defer b defer c

: runall a cr b cr c cr ;
Show full article (1.63Kb)
2 Comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Bruce McFarling
Date: Aug 17, 2007 17:29

On Aug 17, 5:00 pm, hel...@gmail.com wrote:
> I consider words using EXECUTE also as part of the compiler/
> interpreter. I do not see much use of EXECUTE for normal programs if
> they also could use DEFERs.

xt's and EXECUTE are the foundation of portable state machines ...
which are an important class of "normal" program.
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Andrew Haley
Date: Aug 18, 2007 00:17

helmwo@gmail.com wrote:
> On Aug 17, 11:00 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> wrote:
>> BTW, I really don't see what problem you see in X:deferred that are
>> not already present because of the CORE word EXECUTE. After all, you
>> can implement X:deferred in Forth-94
>> <http://www.forth200x.org/reference-implementations/deferred.fs>.
> I consider words using EXECUTE also as part of the compiler/
> interpreter. I do not see much use of EXECUTE for normal programs if
> they also could use DEFERs.

Ok, so you don't see much use of vectored execution arrays, state
machines, and thread-specific vectors in "normal programs", whatever
one of those might be!

Andrew.
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Anton Ertl
Date: Aug 18, 2007 02:03

helmwo@gmail.com writes:
>On Aug 17, 11:00 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>wrote:
>
>> BTW, I really don't see what problem you see in X:deferred that are
>> not already present because of the CORE word EXECUTE. After all, you
>> can implement X:deferred in Forth-94
>> <http://www.forth200x.org/reference-implementations/deferred.fs>.
>
>I consider words using EXECUTE also as part of the compiler/
>interpreter. I do not see much use of EXECUTE for normal programs if
>they also could use DEFERs.
>Well, the case that you can implement it in Forth-94 does not say
>anythings about if it is a good design decision.

It says that its implementation does not need any richer XTs than the
CORE wordset already needs.

BTW, it's also possible to implement EXECUTE with X:deferred:
Show full article (2.96Kb)
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Date: Aug 18, 2007 08:15

On Aug 18, 11:03 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
wrote:
> hel...@gmail.com writes:
>>On Aug 17, 11:00 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
>>wrote:
>
>>> BTW, I really don't see what problem you see in X:deferred that are
>>> not already present because of the CORE word EXECUTE. After all, you
>>> can implement X:deferred in Forth-94
>>> <http://www.forth200x.org/reference-implementations/deferred.fs>.
>
>>I consider words using EXECUTE also as part of the compiler/
>>interpreter. I do not see much use of EXECUTE for normal programs if
>>they also could use DEFERs.
>>Well, the case that you can implement it in Forth-94 does not say
>>anythings about if it is a good design decision.
>
> It says that its implementation does not need any richer XTs than the
> CORE wordset already needs.
> ...
Show full article (4.07Kb)
1 Comment
Re: Forth200x: Serious design flaw in deferred words proposal.         


Date: Aug 18, 2007 08:18

On Aug 18, 2:29 am, Bruce McFarling netscape.net> wrote:
> On Aug 17, 5:00 pm, hel...@gmail.com wrote:
>
>> I consider words using EXECUTE also as part of the compiler/
>> interpreter. I do not see much use of EXECUTE for normal programs if
>> they also could use DEFERs.
>
> xt's and EXECUTE are the foundation of portable state machines ...
> which are an important class of "normal" program.

Can you read? I wrote if a program also could use DEFERs.
HelFORTH 1.0 had code for state machines. But I did not use it much.

-Helmar
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Coos Haak
Date: Aug 18, 2007 08:48

Op Sat, 18 Aug 2007 08:15:52 -0700 schreef helmwo@gmail.com:
> On Aug 18, 11:03 am, an...@mips.complang.tuwien.ac.at (Anton Ertl)
> wrote:
>> You lost me here. How is that related to the discussion at hand?
>
> It seems I lost you a little bit before...
> Again: the DXTs I want are not fully qualified XTs. They are i.e. a
> pointer to code (whatever this means for a specific system). Just like
> what BEGIN will have to put on the compilation stack in some way.
> To have ANS compatiblity, my system has to use rich XTs. A simple
> point to explain is VARIABLE. In ANS it is possible to tick a
> variable, get an XT and execute it. It's absolutely not obvious that

Correction: In ISO Forth it's not guaranteed that you can tick a VARIABLE
or even a CONSTANT or (horror) a colon definition. Only words created with
CREATE can be ticked.
You must be referring to Figforth, Forth-97 and Forth-83. Not Forth-94!
Show full article (1.66Kb)
no comments
Re: Forth200x: Serious design flaw in deferred words proposal.         


Author: Bruce McFarling
Date: Aug 18, 2007 08:54

On Aug 18, 11:18 am, hel...@gmail.com wrote:
> Can you read? I wrote if a program also could use DEFERs.

I can read ... can you? Doing state machines using DEFER alone in the
absence of EXECUTE would be a kludgy work-around because EXECUTE was
not available.
> HelFORTH 1.0 had code for state machines. But I did not use it much.

This is probably the source for your limited view of the utility of
EXECUTE
no comments
1 2 3 4 5 6 7 8