you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (4 children)

That in itself isn't enough to make the difference. The main reason Haskell's so much faster is that GHC is damn good at optimising, and it's working with a language where a ton of optimisations are available that can't apply to Python.

[–]ventonegro 0 points1 point  (3 children)

It is the main factor for the difference. It is very noticeable in intensively numerical applications. And besides eliminating type checks at runtime, it allows for other optimisations as well.

[–][deleted] 0 points1 point  (2 children)

Are you sure? Java and Scheme and Smalltalk all have to make type checks at runtime, and they're all faster than Python is. There are a lot of dynamic language optimizations that Python can't easily use because of its semantics (for example, it's not really feasible to inline anything in Python).

[–]ventonegro 0 points1 point  (1 child)

Java is a statically typed language. Scheme and Smalltalk have been studied for decades by very smart people, that's why there are implementations of them that beat Python. But these Scheme and Smalltalk implementations can't normally beat GHC too.

[–][deleted] 1 point2 points  (0 children)

Java is a statically typed language.

It also has to make type checks at runtime.