home .. forth .. colorforth mail list archive ..

RE: [colorforth] New Standard Keyboard


>> Finally, I'd like to ask another question. For a metacompiling native
>> Forth (any Forth, not just colorforth), how would you create a new
>> image from the metacompiled source? Theres 3 ways I could think of,
>> 
>> (1) Have it write to disk after it compiled (or just memory, whatever)
>> (2) Compile it, then jump to a routine that overwrites the old kernel
>> and replaces it with the new one
>> (3) Choose which one from above with a word

>In 4IM, I (meta)-compile the new kernel in a buffer, then write it back
>either on the sectors of the disk ( standalone ) or in a a .COM file ( DOS
>version ).
>Your second idea is a bit more sophisticated, and lets survive bugs across
>regenerations of your kernel that the reset required by (1) kill ( suppose
>you've trashed the Bios vector table, for instance ).

That is something I've wondered about, a kind of "silent corruption" that could be
hard to track down and propogated to new versions.
I haven't attempted metacompilation yet, but I was thinking I could basically 
start compling the new system at the end of the current dictionary. Then (assuming
the code is relocatable) you can just CMOVE the new version  it to the original location.
Of course you would need a "standalone" CMOVE that would not get overwritten durning the
process. I had thought if I recompile all my primitives then I would not need a separate
dictionary pointer, since it would grow on top of it's new words, and not reference the old
system. (Not sure about this) There might be limitations, like not being able to change the
data structure of the dictionary, but maybe not if you redefine ':' ...
I'm open to suggestions on any glaring gotchas that I am overlooking.

On the topic of keyboards, I was toying with the idea of either:
a.) redefining some keys dedicated to be basic operators like DUP, SWAP,  etc. possibly even
     executing when you press them in a "calculator" mode.
b.) same idea but more "overloading" the existing  keys so that "D" could either be DROP, say,
    or the letter itself depending on what mode the editor was in (something along the lines
    of the BASIC on the ZX81/TS1000 -- which saved a lot of typing). This may or may not work
    well with a colorforth style editor (haven't had a chance to try it yet)

I'm not sure if any (meager) gains would be worth the effort. If I get a chance to experiment and it seems
useful, I let you know what I find out.

-Lonnie









---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com