[net.lang.c] HLL vs. \"HLL-like\" macro packages

cottrell@nbs-vms.ARPA (02/06/85)

/*
> >> Furthermore, developing macros can make an assembler look more 
> >> structured and introduce some higher-level concepts, but it normally
> >> makes the code produced LESS good than hand coding.
> >
> >If that is true, how can a compiler produce better code than by hand?
> >High level languages are in a sense complex macros. Anyway, your code
> >is probably I/O bound. 
> 
> A compiler can produce better code than a set of HLL-like macros because
> the (any decent) compiler contains an optimizer, which no assembler I'm
> familiar with does.
> 
> 		-- David Dyer-Bennet
> 		-- ...decwrl!dec-rhea!dec-mrvax!ddb

the opti-miser is the programmer. gimme almost any compiler output & i'll
hack a few instruxions off it. gimme the source for that matter & i'll
generate better code than the compiler. dna is awesome!
*/

guy@rlgvax.UUCP (Guy Harris) (02/06/85)

> the opti-miser is the programmer. gimme almost any compiler output & i'll
> hack a few instruxions off it. gimme the source for that matter & i'll
> generate better code than the compiler. dna is awesome!

OK, take a lump of typical C code and go through it and create lots of
blocks with lots of local declarations, so as to reuse the same register
for several different variables.  Tedious work, and makes the code less
readable.  Compilers can do this without torqueing the code and without
getting bored; this particular trick is used by several compilers for RISC
machines.  Now take such a RISC machine and do optimization when you have
to deal with delayed branches, delayed loads, etc..  People turn other
kinds of optimization over to computers because it's easier to have the
computer perform the algorithm in question than to have people perform it.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy

guido@boring.UUCP (02/08/85)

>/*
>the opti-miser is the programmer. gimme almost any compiler output & i'll
>hack a few instruxions off it. gimme the source for that matter & i'll
>generate better code than the compiler. dna is awesome!
>*/

You should apply for a job as compiler.  Seriously, don't you think the
real problem is how to produced the source in the first place, rather
than starting to optimize code which might not even work in the first
place?

	Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam
	guido@mcvax.UUCP

Much ado Nothing Happens.