6 ms·
So maybe we should sacrifice compiler speed for having a better compiler optimize more readable code?
by likeabbas 7y ago
So maybe we should sacrifice compiler speed for having a better compiler optimize more readable code?
- SallySwanSmith 7y agoIsn’t that the entire point of higher order programming languages?
- weberc2 7y agoWhat are "higher order programming languages"? Did you mean "higher level programming languages"? If so, no, the point is that you can program more abstractly, almost always at the expense of performance. EDIT: Downvoters, I'm terribly curious which of these points you disagree with? Do you believe higher level languages (like Python, JS, or even Go) are faster than lower level languages (like C, C++, etc)? Or do you believe that HLLs are actually faster (or meant to be faster) than LLLs? Or maybe you are downvoting because I don't know what a "higher order language" is?
- sagichmal 7y agoThe downvotes are because you have chosen to make an irritating pedantic point about word use when the meaning was entirely clear in context.
- weberc2 7y agoWasn't trying to be pedantic; whatever is "entirely clear in context" is not entirely clear to me at all. Did he use a term that I'm unfamiliar with or did he use the term I'm familiar with in a way that is incongruent with my understanding?
- indentit 7y agoMost compilers skip optimizations when compiling in debug mode, so that it is still quick to iterate/test, then perform the optimizations which take longer to compile for release builds. Obviously it means one can only profile code when it has been compiled in release mode, which I guess has its drawbacks...
- weberc2 7y agoI do wish Go would do this. The fast compiler thing is fantastic, but I think we can have the best of all worlds by supporting a --release flag, and I think Go is large enough now that we can justify the extra maintenance cost of dealing with two compilation modes.
- innocentoldguy 7y agoIs a "fast compiler" really all that impressive though when a lot of the speed comes from not checking things that other compilers do?
- adrianN 7y agoDoes it really matter how the compiler does it? Faster compilation speed makes programmers happier. And it's not like you can convince a C++ or Rust or Scala compiler to just trust you with the types this once and compile your program ten times faster.
- 0815test 7y agoType checking is a very small part of Rust compile cost; most of it is due to the extensive use of monomorphized code (resulting in code bloat which is not always well-controlled, to put it mildly), as well as overhead in the LLVM-dependent part of compilation. Some features in the pipeline for Rust should enable some improvements, particularly const-generics and specialization.
- adrianN 7y ago