[ColorForth] immediate
- Subject: [ColorForth] immediate
- From: "Sean Pringle" <sean_pringle@xxxxxxxxxxx>
- Date: Wed, 23 May 2001 14:00:35 +1000
- Bcc:
I think that using color to differentiate between 'immediate' words (macros)
and normal words or using two wordlists is partly a matter of personal
preference and partly a design decision. It is may not nessasarily be better
to do it either way.
Using explicit coloring (current 4word method) can result in a simpler
compiler in that the decision whether to execute a macro or compile a normal
word has already been made by the programmer at edit time. This may be 'good
forth' in that the decision has been pushed from compile time to edit time.
Using a MACRO wordlist (current Flux method) can result in a slightly more
complex compiler in that it has to make the execute/compile decision at
compile time.
The first benefit I see of the MACRO wordlist is that it means the
programmer doesn't have to remember which words are immediate (not that
there are many anyway I know :-) This is my own personal preference
reflected in my own system. I also find that while writing color code I'm
switching to and from compile and execute mode more often than I did in
traditional forth. I need to know that I'm executing certain bits of code at
compile time so they are the 'immediate/execute' color. I generally don't
need to know that I'm executing IF THEN and : and the optimized versions of
various words etc at compile time so they are the same color as the compiled
words. They are simply part of the underlying system.
The second benefit is that the MACRO wordlist makes for easy optimization.
For example DROP could exist in both wordlists. The MACRO version would
compile drop inline while the normal version is a normal executeable
threaded word.
You mentioned that explicit coloring should not be a problem for people
writing in Forth. Perhaps it wouldn't be for seasoned Forth programmers but
there are others (less fortunate perhaps :-) out there who are not
interested in understanding or being required to understand the internals of
different Forths, or Color Forths.
Of course we have no standard for Color Forth. Everyone should do what they
like best and tell the rest of us how good it is! We shall all listen
appreciatively and then continue with our own experimenting. Let us know
what you discover.
Simply my perspective.
Sean Pringle
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
------------------------
To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems - List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site - http://www.ultratechnology.com