Re: tiny embedded C-based forth



Rod Price wrote:
..
..
..
> What happens when the user types a word like ":" (colon) or ";"
> (semicolon)? Things
> aren't stateless any more. It would seem that both target and host
> would have to
> keep track of a little more state than just the stacks. Call it a
> "mode bit." True?
> Perhaps this could be thought of as two state machines, one on the host
> and one on
> the target, talking to one another.

This is one reason I was working on simpler compilers (not the main one). It
is possible, I have discovered, to have a Forth virtual machine architecture
that gets coded with a simple compile and go compiler, with no states and no
immediate words unless you decide to provide them for syntactic sugar - and
even then, you can put equivalent functionality into a preprocessor which can
be on a host machine.

But I do NOT recommend you to try this for your project unless you are very,
very, short of space on the target machine. The source language isn't Forth
any more, and even though the compiler is simpler the language isn't. I doubt
if you want your students to have to explore lots of new things at once.

But if you are interested, email me and I'll give you some details. PML.

--
GST+NPT=JOBS

I.e., a Goods and Services Tax (or almost any other broad based production
tax), with a Negative Payroll Tax, promotes employment.

See http://member.netlink.com.au/~peterl/publicns.html#AFRLET2 and the other
items on that page for some reasons why.
.



Relevant Pages

  • Re: Build your own Forth for Microchip PIC (Episode 837)
    ... put those tokens in RAM. ... This is the reason I'm wanting to use the host as a remote execution ... Test/Debug code on target recompiling and reloading as necessary. ... of implementing anything other than a batch forth compiler for it. ...
    (comp.lang.forth)
  • Re: Build your own Forth for Microchip PIC: Design thoughts
    ... compiler is the only task that's burning in my brain right. ... that puts PIC code on the host for the simulator to execute. ... I'm not so sure about the simulator. ... That target will execute compiled forth words. ...
    (comp.lang.forth)
  • Re: Build your own Forth for Microchip PIC: Design thoughts
    ... testing words on the host, then transferring words to the target. ... where the students would be ultimately working with a cross-compiler, ... to a different compiler that will generate PIC code and download it. ...
    (comp.lang.forth)
  • Re: Build your own Forth for Microchip PIC (Episode 837)
    ... a powerful desktop, you can do things that are both difficult and inappropriate on a limited target, such as compiling optimized target machine code. ... The actual compilation is on the host, but the download of the result is immediate. ... because once you do away with the inner interpreter, ... through an optimizing compiler removing the inner interpreter altogether ...
    (comp.lang.forth)
  • Re: Build your own Forth for Microchip PIC (Episode 837)
    ... the unreasonablly small hardware stack size for my particular target. ... You are handcuffed in the sense that you would like to be able to download small amounts of code into ram and execute it. ... because once you do away with the inner interpreter, ... An optimizing compiler isn't a post-processor, it's an *alternative* to another kind of compiler. ...
    (comp.lang.forth)