3 ms·
"What static type systems force you to do is talk about the data flow of your code. This isn’t so that humans can understand it (though with some discipline it’
by jcl 19y ago
"What static type systems force you to do is talk about the data flow of your code. This isn’t so that humans can understand it (though with some discipline it’s possible to create readable code this way), but so that the compiler and runtime don’t have to figure out what the data flow will be when your code is executed. It’s really a form of optimization."
I've been thinking along similar lines recently, and I was pleased to see this put so succinctly. If static typing is merely optimization, it follows from Knuth's Law that the first draft of your program shouldn't be statically typed. The ideal high-performance language, then, is one in which it is easy to write dynamically typed code, but also one that lets you selectively type your program where necessary, without a lot of changes. I haven't seen too many languages that do this, though; I believe Lisp allows it, as do VB, Boo, and Actionscript 3.0.