On Saturday, December 23, 2017 at 8:54:25 PM UTC-7, Cecil - k5nwa wrote:
> I am interested in Pygmy for Windows for one purpose to write Forth
> cross-compilers for embedded CPUs.
Primarily, ANS-Forth fails to support cross-compilers because LITERAL is not vectored --- this is necessary so TARG words can have literal numbers.
You need DLITERAL and FLITERAL to be vectored too, if doubles and floats are going to be supported in TARG code.
A work-around is to write your own outer-interpreter rather than use the built-in outer-interpreter (that uses the built-in LITERAL).
This is problematic in ANS-Forth because FIND is ambiguous. For a long time I thought this prevented ANS-Forth from supporting a custom outer-interpreter.
The disambiguifiers fix this problem though.
If Frank Sargent makes LITERAL vectored, he will support cross-compilers in an easy and obvious way. Writing a custom outer-interpreter is over-complicated.
Also, the following words are very useful:
LATEST ( -- xt ) \ the xt of the latest definition
VOCNO@ ( xt -- vocno )
VOCNO! ( vocno xt -- )
IMMEDIATE@ ( xt -- flag )
IMMEDIATE! ( flag xt -- )
SMUDGE@ ( xt -- flag ) \ the level-0 smudge flag (set if word is smudged)
SMUDGE! ( flag xt -- ) \ the level-0 smudge flag
PRIVATE ( -- ) \ set the level-1 smudge flag
PRIVATIZE ( -- ) \traverse the dictionary and find words with level-1 smudge flag set; clear it and set the level-0 smudge flag
LOCAL ( -- ) \ set the level-2 smudge flag
END-MODULE ( -- ) \ traverse the dictionary and find words with level-2 smudge flag set; clear it and set the level-0 smudge flag
All of these words should be trivial to implement, but they do require carnal knowledge.
Also it is useful to support rquotations. This should be trivial to implement, but it does require carnal knowledge.
I have rquotations working in VFX and SwiftForth. VFX was trivial --- SwiftForth was more complicated due to SwiftForth's bizarre internal workings.
In general though, this should be trivial to implement.
I'm not enthusiastic about a Forth written in Python because it is going to be slow.
A cross-compiler doesn't need to be fast though, so if cross-compilation is the "killer application" then Frank's Forth should be okay.
The advantage of using Python is that there are a lot of code-libraries available ---
it should be possible to make a GUI IDE fairly easily --- I can't think of any other code-library that would be useful for a cross-compiler.
ANS-Forth was a failure because it didn't support cross-compilation. This was most likely done on purpose.
Forth Inc. and MPE wanted to prevent cross-compilers from being written in ANS-Forth so only they would be able to write them using carnal knowledge.
Now Emperor Pelc is the chair-person of Forth-200x and he continues to strive to prevent cross-compilers from being written in Forth-200x.
Micro-controllers are where the money is --- this is why the Forth-200x committee wants to prevent micro-controller code development using Forth-200x.
I think it would be great if Frank provided support for cross-compilation in his Forth system. I would use it. :-)