[Coco] Cocopedia update

Wayne Campbell asa.rand at gmail.com
Wed Aug 14 10:47:12 EDT 2013


On Aug 14, 2013 3:35 AM, "Kip Koon" <computerdoc at sc.rr.com> wrote:
>
> Wayne,
> I am very impressed with your knowledge of Basic09!  I have wondered many
> times both way back when before I got into IBM PCs when I was heavily into
> Cocos and recently after I got back into Cocos just what Basic09's I-code
> really was.  I know Basic09 uses it as well as Pascal Interpreters though
I
> would not expect the two I-code formats and definitions to be the same.

Thank you. I have been learning Basic09 I-Code since 1988 when I got my
CoCo2 and started using OS-9 Level 1. DCom began in 1989 when I got my
CoCo3 and upgraded to OS-9 Level 2. 64K was not enough memory for me. I did
everything the hard way.

I lost alot of source code back then because I kept putting off making
copies. I kept thinking, if I could just understand the I-Code I would have
my source back. The CoCo3 made me feel I could do it, so I started
unravelling it.

Pascal09 refers to its intermediate code as P-Code, to differentiate
between it and Basic09 I-Code.

> People call Basic09 a compiler, it sounds more like an interpreted
language
> to me.  To me a compiler would be a program that takes source code and
> transforms it eventually into executable machine language like C and C++
for
> instance.  Since you know Basic09 intimately, how do you view the language
> in terms of being an interpreted or compiled language.  Calling Basic09 a
> compiler does not seem quite accurate.  It just separates the tokenizing
and
> executing stages of a Basic09 program into two separate parts.  Basic09
for
> entering  the program and runb for interpreting the tokenized program if
I'm
> not mistaken.  DECB changes the key words into tokens as they are keyed in
> or as the ASCII version of the program is loaded into memory it seems me
in
> a similar way to Basic09, though the structure of the tokenized program is
> very different.  Though they are executed differently, I do see some
> similarities in the internals of the two languages.  I'd like to hear your
> thoughts extensively on this subject.  Don't get me wrong, I consider
> Basic09 at least an order of magnitude better than DECB.  Though I have
> never gotten around to using Basic09 myself, I imagine it is a much better
> implementation of the Basic language than DECB.

Strictly speaking, Basic09 is an interpreter, using tokens to represent
keywords, operators, functions, etc.

Most interpreter basics store all the tokens and other related data in the
source file. Basic09 differs here, and this is where the compiler comes in.
As the source code is read into the workspace, it is chewed up and spit
out, replacing it with the tokenized I-Code and 3 tables. The authors chose
to use the term pack to represent the further compilation to a stand-alone
memory module that only required an external runtime interpreter to execute.

Because the I-Code is organized in stack-oriented form, execution speeds
can come close to object-code speed.

>Take care and have a good
> night sleep.
> Kip

Actually, I got this this morning. I hope you slept well, as I did. :)



More information about the Coco mailing list