2 ms·
You can write pretty fast code in Java, so on the JVM you can use Java as your low-level language. With Python, if you want to write fast code (at least with C
by dkarl 15y ago
You can write pretty fast code in Java, so on the JVM you can use Java as your low-level language. With Python, if you want to write fast code (at least with CPython) you have to write a C extension, which requires a certain amount of effort and expertise.
I personally don't know anything about Haskell, but I have heard that it has a very complicated performance model. I.e., it's hard to predict what will be fast and what will be slow, and if something is slow that seems like it ought to be fast, it can be hard to figure out how to fix it. (Since that was one of the major complaints of Haskell users the last time I seriously considered learning Haskell, it might be fixed or mitigated by now.)
Scala can also be slow or unpredictable when using functional idioms, but with Scala you can always revert to Java-style programming to get Java-level performance. The fact that you can do that for a single function or even a single inner loop in a code file that is mostly nice clean functional code is very convenient. One thing I hated about Jython was rewriting entire classes in Java when only a little part was performance-sensitive. Or, equally frustrating, having a Jython class whose associated "little" classes (performance-sensitive callbacks such as renderers) were in a completely different place in the source tree because they were implemented in Java.