5 ms·
Seeing as how the Python and Tcl interpreters are both written in C, this really just seems to imply that the C code wasn't written very well.
by mark-t 18y ago
Seeing as how the Python and Tcl interpreters are both written in C, this really just seems to imply that the C code wasn't written very well.
- silentbicycle 18y agoNot necessarily. Code in a language based on C can potentially be faster than it by having a deeper understanding of the code, and doing sophisticated optimizations C could not confidently apply. In Haskell, for instance, it often transforms multiple transforming passes over a list into one pass over the list with the three transformation operations composed (that is, map x (map y (map z l))) to map (x . y . z) l). I'm sure there are much, much better examples... This isn't 100% true, because in theory you could have written out the ideally optimized version of machine language for what you're trying to do, or (perhaps) a direct transliteration thereof in C. In practice, this isn't realistically possible, except in tiny pieces. See also: Proebsting's Law (http://research.microsoft.com/~toddpro/papers/law.htm http://research.microsoft.com/~toddpro/papers/law.htm)
- drewp 18y agoThe proof of Proebsting's Law seems kind of silly because running a compiler with optimizations turned off wouldn't actually disable all the years of advancements of compiler technology. It seems quite reasonable that many compiler advancements have to be added at the same time as hardware support. That doesn't make them purely hardware contributions. Also, the proof skips more than a few critical steps when it says "Let's assume that this ratio is about 4X" and then uses that number as a multiplier in the answer.
- silentbicycle 18y agoI agree that the proof is pretty much handwaving, actually, but I still think their underlying conclusion is valid: Our efforts into optimizing languages should focus on making programmers more efficient, before hardware. (In other words, programmer time is almost always more expensive than processor time.) Also, I think most things in computing called X's Law are not entirely serious, these days.