Sun Aug 17 08:32:07 CEST 2008
Forth is very elegant minimalism, and hard to improve if you want a minimally complex self-hosted system.
But when you switch to a cross-compiled Forth system, the target side can be simplified a lot by taking out reflection. For interactive applications, Staapl uses Frank Sergeant's <a href="http://pygmy.utoh.org/3ins4th.html">3 instruction Forth</a>.
On the host side however, minimalism isn't really necessary. Having "just Forth" on the host side really seems like a limitation. I see no reason why a cross compiler written in Forth can't be replaced by one written in Scheme. To make this easier, Staapl uses an impedance matching language Scat, which is a concatenative language based on <a href="http://www.latrobe.edu.au/philosophy/phimvt/joy.html">Joy</a>. Staapl's code transformers are modeled after Forth's immediate words, but are represented as pure Scat functions. All reflection is unrolled as acyclic PLT Scheme modules, making metaprogramming more straightforward.
When you skew ordinary Forth from words towards macros an approach like this where macros are as clean as possible seems to make sense. Staapl's PIC18 Forth starts out as all macros. There are no kernel words.
I've just updated the scribble docs in the <a href="http://planet.plt-scheme.org/display.ss?package=staapl.plt&owner=zwizwa"> PLaneT</a> package. The main project site is at <a href="http://zwizwa.be/staapl">http://zwizwa.be/staapl</a>.