Path: utzoo!attcan!uunet!aplcen!haven!adm!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.lang.misc Subject: Re: downward compatibility Message-ID: <18558:Oct119:50:0490@kramden.acf.nyu.edu> Date: 1 Oct 90 19:50:04 GMT References: <1990Sep24.160705.21113@newcastle.ac.uk> <9363:Sep2521:41:1290@kramden.acf.nyu.edu> <1990Sep29.004009.11959@nixtdc.uucp> Organization: IR Lines: 21 In article <1990Sep29.004009.11959@nixtdc.uucp> doug@nixtdc.UUCP (Doug Moen) writes: > 2. Second, let's assume that the compiler writer, knowing that his > machine has a single instruction for counting the bits in a word, > extends the language with a 'bitcount' operation. This throws you full speed into a mound of namespace sh---uh, problems. Portability isn't just whether your code will compile; it's whether it'll compile and do what you want. Centralizing the namespace is not a good solution. Also, you're guaranteeing that your code won't be optimized well for a machine you haven't seen. It's much better to avoid namespace issues by having the compiler not extend the language at all. It merely recognizes some portable sequence of code as doing the same thing as bitcount. The language just lets the programmer express alternative algorithms to the compiler. Certainly extending conditional compilation to identifiers is useful. ---Dan