[Coco] C VS Basic Coco

Wayne Campbell asa.rand at gmail.com
Sat Feb 17 15:10:28 EST 2018


Basic09 is a mix between interpreted and compiled. Literally interpreted,
as each instruction is handled by the runtime module, RunB. Compiled
because the instructions are "packed" into an intermediate code that uses
tokens to represent keywords, functions, etc. Line numbers are only
required for branch instructions like GOTO and GOSUB. In the I-Code, line
numbers are converted to integer offset addresses, relative to the
beginning of the instruction area of the module. It is for this reason line
numbers are not required on every line. Also, I-Code is packed in post-fix
notation (also known as reverse-polish notation) which speeds up execution
dramatically.

Wayne


On Feb 17, 2018 7:14 AM, "Francis Swygert" <farna at att.net> wrote:

Okay, I understand the difference between an interpreted and compiled
language... mainly execution speed as far as the user is concerned. So an
interpreted language goes through all the lines on a GOTO/GOSUB until it
finds the line number. Am I correct in assuming that a compiled language
like C and BASICC-09 has a quicker link to the reference point and doesn't
have to go through all the code from call until found?

Someone (can't remember who I gave permission!) converted my "CoCo Family
Recorder" genealogy database from DECB to BASIC-09. It was purely text
based, so probably didn't take too much trouble. The only thing that had a
lot of GOTO or GOSUB statements was the menu program that launched it. The
database was really a collection of programs that did specific things
rather than subroutines in one program -- to large for one program, at
least in DECB. The end of each subprogram would load and run the menu.
Don't remember how I did anything back then!  Frank Swygert
 Fix-It-Frank Handyman Service
 803-604-6548

--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list