[<<][staapl][>>][..]
Fri Mar 27 20:22:33 CET 2009

eForth primitives

I'm implementing a machine to run eForth.  Almost done with the
primitives, except execution model and dictionary format.

I had a very nice introduction to eForth as a pdf somewhere..

This looks OK: http://www.offete.com/files/zeneForth.htm

First: what is the point?

I'd like to find a way to implement a stand-alone ANS Forth on top of
Staapl primitives.  But what I really need is a Forth that will run
partly on the host and partly on the target.

I'm trying to first implement it as is, and solve the bootstrapping
problem.  Probably translation to a standard binary image that can by
itself be translated to a binary image of a real machine.


OK.  Got primtive execution working..

The thing which always confused me is that on an emulated machine, I
have this tendency to use 3 levels: threaded code, primitives
represented as numeric opcodes, and real primitives (here Scheme
thunks).

But this isn't necessary.  Forth primitives that end in a jump to NEXT
can be represented by sequential scheme code ending in a NEXT
tailcall.

Next: bootstrap threaded code.  With a threaded interpreter,
primitives can't be executed directly but need to be wrapped in
highlevel words that contain the primitive instructions.



[Reply][About]
[<<][staapl][>>][..]