Re:Clojure Implemented in Pure Python
by mark_l_watson on Wednesday February 29, 2012 @05:25PM
(#3650022)
That looks nice. I have to ask: Clojure on the JVM is fast: can a PyPy runtime really compete after Hotspot has a chance to optimize?
[ Parent
| on HN ]
I'm less concerned with speed on this platform. I think it'd be excellent even if only suitable for small scripts that need to start up fast.
Re:Clojure Implemented in Pure Python
by rbranson on Wednesday February 29, 2012 @06:09PM
(#3650197)
All VM JITs compile to statically-typed machine code, so it's doubtful that building a VM from the ground up for dynamic code is going to yield major performance improvements. There are some enhancements that give VM-level visibility into dynamic invokation (like INVOKEDYNAMIC in JVM 7), but this has a relatively small performance impact on real-world codebases. In addition, the modern JVM is a sophisticated, highly-tuned machine with millions of man-hours on the books. It's unlikely to be eclipsed any time soon.
This is not true at all. PyPy implements a tracing jit that compiles specific loops for each set of types run through the interpreter. This means it is actually possible to have Python code that runs faster than C code in some rare cases: http://morepypy.blogspot.com/2011/07/realtime-image-processi...