Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!columbia!rutgers!mit-eddie!uw-beaver!fluke!kurt From: kurt@tc.fluke.COM (Kurt Guntheroth) Newsgroups: comp.misc Subject: Better compilers (1.3 wish) Message-ID: <1428@sputnik.COM> Date: Fri, 7-Aug-87 11:44:32 EDT Article-I.D.: sputnik.1428 Posted: Fri Aug 7 11:44:32 1987 Date-Received: Sun, 9-Aug-87 02:11:26 EDT References: <8707190424.AA10158@cogsci.berkeley.edu> <434@sugar.UUCP> <3664@well.UUCP> <4564@jade.BERKELEY.EDU> Sender: news@tc.fluke.COM Organization: John Fluke Mfg. Co., Inc., Everett, WA Lines: 34 I agree. The best optimizing compilers are now better than the best human-coded assembly language for program more than a few hundred lines long. We should be spending our collective time writing better compilers rather than recoding in assembler. By the way, the best compilers are better than humans now because they do things to the code that are considered bad style for a human-maintainable assembler source, like reusing the same storage location for different variables, storing the same quantity in different locations/registers during the program run, moving code around, etc. By the way, it is hard to optimize c very highly because of things like pointers and lax type checking. In principle, the best-possible object code from a pascal program will be tighter than the best-possible object code from a c program doing the same thing. The tricks c uses to permit a relatively crummy compiler to produce decent code hobble a really good compiler. And now an anecdote. I once worked for a small computer manufacturer you've never heard of. We had a sales rep in California who thought he was the hottest thing ever to invoke an assembler. He had a customer who neeeded a large hierarchical database sorted every day. Unfortunate thing was, the sort took about 30 hours to crunch the day's data. This guy used an undocumented and difficult to use entry point to the operating system to permit him to code an in-memory sort in (sort of) microcode. He managed to get the sort down to 15 hours. During this time I was working on a standard sort for our new database. My bosses said "call this guy up, he knows everything about sorting." Well, to make a long story sort (uh, short), he was using an O(n squared) sort. In 2 weeks I coded a completely general purpose merge sort in the structured assembler that substituted for a programming language. I sorted this guy's database in about an hour and a half. So what's the big deal about assembler? Algorithms and tuning is where it's at. Kurt Guntheroth