Quantcast
Viewing all articles
Browse latest Browse all 22482

Some BASIC/Compiler Comparisons

I recently completed a significant revision to a series of BASIC programs that I have used to parse a time/date-ordered (very long) text file each month to produce an alphabetical list of movie titles.  I end up with a lot less information, but it is in a format that I can quickly use to see if there are some movies I'm interested in watching that month.

With my revision, I ended up with just one BASIC program for several different interpreters and compilers.  So comparisons are inevitable. Running this program, I ended up with the following times and program sizes -- and also a major question about the Turbo Basic Compiler.  First, the times:

Atari BASIC...24:35 execution  (13 DD sectors)
Basic XE...12:14 (no string arrays used)
TBXL....9:27
ABC Compiler...6:xx (Integer -- no seconds available)...27 DD sectors
TBXL Compiler...4:42...12 DD Sectors + 43 for THE runtime
MMG Basic Compiler... 3:xx (Integer -- no seconds available...27 DD sectors (runtime library appended)

Most of these times and program sizes (compiler versions) seem pretty logical.  I was initially a bit surprised that the MMG compiler version was a bit quicker than the TBXL compiled version, but since TBXL provides floating point, that is likely a big part of the difference.

But that leads to a question.  I have always heard that the TBXL compiler produces "machine code."  Is that really true?  Watching the compilers work, it leads me to question it.  First, the TBXL compiler is incredibly fast, and *makes only one pass.*  Second, the size of the runtime seems very large for a machine code compiler.  Compare it to the MMG which does a 3-pass assembly of the source program, and has a very small runtime of (IIRC) typically about a thousand bytes -- similar to the ACTION! runtime.  Maybe it's a hybrid of some type?

Anyone have some input?  Maybe read the original German article or has some other insight?

-LARRY

Viewing all articles
Browse latest Browse all 22482

Trending Articles