3 ms·
You could, but it's not really worth it - you'd end up with a pretty boring language. Also, JITs (in particular PyPy) should be able to get decent performance
by andrewcooke 16y ago
You could, but it's not really worth it - you'd end up with a pretty boring language. Also, JITs (in particular PyPy) should be able to get decent performance in the near future without asking the programmer to do anything unusual. In simple terms they assume that types are whatever they find and compile for that (occasionally the assumption is wrong, and they have to correct and do something else, but most of the time you get good performance just by pretending the program was written with static types, even though it wasn't). Obviously it's more complex than that, but you get the idea (the hard part is largely reducing the number of times you need to check you're assumptions are still OK)