Path: utzoo!mnetor!uunet!husc6!necntc!ima!johnl From: jiml@cs.wisc.edu (James E. Leinweber) Newsgroups: comp.compilers Subject: Re: Simplistic Assemblers? Message-ID: <803@ima.ISC.COM> Date: 17 Dec 87 04:39:02 GMT Sender: johnl@ima.ISC.COM Reply-To: jiml@cs.wisc.edu (James E. Leinweber) Lines: 46 Approved: compilers@ima.UUCP In-Reply-To: uwvax!husc6!think!ames!necntc!ima!johnl's message of 15 Dec 87 18:03:55 GMT In article <789@ima.isc.com> Doug Pardee writes: >There is a modern aphorism that "It's much harder to program in assembler >than in a high-level language". That's no surprise ... John Levine adds: >It has always seemed to me that the main place that assembler loses is in data >structuring -- typed data and pointers buy you a lot, particularly in the >error checking department, and it'd take an awful lot of macro magic to give >an assembler that. Most people won't dispute that having a compiler do some of the work such as register allocation and strong type checking really does make programming easier. Even if you are using a fancy assembler. Or maybe especially; programs which are mostly sophisticated macros such as fancy assembler, troff packages, or FORTH are notoriously hard to read. Personally, I suspect this is due to difficulty of reproducing the train of thought the author had while writing the code. Working in an very expressive medium makes it easy to embody an idiosyncratic approach into the code. Intermediate between assemblers and higher level languages is an alternative which is often over looked. In the late '60s Don Knuth called them "structured assemblers". IBM is using one to do space shuttle software. Ed Ream published a lovely article in Dr. Dobbs last year, showing how to use a rich subset of C as an assembly language. His key point was that data structures, procedures, and variables all have straightforward translations to assembly code. In the absence of optimization, all you need to give you full assembly language power with structured syntax is enough restrictions on the variable declarations that you end up doing the register allocation yourself. Jim Leinweber jiml@uwslh.uucp jiml%uwslh.uucp@cs.wisc.edu ...!{rutgers, ucbvax, ihnp4, ...}!uwvax!uwslh!jiml State Laboratory of Hygiene @ Univ. of Wisconsin - Madison; (608) 262-8092 [There used to be a lot of structured assemblers; I used one for the 360 called PL/360 which had a distinct Algol flavor. There used to be something called LIL at Bell Labs which was sort of souped down C. The guy who wrote LIL wrote a tech report in which he said that he considered LIL a failure because there wasn't anything it did that you couldn't do about as well in C. -John] -- Send compilers articles to ima!compilers or, in a pinch, to Levine@YALE.EDU Plausible paths are { ihnp4 | decvax | cbosgd | harvard | yale | bbn}!ima Please send responses to the originator of the message -- I cannot forward mail accidentally sent back to compilers. Meta-mail to ima!compilers-request