In article ,   
   Hans Bezemer wrote:   
   >On 18-09-2024 12:34, Ruvim wrote:   
   >> Actually, most Forth systems are classic single-xt systems. And most   
   >> educational materials on how to implement Forth explain the classic   
   >> single-xt approach.   
   >   
   >Interesting enough - considering this "dual xt" idea, 4tH has *ALWAYS*   
   >been "dual xt". All compilation behavior is in the compiler and all   
   >execution behavior is in the interpreter. Note 4tH *only* contains   
   >primitives. The Forth layer is what you build with these primitives,   
   >since both the compilation behavior and execution behavior is coded in C.   
      
   And the opposite approach. Always have default compilation semantics,   
   i.e. add the behaviour of an interpreted word to a compiled word.   
   Do not allow STATE dependant behaviour except for denotations:   
   single words that leave a constant or several constant(s) on   
   the stack, but this must be the same value for interpretation and   
   interpretation. 1)   
   They are compiled as literals in compilation mode.   
   Do not allow to postpone denotations (use literal for that),   
   do not allow any other state smart words.   
      
   Forth doesn't become less powerful, only less interesting for   
   language lawyers.   
   If the compilation stack is separate, inspection of STATE   
   can be restricted to INTERPRET , without even a need to   
   be inspected by number, aka denotations.   
   INTERPRET could simply inspect if the stack has changed.   
   In compile mode, it compiles literals, instead of leaving   
   them on the stack.   
      
   (Chuck Moore would/should like this.)   
      
   The only reason to have dual xt if you want to do   
   optimisation in the compilation xt.   
      
      
   1) Note that a :NONAME construction is an denotation, leaving a   
   constant xt.   
      
   >   
   >Hans Bezemer   
   >   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|