Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.arch Subject: Re: What the compiler won't do you for you Message-ID: <5412:Mar107:10:0491@kramden.acf.nyu.edu> Date: 1 Mar 91 07:10:04 GMT References: <8787@exodus.Eng.Sun.COM> <24280:Feb2802:55:4991@kramden.acf.nyu.edu> Organization: IR Lines: 41 In article khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) writes: > I question whose eyes are closed here. Exactly how many compiler > writers do you expect to conform to your new ad hoc standard ? Huh? It's purely a quality-of-implementation issue. Someone whose compiler *cannot* produce DREM or CX or any other available instruction has a poor compiler. And someone with a better compiler had better document the idioms that his optimizer will understand, or programmers won't be able to take advantage of the feature. Are you claiming that a compiler that *can't* produce DREM on a VAX is better than a compiler that *can*, all else being equal? Sure, it takes a bit of time for the compiler writer to add this feature. That's the disadvantage of any improvement to software: someone has to write the code. > If you rely exclusively on the kindness of compilter > writers, you will have zero portability. Huh? I've seen several responses that make the same claim. But it's entirely wrong. The recognized idioms will typically be *different* under different compilers, but since they're written in PORTABLE code this is entirely irrelevant. If I write code for one idiom and use it under a compiler that doesn't recognize the idiom, the code will still work, and I'm certainly better off than if I had used assembly language on the first machine. > Methods which start with class libraries (modules etc.), are > completely portable. And this is completely useless. I've said this before, and I'll say it again: I cannot wait for language designers to catch up. I need to be able to write efficient, portable code NOW, not in ten years when a better language is widely available. Sure, it would be nice if C or Fortran had Hamming weights. But they don't. So stop talking about portable libraries to solve these problems: they don't exist. ---Dan