Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!convex!linac!att!news.cs.indiana.edu!ux1.cso.uiuc.edu!cs326ag From: cs326ag@ux1.cso.uiuc.edu (Loren J. Rittle) Newsgroups: comp.sys.amiga.programmer Subject: Re: How are some programs SO DAMN SMALL! Message-ID: <1991Feb15.054020.20384@ux1.cso.uiuc.edu> Date: 15 Feb 91 05:40:20 GMT References: <21001@wehi.dn.mu.oz> Organization: University of Illinois at Urbana Lines: 40 > 2. Unless I am completely mistaken the original poster asked why some > programs for which he received _executables_ were so small. This is an > interesting questions and there are quite a few tricks for this. Using > basic or smalltalk or rexx is a notoriously bad way to do this. Humm, last time *I* checked, using ARexx was a notoriously good way to make a small fast _executable_ (in some cases)... An ARexx program to be interpreted is as executable as a compiled C program. If you disagree, go read up on basic CS theory. Anyways, back to why ARexx is a good choice for small fast _executable_: "do i = 1 to 1000; say 'Hello World' i;end" >ram:xx takes 01.683 seconds on my GVP '030 system... while the C program compiled with `lc -O -L test.c' void main(void) { int x; for (x = 1; x < 1001; x++) printf("Hello World %d\n", x); } test >ram:yy takes 00.966 seconds. Humm, considering the fact that both produce the same output, and one took a lot less time to develop and test, I think ARexx is quite a fine choice... When sending the output to the screen, the difference in run times is much harder to find, C 46.5 seconds, ARexx 47.0 seconds! As a bonus, ARexx programs don't (in general :-) crash the machine like C programs can be known to (while testing of course...) on the Amiga. File size: C source 89 bytes, C executable 6536 bytes (sure, I could get it down to 1000-2000, but that would just take more time...) Arexx, 42 bytes Think before you spout off next time! Loren J. Rittle -- ``NewTek stated that the Toaster *would not* be made to directly support the Mac, at this point Sculley stormed out of the booth...'' -A scene at the recent MacExpo. Gee, you wouldn't think that an Apple Exec would be so worried about one little Amiga Device... Loren J. Rittle l-rittle@uiuc.edu