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

Re: [colorforth] Unused character encodings available in Colorforth


--- Chuck Moore <chipchuck@xxxxxxxxxxxxxx> wrote:
> The 0 0000 character code indicates end-of-word.
> With characters packed into 32-bit words, zeros are
> also used as fill if 28 bits aren't used.
> 
> But I had in mind to parse/unparse words as they
> move from/to disk or Internet. That is, the parsed
> 32-bit words are converted to a bit stream.
> Then the only zeros would be the end-of-word code.
> It is then the most frequently used code and
> deserves a 5-bit length.

I hadn't considered compression and agree there are
good reasons for including provisions for it.

I'm still not convinced of the need to sacrifice the 0
000 character code, however.  Given the preponderence
of shorter words, I would see a lot of value in simply
adding a single bit after each character to indicate
which character is last as opposed to appending a
block of four zeroes at the end of the word.

One to three character words compress smaller, four
character words are a wash and you begin losing ground
from there on up.

As an example, using the four blocks (2 code, 2
comments) that Mark provided to perform the
compression, appending a continuation bit after each
character would save a total of 225 bits in the
compressed output for those four screens.

Note: I did that computation by hand rather than
coding up anything so your results may vary (i.e. you
may actually get the right number).  Also I skipped
over all numbers.  If any of the more common ones are
in the dictionary (0, 1) then a few more bits would be
saved for those.

I'm not convinced that colorForth really needs the
extra seven encodings in it's character set though I
do particular miss '>' and '&' from time to time.  And
I do understand that 55 characters would not map
nearly as nicely to 24 keys as the current 48 do. 
Mostly I guess the unused premium slot bothers me more
from an aesthetic point of view than anything else.

__________________________________
Do you Yahoo!?
Yahoo! Search - Find what you?re looking for faster
http://search.yahoo.com

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