Chuck's Fireside Chat at Forth Day
- To: MISC
- Subject: Chuck's Fireside Chat at Forth Day
- From: jfox@xxxxxxxx (Jeff Fox)
- Date: Sun, 15 Nov 1998 22:57:29 -0400
Dear MISC readers:
The Annual Forth Day meeting was held at the
Silicon Valley Chapter of the Forth Interest Group
was held on Saturday 11/14/98 and included representatives
from the Sacramento and North Bay Chapters.
I was not able to attend in the morning so I was unable to see
the presentation that Michael had prepared about the profile
of the hardware and software resources in the iTV embedded
products and the contrasts between the implementations
of web browsers and email programs on PCs and at iTV. Of
course I knew what he was going to say. I arrived for the bbq
which had been provided by Dr. Ting.
Michael had set up the 5 inch B/W TV/FM w/ built in
iTV internet appliance and was giving demos
of the features implemented in the OS and email and browser
programs including an interactive Forth interpreter task and
letting other people try the product.
I volunteered to give a quick presentation after lunch and
informed people that we expect F21d prototypes back this
week and that I had released the latest F21 emulator and
demo programs for free at the web site. www.UltraTechnology.com
I explained that emulator was now getting up to 10 F21 mips
which was about 1/20th the speed of F21 in the best case for F21
and 1/2 or 1/3 of the speed that F21 will get in programs
that access DRAM and encounter offpage memory timings. I said
that even on my fairly slow laptop the F21 video demo in the
emulator was now almost too fast to see now.
The last presentation was Chuck Moore and his Fireside Chat.
I made a video of the presentation although Chuck used an overhead
projector most of the time so neither the lighting nor sound
are ideal. I have working on a transcript and when done I will
convert it into an html document and post it at my site.
Here is the first 1/4.
(Chuck)
The first thing that I want to talk about is this slide.
It's kind of neat. It was constructed with my editor.
That's how I work all day making things that look like that.
So it's very easy to construct a special purpose list of
comments that I can show off. So Color Forth comes with a
built in slide maker. (laughter)
FORTH DAY
CHUCK MOORE
COLOR FORTH
COMMAND LINE
HIDE/REVEAL
SPREADSHEET
I21SL
TEMPERATURE
IV CURVES
INTERNET
PRINT
(Dwight-) They all say PRINT at the bottom.) (laughter)
(Chuck) I was going to mention that. There is a little problem
or feature. You can't really see the difference between the
black on Forth Day and the blue on Chuck Moore. This is
literally a screen dump onto an HP printer. I could work on
the colors and make things legible and I really need to.
Everything that I am doing and everything that I will show you
today is a work in progress. The priorities are such that none
of this is mainstream. But I am working more than even in Color
Forth, and I really like it.
The i21sl is the latest version of the chip and it's been back
for three weeks. (someone-) How do you tell the difference between
a one and an I? (refering to Chuck's CAD font in OKAD on the screen
dump) (Chuck) I can't. But it really doesn't matter anyway, but I
will be designing a new character set that will make that evident
and a utility program to do it. (someone-) What kind of keyboard
do you use? (Chuck) A normal PC keyboard. (laughter) (and people
say that I just make this stuff up. This time I have a video ;-)
Here's a screen full of Color Forth. (colors change tokens are
represented within the text here this way)
(blue) T3/2 TABLE REMEMBER (red)
IT : (green) 65 LOAD (red) TA (green) 294
: (red) FILL (green) -1 + TA OVER
TA + /. 3/2 OVER T3
/2 ! IF FILL ; THEN
DROP ; (black) 100 FILL IT E
ND
INT P 64 p 63 .obscured by projector.
The First thing I want to talk about is the bottom line.
The paper that I will give at FORML is the new command line.
I have not heard anyone else mention it to you so I will, but
it scrolls from the right. Normally you type characters starting from
the left and move across the screen with a cursor. This
doesn't. The characters appear on the right and scroll to the
left. There is no cursor. I don't need one. The advantage is
that I get a whole line of history with no need for vertical scrolling.
The beauty of that is that is that it doesn't interfer with whatever
is on the screen. Whatever is up here stays there. It's just the
bottom that's used for command line scrolling. Before I had two
lines for history and it scrolled up one line and I had a little
window with one line of history. But this is even better because
it turns out that I get even more history this way than I did that
way and it takes less space.
I think this is a great example of conserving the valuable resource
of the pixels on the screen. (laughter) It's a resource that nobody
cares about. I saw an ad in one of the internet magazines. I don't
remember what browser it was but it was a browser framed that you
had put up on your screen and customized all these buttons and dials
and that seems to be the pace at which this world is going. They're
willing to give away the edges of their screen (motioning to show that
the useful browsing area was surrounded by all these
custom buttons and gauges in this ad)
I saw another example. It was some application I was working on.
It had something to do with word processing that had three layers
of frames and in the middle in about 1/8th of the area on the
screen available for text was part of the text that I wanted to see.
It's ludicrous that their willing to give away most of their 1024x768
pixels and I'm not.
Now this (the Color Forth Screen), I saw a word earlier, MARKER ?
Is that ANS or something? REMEMBER has gone away? Alright, I'll
use MARKER. It's shorter anyway. I'm trying to shorten words.
Here's an application that builds a table. It's a table of
temperature to the three halves power. This is the code to
build it. And the thing to notice is that the word FILL is
referenced inside of itself as a jump back to the beginning
of the definition. This is relavent to the zeleous
debate that's been raging on the standards committee. It
used to be called SMUDGE and I guess the debate is about
what to call it. But anyway I've given up on that. It's
just too complicated. Color Forth is brutally simple and
it will become even more brutally simple. This construction
of a jump back to the beginning is very convienient and
it saves a lot of BEGINs and SWAPs and confusion. I think
the control flow is clearer here.
Every word here has a space preceeding it that describes exactly
what it is suppose to do. This little character here that turned
this word blue means that is is a comment and the next word is also blue.
This word is black on this page and white on the screen and it is
executed. This word (IT) is being defined. Now remember that the
word REMEMBER says that the next word you define will have the DOES>
behavior. And a word being defined is red so I am defining IT at
this point. Having done that I use a colon to switch the behavior
back to that of normal colon definitions in future definitions. Of
which there are a bunch on block 65 and then this word TA.
Now the body of the definition of TA is in green. And this 294 and
the semicolon makes this a constant. That is how I define constants
in Color Forth. It's the most efficient defintion. It avoids this
long word CONSTANT that doesn't convey a whole lot of information.
(George- asks about the colon in the defintion.) (Chuck)
The colon is the specification that future red words are colon
defintions. At define time the address is that of colon rather
than that of remember. I'm using the function keys. I've given a color
to each function. So this acts like a constant.
(John-) A DECIMAL constant too. (Chuck) Yes, and the word IF here should
be black and THEN too because those words are executed. And
likewise outside of this defintion I switch back to black and
execute these words. 100 FILL executes the word. IT forgets
everything from here (REMEMBER) and END marks the end of the
block. Other than that this code is probably very self expanatory.
Here is a -1 +. Which is the way I do things. I do not have a subtract.
This is partly experimental. I want to decide if subtract is an
essential operation to have. The answer is no. If you are doing
comparisons you use exclusive or if you are doing arithmetic you
use minus numbers and very occasionaly you need to do an actual
subtract.
This code is actually used by that word.
(blue) SQRT (red) 1. (green) 1FF. ; (red) *. (green) 1.
*/ ; (red) /. (green) 1. SWAP */
; (red) 3/2 (green) DUP DUP *. *. *. (red)
SQRT (green) DUP 1. - 1 + +
2/ 1. + SWAP OVER /.
+ 2/ ; (black) END
This is a square root which I would like to talk about as a
square root apart as an example of Color Forth. Here is a
cyan constant 1FF. One of the things that pleases me most is
the colorfulness of the screen. It is reall dull to look at a
black and white screen. That's why I willing to add more colors.
Here's an example of where I want to put in more colors. I'm
not there yet. The first couple of words here are fixed
point arithmetic. (1. *.) I am defining this (1.) as the
number 1 dot and it's got 511. And to multiply two fractions
you do a 1 star slash. To do a divide you do a 1 swap star
slash. It's not the most efficient way of doing it, you should
do a multiply and a shift but this is the easiest way of
doing it as a fractional multiply. I use that in a square root.
I am taking the square root of a number near 1 scaled by 512
and getting a number scaled the same way. You do that by
basically taking one minus one half x to get the square root
of one plus x. And then I do a newrafson (sp?) iteration to
get four signifigant digits. Now I've got a square root good
to nine bits, a very cheap quick and dirty way of getting some square
roots. The reason I wanted a square root is that I am
taking T (temperature) to the 3/2 power. I do that by
T cubing and taking the square root. The cubing part is just DUP DUP
*. *. *. and that falls into square root because the headers
are elsewhere. I'm very fond of this style of having a couple of
words cascaded and falling into another word. It is in effect
multiple entry points into a word. (Dwight) Shame on you.
(laughter) (Chuck) I get multiple exit points as I had in the
previous word where I had IF FILL semicolon. Semicolon does
not mark the end of a definition. The end of a defintion is
marked by the abscence of any more green words.
Here this one dot minus one plus is an awkward way of computing
a number. I get this number 511 and this is not the binary
subtract operator it is the one's complement operator. (like
in the MISC instruction set) This almost makes this into minus
511 but not quite you have to add one to it first. Now my current
thinking is that if I made this yellow it would be executed at
compile time and the result would be put on the stack and would
have to be compiled as a literal. I've been worrying for
a year or so about how to do that because I don't want to have to say
LIT. It is an ugly word with no meaning to say put the literal on the
stack into the definition. If I make this yellow the stop of yellow
or the switch from yellow to green will make that function.
(Jim) Now I have a question. All this stuff here is constants or stuff
that can easily be determined as only affecting stuff that is only on the stack
durring the defintion. Why don't you have the
compiler figure out when it would be a good time to inline stuff?
(Chuck) That's what I'm trying to avoid. Because the compiler has to
figure it out every time it does it and I can figure it out once and
for all and be done with it. I'm planning on compiling these
applications every time I am going to use them so my dictionary will
always be very small. I won't have any need for vocabularies for
instance. And I want the compiler to be very fast. And decisions
that I can make at, we don't have a name for it, programming time
are cheaper than decisions that are made at compile time which are
cheaper than decisions made at runtime. And besides it adds
another layer of color.
(first 17 minutes)