Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!samsung!dali.cs.montana.edu!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!bacchus!mwm From: mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) Newsgroups: comp.sys.amiga.programmer Subject: Re: How are some programs SO DAMN SMALL! Message-ID: Date: 14 Feb 91 21:06:49 GMT References: <1991Jan20.210328.18087@hoss.unl.edu> <28077.279c3c3f@kuhub.cc.ukans.edu> <91042.125712UH2@psuvm.psu.edu> <91042.134209J56QC@CUNYVM.BITNET> dave@cs.arizona.edu (Dave P. Schaumann) writes: |I'm afraid he means that he used BASIC to write it. [...] No, but I thought about it. Is this true? It is very dishonest to claim the size of a (uncompiled) BASIC program is just the size of the file holding the program. It is really the size of the program + the size of the interpreter. I disagree. It depends on whether or not you have to reload the interpreter every time you run the program. If that's required, then you're right - you should count the interpreter. If the interpreter gets loaded once, the first time you run it, and is always available after that (unless flushed to free memory), then you're wrong - you've got what amounts to a shared library. Cases where one person always has a "library" loaded, and a second person never uses it (i.e. arp.library or cando.library) are ambiguous. I noticed that the original poster neglected to mention which language he used, rather deliberately to my reading of it. Yup. I wanted to see what fell out of that flat - and at first glance impossible - statement. In article <865@caslon.cs.arizona.edu> dave@cs.arizona.edu (Dave P. Schaumann) writes: echo "hello world" is a program in AmigaShell which is roughly 20 bytes long. Bingo. Just add the punctuation, and that's my executable. Note that it meets the portability constraint - that same executable will run on any Unix system, starting with v6, and on any hardware. As for the 'interpreter' argument - echo is built in to the WShell, and execute is either resident, or in the 2.0 ROM (forgot which). So either no extra code is loaded, or execute gets put in ROM and stays there until the space is needed, behaving exactly like a disk library. Why reinvent the wheel ? Which is my point. The nice selection of tools means you can choose something other than C or asm. Given any problem, it can pay to check to see if some other language will work better than C or asm. This could mean you don't spend time rebuilding the things that language provides. With the problem being "produce a small executable", I found that interpreted languages that don't require loading the interpreter work real well. This is especially true on the Amiga, where the interpreter absorbs the required startup overhead (opening libraries) that can be avoided on other systems. As another example, I want to walk a file of bix downloads, and allow the user to skip all messages in a topic that are from a thread tagged as "skip" by the user, where each message has a "I am a reply to ###" on it. This is probably impossible in the shell; and painfull in C or asm (how would you do it?). In ARexx, it requires 1 line at the start of a topic, a 1-line test, 1 line to tag the start of the skipped thread, and 1 line for each message skipped. It was nearly trivial.