Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!ukc!its63b!nick%ed.cheops From: nick%ed.cheops@its63b.ed.ac.uk (Nick Rothwell, Laboratory for Foundations of Computer Science,) Newsgroups: comp.misc Subject: Re: Another 1.3 wish. Message-ID: <552@its63b.ed.ac.uk> Date: Tue, 4-Aug-87 10:11:42 EDT Article-I.D.: its63b.552 Posted: Tue Aug 4 10:11:42 1987 Date-Received: Sat, 8-Aug-87 03:37:19 EDT References: <8707190424.AA10158@cogsci.berkeley.edu> <434@sugar.UUCP> <3664@well.UUCP> Reply-To: nick%ed.cheops@its63b.ed.ac.uk (N Rothwell) Distribution: world Organization: LFCS, University of Edinburgh Lines: 55 In article <3664@well.UUCP> ewhac@well.UUCP (Leo (My glasses have gate arrays) Schwab) writes: > Expressing a new or complicated algorithm in a high-level language >is a useful endeavor. It allows you to clearly formulate and express the >problem/procedure in machine-interpretable form. However, once you have the >basic algorithm down, your next step should logically be to translate that >algorithm into assembly by hand. Compilers can do a good job, but never as >good as a human. > > I point to accomplishments of the past. SpaceWars fit in 4K of core >on the PDP systems (as I understand it). I have a copy of a very powerful >music program for the 8080 that runs in 4K. I have a copy of an 8080 BASIC >interpreter that has multi-line user-defined functions, IF-THEN-ELSE, >automatic structure indenting, error trapping, formatted I/O, and matrix >functions. It's 15K in size, and runs great in 32K. Sonix is all assembly >code, and its core is 29K in size (I think). > > Meanwhile, MicroSlush is proud of the fact that the core of their >AmigaBASIC interpreter runs in "only 80K" of RAM. Truly pathetic. *Sigh*. Tell me: why should I, developing sophisticated applications in a strongly typed language on a 4Meg Sun, pause to contemplate doing things in assembly language? Re: quality of code - Perhaps hand-assembly beats compilers IN EXTREME CASES in the code generation phase, but on the whole a compiler can generate code as well as any assembly-hacker. I know people who issue their compilers with a challenge to hand-assemble code which is better - nobody's taken up the challenge yet. Re: program size - well, your 4K SpaceWars fits into, what, $2 worth of memory? Why waste your time with the details of hand-assembly when a few cents worth of memory will solve the problem for you? Such paranoid fear of using memory has caused untold amounts of horrible software to be produced in the past. I guess SpaceWars is impressively small - so's somebody who can calculate really fast on a slide rule. But I've got other things to think about these days. I've been using various 68000 machines for the past couple of years, and I still don't know any 68000 code. My *general* knowledge of compiler construction lets me get whatever efficiency I want out of my code. By the way, I would use assembly code for device drivers, operating system kernels, this sort of thing - but that wasn't really your argument. Anyway, I know of projects where the ENTIRE system was written in a high-level language- yes, every last statement. And I know what it's like to use a small machine - I have a 56k Terak at home. I've developed sizeable Pascal (& nothing else!) applications in it. And I've found that, in the time it would take me to hand-code critical sections of these applications to go faster/be smaller, I could hire myself out as a consultant, make some cash, and go and buy myself a bigger, faster machine. So there. -- Nick Rothwell, Laboratory for Foundations of Computer Science, University of Edinburgh. ARPA: nick%{cstvax,itspna}.ed.ac.uk@cs.ucl.ac.uk JANET: nick@uk.ac.ed.{cstvax,itspna} UUCP: !mcvax!ukc!{cstvax,itspna}!nick ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ "Nothing's forgotten. Nothing is ever forgotten." (Herne)