4 ms·
Python is much harder to make fast due to its highly dynamic nature. (Yes, Python is a much more dynamic language than JS -- see del(), locals(), code objects,
by ootachi 15y ago
Python is much harder to make fast due to its highly dynamic nature. (Yes, Python is a much more dynamic language than JS -- see del(), locals(), code objects, etc.)
- MostAwesomeDude 15y agoThe work has already been done; see PyPy (http://pypy.org/ http://pypy.org/).
- beagle3 15y agoI'm not sure how locals() or code objects makes Python much more dynamic than JS -- even on it's own, but especially since it very rarely appears in idiomatic python code. Nothing in Python comes close to the dynamic mess that is JavaScript's "with" (bindings in Python are lexical; "with" makes bindings in JavaScript dynamic!) Even if you were right, you could still make code that doesn't use these features fast, and slow back to interpreted if any of these features is used -- that's what JS JITs do when they see "with". And finally, Lua is as dynamic as Python (both of which are, in my opinion, less dynamic than JS thanks to lexical binding). And Lua has been made significantly faster than any Python or JS implementation (Mike Pall's LuaJIT2)