3 ms·
> This is true in practice because enough real-world C code has “I know what I’m doing” casting away of const. I found this out the hard way when I implemented
by WalterBright 7y ago
> This is true in practice because enough real-world C code has “I know what I’m doing” casting away of const.
I found this out the hard way when I implemented OptimumC, the first data flow analysis optimizer for DOS C compilers back in the 1980's.
I had to undo doing optimizations on const.
Anecdote: Optimum C blew away all the other C compilers on a magazine benchmark article because it figured out that the benchmark code did nothing and deleted it. The author didn't ask me about it, he just assumed the compiler was buggy and gave us a bad review. Sigh.
When other compilers did DFA, the benchmarks got changed.
- cheez 7y agoNice
- 420codebro 7y agoSounds like you tried to game the system and got bitchslapped.
- Diederich 7y ago> Anecdote: I'd love to hear more about any aspect of this if you have time. (:
- WalterBright 7y agoHere's another failure of marketing on my part. We included full library source with the compiler, for free. No reviewer ever noticed that. One day, Borland decided to make source code for their library, sans the floating point stuff, available for an extra charge. This generated headlines in the next compiler roundup article. No mention that complete library source code, including floating point, came with my compiler. So we decided to split off the library source code into a separate package, and charged for it. This solved the marketing problem, and doubled the money we were making. This was how I learned about the common practice of upselling. I am a slow learner. Of course, these days we give away everything for free!
- MaximumYComb 7y agoBy attaching a price to it, did people assume it was higher quality?
- WalterBright 7y agoAt the time, people assigned no value to bundled things. Most did not appear to be aware it was even there. With it being packaged separately, people noticed its existence, and did assign value to it commensurate with its price. It was attractively priced, and almost everyone buying the compiler also bought the library source.
- jquery 7y ago>The author didn't ask me about it, he just assumed the compiler was buggy and gave us a bad review. Sigh. Did you write a letter complaining? Any response? Do you have a link to the review or copy of it? (Sorry, I just find this history fascinating).
- WalterBright 7y agoI did complain to the author, but the damage was done. Can't undo a magazine article. I didn't save a copy of the magazine I was so annoyed. BTW, it goes on. A couple years ago a kind soul gently suggested I implement DFA since clang had invented DFA. (No, I didn't invent DFA either, but I do believe that Datalight Optimum C was the first DFA compiler for DOS.) http://www.program-transformation.org/Transform/CCompilerHistory http://www.program-transformation.org/Transform/CCompilerHis... The Data Flow Analysis code: https://github.com/DigitalMars/Compiler/blob/master/dm/src/dmc/gflow.d https://github.com/DigitalMars/Compiler/blob/master/dm/src/d...
- mhh__ 7y ago(Bottom link:) does that mean the dmd backend code dates back to the mid 80s?
- WalterBright 7y agoYes. That file in particular has seen little change.
- asveikau 7y agoJust as in the saying about how the best code is the code you didn't write, I guess the fastest benchmark is the one that doesn't run.
- kkylin 7y agoOff-topic, but this discussion is reminding me of this (which some of you might enjoy): https://www.cs.princeton.edu/~appel/papers/conteq.pdf https://www.cs.princeton.edu/~appel/papers/conteq.pdf
- misnome 7y ago> Anecdote: Optimum C blew away all the other C compilers on a magazine benchmark article because it figured out that the benchmark code did nothing and deleted it. I remember this problem being discussed in a CPPCon talk a few years ago, and some ways to "trick" the (modern) compilers into not optimising away the benchmark code - I think it was Chandler Carruth's "Tuning C++" talk: https://youtu.be/nXaxk27zwlk https://youtu.be/nXaxk27zwlk