[comp.sys.amiga] How fast is AmigaBasic?

pes@ux63.bath.ac.uk (Paul Smee) (06/25/87)

I'm going to say some nasty words in here, like 'Atari'.  PLEASE DON'T START
another 'my machine is better than yours' chain.  All I really want is a
response of some sort telling me how fast AmigaBasic (standard version,
whatever that means) is as compared to any other commercially available
BASICs for the Amiga, and as compared with good compiled code in any
language.  I don't use BASIC myself, so don't need to know how good / bad /
powerful / weak / etc AmigaBasic is.  I just want a comment on the speed.

The reason I ask is that I've seen adverts for a 3rd machine which include
comparative timings of their own BASIC on their hardware (the machine is
BASIC-oriented, that is it's intended as the main language) against standard
Atari ST-Basic and standard Amiga AmigaBasic.  Their comparative timings
make their machine look like a bat-out-of-hell (well, they would, wouldn't
they?) and the ST and Amiga look like dead snails.

However, I know that in the case of the Atari ST, the standard ST-Basic is
one of the slowest things going.  (In addition, it's so bug-ridden that I'm
amazed they actually got anything to run so that they could do comparative
timings, but that's another story.)  However the 2 best 3rd-party Basics
for the Atari ST are incredibly faster than ST-Basic, and I suspect if
they'd tried them the table would have looked rather different.  (They
rationalize their choice by saying they're using the 'standard maker's
Basic as comes with the machine' -- on the other hand, could buy 2 Amigas or
STs with 3rd-party basic for what they're charging, so I'm dubious.)

Their figures make ST-Basic and AmigaBasic look roughly comparable in
speed.  So, I suppose what I want to know is 'are there 3rd-party Basics
available for the Amiga, and how much faster are they than AmigaBasic?'
(I'm trying to work out a rough guess for what a 'fair' comparison would
have been.)

Cheers, Paul

hadeishi@husc4.HARVARD.EDU (mitsuharu hadeishi) (07/04/87)

In article <1348@bath63.ux63.bath.ac.uk> pes@ux63.bath.ac.uk (Paul Smee) writes:
. . .
>The reason I ask is that I've seen adverts for a 3rd machine which include
>comparative timings of their own BASIC on their hardware (the machine is
>BASIC-oriented, that is it's intended as the main language) against standard
>Atari ST-Basic and standard Amiga AmigaBasic.  Their comparative timings
>make their machine look like a bat-out-of-hell (well, they would, wouldn't
>they?) and the ST and Amiga look like dead snails.
. . .

	As a weekend programming project about a year ago I decided to
implement a full-blown better-than-Infocom style text adventure parser.
I did this is AmigaBasic because it wasn't really a serious project
and I also wanted to develop in an interactive language (so I could
do major modifications without having to wait for compilations.)  The
program with extensive comments was eventually about 120K long, and
was a very very capable parser (by Zork standards.)  Something you
should know is that the AmigaBasic interpreter does some optimization
AS IT RUNS.  That is, the FIRST time you use some code, it takes some
three to four times longer than it does the NEXT time.  So my parser
would have an initial response time of some twelve seconds or so (clearly
unacceptably slow).  However, after parsing the first sentence response
time would steadily decrease as the parser used more and more of it's
internal routines, and AmigaBasic optimized them.  (The optimization
consists of optimizing GOTO <label> and GOSUB <label> statements.)
After two inputs or so response time would be down to a comfortable
1/2 to three seconds or so.  (Finally what I did was have the parser "go through
the motions" by parsing a dummy sentence so it would optimize before the
program became interactive, so the slow response time did not affect
the user once the interactive session began.)  Now I must emphasize that
this was a pretty complicated parser which would have had an average
of ten to fifteen second response time on one of the old 8-bit machines
(I know because I wrote a simplified parser version of Zork for my old
PET 2001 with 16K when I was a youngster.  It had a response time of
five to six seconds with a much less sophisticated grammar.  Oh, give me
a LISP machine anyday :-)  I considered the final performance of the
machine after optimization to be FAST, based on my experience with
8-bit BASICs.

	It would help if you provided some information as to what
kind of benchmarks were performed.  If they did something sneaky
like run the program once and multiply the results by 100 or something,
then AmigaBasic would perform terribly.  Note that since AmigaBasic
does NOT use line numbers (it treats line numbers as alphanumeric
labels) any program which was directly entered with just a bunch of
line numbers for labels would run very slowly the first time in AmigaBasic.

	So AmigaBasic is fast enough at certain things.  Floating point
is slow, but who would want to do extensive FP in Basic, anyway?
There are no competitors, anyway (except perhaps TrueBASIC, but that's
a compiler if I'm not mistaken.)  But, few really use AmigaBasic,
so there hasn't been much pressure to optimize it further.  It is a
very handy tool for certain limited applications where speed is
not important and interactive development is, and it is essentially
a superset of Microsoft Extended Basic it is quite a large program,
which might also slow it down relative to more simple-minded BASICs.

	Off the cuff, I'd say AmigaBasic is around ten times slower than
the output of a C compiler, plus or minus half an order of magnitude or
so.

				-Mitsu

cmcmanis%pepper@Sun.COM (Chuck McManis) (07/06/87)

In article <1348@bath63.ux63.bath.ac.uk> pes@ux63.bath.ac.uk (Paul Smee) writes:
>    ... So, I suppose what I want to know is 'are there 3rd-party Basics
>available for the Amiga, and how much faster are they than AmigaBasic?'
>(I'm trying to work out a rough guess for what a 'fair' comparison would
>have been.)
>Cheers, Paul

That I know of there are four 'BASICs' available for the Amiga. Of these
three are commercial products and consist of AmigaBASIC (that which comes
on the extras disk) the AmigaBASIC compiler that comes from AbSoft and 
True BASIC which is available in stores. The fourth was a port of a 
P.D. BASIC that came over the net some time ago. Obviously the compiled
AmigaBASIC is the fastest, although True BASIC probably edges out AmigaBASIC
in the interpreted mode (I say probably because I don't own it and only
played with it at a dealer for about 30 minutes, and it seemed faster although
not 'lots' faster). Nothing like GFA Basic so far, although at the rate 
A500's are selling in Germany this may change soon.

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

kent@xanth.UUCP (07/09/87)

Not really pertinent, but since there was an AmigaBASIC thread hanging around,
I thought I'd kick in a neat idea that worked.

I typed in a text file that needed to be letter perfect (literally) and was
several pages long.  I live alone, and wouldn't impose the job of helping me
check this dog on anyone else, anyway.

So, I brought up AmigaBASIC (first time in months), and wrote a little routine
with a phonetic, Navy style alphabet (you know, alpha, bravo, charlie), and a
matching list of the printed characters, then fed the text to check in,
converted it character by character to the alphabetic, phonetic equivalent,
and used the say command to read it back to me.  Twenty minutes of programming,
and about 27 minutes per page to go through the text-to-be-checked, and I
cleaned out about two typos per page.  No sweat, except I listened for hours
(and the suspend menu/control key item worked great when I got a bit stir
crazy), and I got what I really trust to be a letter perfect product.

I love Amy, and I thought some of the rest of you might find this idea to be
of interest.  The phonetic forms weren't too hard to develop, and the result
was good enough that I could hear it clearly even when the apartment
maintenance staff were whizzing by my back door on their John Deere lawn
mowers.

I used to read to my kids, nice to have a computer read to me as I (re)enter
my second childhood, soggy brain cells and all!  ;-)

Kent, the man from xanth.

fgd3@jc3b21.UUCP (07/10/87)

In article <2460@husc6.UUCP>, hadeishi@husc4.HARVARD.EDU (mitsuharu hadeishi) writes:
> There are no competitors, anyway (except perhaps TrueBASIC, but that's
> a compiler if I'm not mistaken.)  

     There is another BASIC compiler which is purportedly compatible with
AmigaBASIC source files.  I don't remember its name, but it is a recent
release.  Does anyone know anything about it?  Is it fast?  Is it really
compatible with AmigaBASIC?

--Fabbian Dufoe
  350 Ling-A-Mor Terrace South
  St. Petersburg, Florida  33705
  813-823-2350

UUCP: ...akgua!usfvax2!jc3b21!fgd3 

hedley@cbmvax.UUCP (Hedley Davis) (07/13/87)

>
>     There is another BASIC compiler which is purportedly compatible with
>AmigaBASIC source files.  I don't remember its name, but it is a recent
>release.  Does anyone know anything about it?  Is it fast?  Is it really
>compatible with AmigaBASIC?
>
>--Fabbian Dufoe
>

	Its called ACBasic. I can't remember who wrote it, but we did
have a Beta copy floating around here which I used to write a bicubic
patch editor. The code was ~1000 lines. The compiler really speeded
things up amazingly. Not so much of an increase in the totally raw math
operations, but the control flow speeded up enourmously. AmigaBasic
does not use a very efficient method of handling control flow. Sorry,
but I don't have any benchmarks either.

	One other thing, the compiler requires a run time library be
present on the WORKBENCH disk. This is annoying, but the speed increase
makes it worth it. 

	One other One other thing, It compiles really fast. If you
select options to keep the source and temporary files in RAM:, it'll
crank just under a thousand lines a minute. Pretty damn nice.

Hedley

hedley@cbmvax.UUCP (Hedley Davis) (07/13/87)

	Aha ! Found it.

	The  ACBasic compiler is available from ABSOFT for $195.
	Their phone number is (313)-853-0050.

	I have no affiliation with them, but it seems pretty good
	to me.

Hedley

barry@aurora.UUCP (Kenn Barry) (07/14/87)

[]
	One small correction to Hedley's remarks on Absoft's ac-basic
compiler:

In article <2098@cbmvax.UUCP>, hedley@cbmvax.UUCP (Hedley Davis) writes:
>	One other thing, the compiler requires a run time library be
>present on the WORKBENCH disk. This is annoying, but the speed increase
>makes it worth it. 

	This is optional. You can either have small executables by
compiling them without the run-time library being part of them, in
which case the run-time library must be present elsewhere on the disk,
or you can compile them stand-alone. In that mode the run-time library
is contained in the executable. This makes the program quite large,
but means it runs without help.
	I haven't yet put the compiler to serious use, but my first
impressions are good. It seems very compatable with the interpreter,
much more so than the BASIC compiler-interpreter twins I've used in
the past on CP/M and Apple DOS.

						Kenn Barry
						NASA-Ames Research Center
						Moffett Field, CA
-------------------------------------------------------------------------------
Electric Avenue:	    {dual,seismo,ihnp4,hplabs}!ames!aurora!barry

foy@aero.ARPA (Richard Foy) (07/14/87)

In article <126@jc3b21.UUCP> fgd3@jc3b21.UUCP (Fabbian G. Dufoe) writes:


>     There is another BASIC compiler which is purportedly compatible with
>AmigaBASIC source files.  I don't remember its name, but it is a recent
>release.  Does anyone know anything about it?  Is it fast?  Is it really
>compatible with AmigaBASIC?
>
The other compiler is AC-Basic. I purchased it from Computer Best in 
Pheonix for $125. It is mostly compatible with AmigaBasic. That is you
can write programs that will run on both the interpreter and can be 
compiled. There are some things that you may have to do with programs
written without the compiler in mind. They are not very hard to comply
with. Most of them: Differences in the use of STATIC arrays, Arrays are
limited to 7 dimensions, restrictions on the order of definitions and
declarations, difference in error handling of divide by 0, compiler
will not support the CONT, the DELETE, the LIST, the LLIST, the LOAD,
the MERGE, the NEW, the SAVE, teh TRON/ TROFF statements. None of these
are of much concern.

I have not done any large programs as yet. However I think that the
compiler, compiles in a relatively short time; ie compared to 
an equivalent program compiler with my Lattice C compiler, if one
can make such a comparison. (note I do have 2 megs of fast ram. However
the compiler is not too large so I don't think that my extra memory 
speeds it up much.) Compiled programs run fast. However not as fast
as similiar things done in C. You can also loose speed if you are not
carefull with how you do arrays. Again I don't think this will be too
much of a problem. 

There are two options regarding program size. You can compile without
having a run time library of about 45000 bytes attached. In this case
you have to have the library available to your program somewhere on disk
or in ram. In this case your compiled code is quite small and different
programs can access the same library. However if you want a stand alone
application you have to add the library code. Neglecting the library
aspect teh program size is quite reasonable.

The other aspect that I don't like. (I don't know if there is a way around
this. Perhaps if some one from AC-Soft reads the net they can respond.)
The compiler automatically attaches a window to the program. This is a full
screen sized window. I don't know if it is possible to eliminate this facet
when you don't want a seperate window opened, or even if you can have it 
open a small window if this is what you desire. 

I am just beginning with the Compiler. I am glad that I purchased it. I
suspect that there are things that I will find it very usefull for.
Perhaps if I had more experience with C I would not be so pleased to 
have it.

The above opinions are my own.

Richard Foy

spierce@pnet01.CTS.COM (Stuart Pierce) (07/17/87)

What I have never been able to find out is whether A/C Basic is 100%
compatible with Amiga BASIC.  If it is, I'll order one tomorrow.
Stuart Pierce