Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #21388

Re: Difficulty with Brad Rodriguez' screenful

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: Difficulty with Brad Rodriguez' screenful
Date 2013-04-04 23:06 +0200
Organization 1&1 Internet AG
Message-ID <kjkq04$te5$1@online.de> (permalink)
References (11 earlier) <2013Apr3.181309@mips.complang.tuwien.ac.at> <kji35a$4nd$1@online.de> <2013Apr4.175330@mips.complang.tuwien.ac.at> <kjkmpq$rd0$1@online.de> <kjko25$e2p$1@dont-email.me>

Show all headers | View raw


Gerry Jackson wrote:
> Sorry to butt in but would you please explain what you mean by a
> 'monotoken system' and how it differs from what you have previously
> described for recognisers.

Ok, the previous Gforth since 1996 was a dual-xt+nt(+ct) system, i.e. a word 
could have three tokens which represented some, but never all aspects of the 
word, and conversion was a one-way street, with the nt as starting point, 
though not all words have an nt (:NONAME definitions don't).

nt: name token.  If you imagine a traditional word header as in Starting 
Forth, you have link field (linked list of words), count+flags field, the 
string with the name of the word, the code field, and the body ("parameter 
field").  The nt actually points to the link field, it is only available on 
named words, not on :NONAME.  The nt allows access to compilation and 
interpretation semantics, but no direct usage of those - you have to convert 
the nt to an xt or two.

xt: execution token.  That's pointing to the code field in a traditional 
implementation, and therefore was called cfa.  In Gforth up to half a year 
ago, FIND could return two different xts, depending on STATE - one for the 
compilation semantics, one for the interpretation semantics.

ct: compilation token.  To better deal with compilation, we also had a 
compilation token, which consists of two xts.  One is the xt of the word 
itself, the other (on top of stack) is either EXECUTE or COMPILE,, depending 
on the immediacy of the word (you can get the ct only from the nt, because 
there, the immediate flag is accessible).  You can execute the ct, which 
then calls either EXECUTE or COMPILE,, doing the compiler job of Mitch 
Bradley's text interpreter in two steps (first convert an nt to a ct, and 
then execute it).

Go from too many token to just one is the step to "monotoken" system.  The 
term came from Stephen Pelc on EuroForth 2011, he used it to describe VFX.  
VFX does still have a more traditional header, so you can't easily access 
the immediate flag from the xt, but otherwise, there is just one xt, and 
that one can be EXECUTEd or COMPILE,d.  If it wasn't immediate, COMPILE, 
would perform the compilation semantics (which means executing an xt in the 
header - or as in git Gforth, an xt in a table pointed to by the header).

The "dancing angels on a pin" question is whether COMPILE, should "append 
the execution semantics of the xt to the execution semantics of the current 
definition" as the standard says, or to "compile the word associated with 
the xt" as Gforth's documentation says.  Compile obviously means 
"compilation semantics", and the "word associated" suggests that there is a 
1:1 relation between word and xt, which actually wasn't there before the 
change towards monotoken.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-20 12:03 +0000
  Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-03-20 18:47 +0100
    Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-03-30 16:40 +0000
      Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-01 02:12 +0200
        Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-01 16:58 +0000
          Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-02 04:20 +0200
            Re: Difficulty with Brad Rodriguez' screenful "Elizabeth D. Rather" <erather@forth.com> - 2013-04-01 16:39 -1000
            Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-02 14:15 +0000
              Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-02 21:12 +0200
                Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-04 13:58 +0000
          Re: Difficulty with Brad Rodriguez' screenful Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-02 04:17 -0500
            Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-02 15:35 +0000
              Re: Difficulty with Brad Rodriguez' screenful Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-02 16:36 -0500
                Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-03 04:10 +0200
                Re: Difficulty with Brad Rodriguez' screenful Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-03 04:03 -0500
                Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-03 21:14 +0200
        Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-03 16:13 +0000
          Re: Difficulty with Brad Rodriguez' screenful Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-04-03 11:54 -0500
          Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-03 22:24 +0200
            Re: Difficulty with Brad Rodriguez' screenful stephenXXX@mpeforth.com (Stephen Pelc) - 2013-04-04 11:53 +0000
              Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-04 18:13 +0200
            Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-04 15:53 +0000
              Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-04 22:11 +0200
                Re: Difficulty with Brad Rodriguez' screenful Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2013-04-04 21:35 +0100
                Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-04 23:06 +0200
                Re: Difficulty with Brad Rodriguez' screenful stephenXXX@mpeforth.com (Stephen Pelc) - 2013-04-05 10:57 +0000
                Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-05 14:47 +0000
                Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-05 14:28 +0000
                Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-06 03:35 +0200
                Re: Difficulty with Brad Rodriguez' screenful "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-08 23:50 -0400
                Re: Difficulty with Brad Rodriguez' screenful "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-04-08 23:49 -0400
                Re: Difficulty with Brad Rodriguez' screenful m.a.m.hendrix@tue.nl - 2013-04-05 02:49 -0700
                Re: Difficulty with Brad Rodriguez' screenful anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-04-05 14:55 +0000
                Re: Difficulty with Brad Rodriguez' screenful Bernd Paysan <bernd.paysan@gmx.de> - 2013-04-05 22:05 +0200

csiph-web