5 ms·
OK, but that wasn't the original question. (There are also all sorts of optimizations that can't be done statically, so I guess there's that.)
by tonyg 9y ago
OK, but that wasn't the original question.
(There are also all sorts of optimizations that can't be done statically, so I guess there's that.)
- naasking 9y agoThe original question asked whether static typing is needed when maximal performance is required. If we understand "maximal" to mean literally, "no more performance can possibly be squeezed out", then it simply is. Static typing might not be sufficient for this case, but it is necessary.
- tonyg 9y agoI think those few, crucial pieces of hand-written assembly language one sees from time to time disagree with you. (Modulo your observation that assembly languages are trivially statically typed.)
- naasking 9y ago> I think those few, crucial pieces of hand-written assembly language one sees from time to time disagree with you. I still don't think so. For example, plenty of silicon is spent on branch predictors simply because addresses and integers aren't distinguished, in general, thus permitting more expressive but costlier code. Execution would be much faster if integers and addresses were forced to be distinct. Static typing pretty much always improves performance.