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


Groups > comp.lang.forth > #33748

TclForth Notes: Always Compiling, Forth without STATE

From Wolf Wejgaard <wolf@holonforth.com>
Newsgroups comp.lang.forth
Subject TclForth Notes: Always Compiling, Forth without STATE
Date 2014-10-08 11:40 +0200
Organization Aioe.org NNTP Server
Message-ID <m130qf$lb2$1@speranza.aioe.org> (permalink)

Show all headers | View raw


Classic (standard) Forth systems are remarkably consistent in using 
techniques invented 40 years ago. For instance, the classic interpreter 
still executes command lines word by word. I wonder why. Of course, it 
works and everyone is used to it. But it does not have to be that way.

TclForth compiles the command line and then executes the compiled line. 
If the command line is compiled it can handle immediate words. You can 
enter lines like this

    1 begin dup 10 < if "*" else "&" then . 1+ dup 20 > until drop


TclForth always compiles. Interpret is Compile and Execute.

If you need to calculate a value while compiling a definition, enclose 
the calculation in square brackets as usual. The code inside the 
brackets is compiled, then executed by ']' .

There are just two moments in the interpreter when code is executed: 
end-of-command-line and ']'. Thus, STATE is obsolete, it is not tested.

And if there is no STATE to test, the immediate bit also makes little 
sense. TclForth replaces immediate by Compiler.

Immediate words are now Compiler words that execute native Tcl code. - 
Example:

    Compiler if
        appendcode "if \[pop\]  \{\n"

Code and Colon words compile a call to their execution semantics. 
Compiler words perform their compilation semantics.

--

I am still struggling with the text and welcome comments to clarify it.

Anyway: TclForth works and is available for inspection.

-- 
Wolf Wejgaard
http://holonforth.com

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


Thread

TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-10-08 11:40 +0200
  Re: TclForth Notes: Always Compiling, Forth without STATE albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-10-08 11:53 +0000
  Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-10-08 17:41 +0200
    Re: TclForth Notes: Always Compiling, Forth without STATE Joachim Merkel <jm@7fun.de> - 2014-11-30 22:20 +0100
      Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-12-04 16:54 +0100
        Re: TclForth Notes: Always Compiling, Forth without STATE m.a.m.hendrix@tue.nl - 2014-12-05 00:05 -0800
          Re: TclForth Notes: Always Compiling, Forth without STATE "Elizabeth D. Rather" <erather@forth.com> - 2014-12-04 22:47 -1000
            Re: TclForth Notes: Always Compiling, Forth without STATE Bernd Paysan <bernd.paysan@gmx.de> - 2014-12-05 19:04 +0100
              Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wejgaard@gmail.com> - 2015-01-21 02:23 -0800
          Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-12-06 08:53 +0100
            Re: TclForth Notes: Always Compiling, Forth without STATE mhx@iae.nl - 2014-12-06 00:21 -0800
        Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-05 03:16 -0600
          Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-12-06 09:31 +0100
            Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-06 04:16 -0600
            Re: TclForth Notes: Always Compiling, Forth without STATE albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-12-06 10:40 +0000
            Re: TclForth Notes: Always Compiling, Forth without STATE anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-12-06 12:42 +0000
              Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wejgaard@gmail.com> - 2015-01-21 02:26 -0800
            Re: TclForth Notes: Always Compiling, Forth without STATE Joachim Merkel <jm412@gmx.de> - 2014-12-06 18:11 +0100
              Re: TclForth Notes: Always Compiling, Forth without STATE Joachim Merkel <jm@g7up.de> - 2014-12-06 18:25 +0100
              Re: TclForth Notes: Always Compiling, Forth without STATE Joachim Merkel <jm@7up.de> - 2014-12-06 18:42 +0100
            Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-15 18:55 +0000
              Re: TclForth Notes: Always Compiling, Forth without STATE Coos Haak <chforth@hccnet.nl> - 2014-12-16 01:27 +0100
                Re: TclForth Notes: Always Compiling, Forth without STATE Coos Haak <chforth@hccnet.nl> - 2014-12-16 01:50 +0100
                Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-16 05:04 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-16 04:08 -0600
                Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-16 23:32 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE "Elizabeth D. Rather" <erather@forth.com> - 2014-12-16 14:45 -1000
                Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-17 06:01 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE "Elizabeth D. Rather" <erather@forth.com> - 2014-12-16 22:21 -1000
                Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-17 02:24 -0600
                Re: TclForth Notes: Always Compiling, Forth without STATE "Elizabeth D. Rather" <erather@forth.com> - 2014-12-16 23:07 -1000
                Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-17 08:21 -0600
                Re: TclForth Notes: Always Compiling, Forth without STATE "Elizabeth D. Rather" <erather@forth.com> - 2014-12-17 08:57 -1000
                Re: TclForth Notes: Always Compiling, Forth without STATE JennyB <jennybrien@googlemail.com> - 2014-12-17 04:52 -0800
                Re: TclForth Notes: Always Compiling, Forth without STATE anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-12-17 09:58 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-18 04:11 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE mix <mix@test.net> - 2014-12-18 04:16 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-17 02:11 -0600
                Re: TclForth Notes: Always Compiling, Forth without STATE stephen@mpeforth.com (Stephen Pelc) - 2014-12-17 13:17 +0000
                Re: TclForth Notes: Always Compiling, Forth without STATE Mark Wills <markwills1970@gmail.com> - 2014-12-17 06:24 -0800
        Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-05 03:19 -0600
          Re: TclForth Notes: Always Compiling, Forth without STATE Wolf Wejgaard <wolf@holonforth.com> - 2014-12-06 09:31 +0100
            Re: TclForth Notes: Always Compiling, Forth without STATE Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-12-06 04:19 -0600
            Re: TclForth Notes: Always Compiling, Forth without STATE rickman <gnuarm@gmail.com> - 2014-12-08 01:14 -0500
  Re: TclForth Notes: Always Compiling, Forth without STATE the_gavino_himself <visphatesjava@gmail.com> - 2014-12-17 05:42 -0800

csiph-web