4 ms·
> Most current-day programming languages seem to be based on the idea that computation is slow, so the user and the compiler must work hard to minimize the numb
by random_guy1234 7y ago
> Most current-day programming languages seem to be based on the idea that computation is slow, so the user and the compiler must work hard to minimize the number of instructions executed.
Instructions executed is not the only metric to consider! It doesn't makes sense to have loads and stores in the program with all of them having a cache miss.
Does the author mean that the memory hasn't caught up with the computation here? I don't think so.
> For example, one cache miss might take as much time as a hundred add instructions.
This is why compiler must work hard!
> Today's languages contain far too many features that do almost the same thing but have slightly different performance characteristics, for example regular and virtual functions in C++. This just encourages programmers to waste time on micro-optimization when they could instead invest time understanding the large-scale behavior of their program and optimizing that.
Not all programs need to worry about insane performance. But most do. It is totally upto the developers to choose the features of the language which they need. Choosing the right features/language for the right kind of programs is an important skill. Efficient code generation for all possible hardwares and all possible workloads with a restricted language features is not going to work or else Python would have been one of the very few languages to survive. Elon Musk wouldn't have tweeted that he needs C/C++ engineers ;-)
It seems the article suggests that neither the hard working compiler nor the hardware friendly language is required to get good performance!
- pasquinelli 7y agoThere's also energy consumption. Maybe the inefficient implementation isn't noticably slow to me, but i'll be unhappy if it drains my battery.
- random_guy1234 7y agoYes, there are so many things to consider. Another would be size of the binary.. Different kinds of problems are solved by different languages. Simply rejecting them without stating the details doesn't fly!