I can't imagine anyone would object if Python could magically be 10x faster. I can't say the same thing for the Haskell thing.
I can't imagine anyone would object if Python could magically be 10x faster. I can't say the same thing for the Haskell thing.
This statement is easily refuted by PyPy. Here's a simple program which runs 70 times faster in PyPy than Python on my machine - including startup time:
https://pastebin.com/2n0PL9hY
> How do you optimize this?Semantically, everything in JavaScript and Lua is also hash map lookups. Yet very smart people have made those languages very fast. CPython is not slow for the reasons you stated.
I'm not sure how this is relevant to my reply... I didn't say PyPy was a replacement for Python. I said PyPy, Lua, and JavaScript are existence proofs that dynamic "hash table" languages don't have to be slow. Therefore, CPython must be slow for some other reason.
Though there are a lot of if isInstance(Foo, bar) that could be avoided in a statically typed language.