On Jan 26, 2009, at 12:43 PM, Magnus Lie Hetland wrote: > On Jan 26, 2009, at 21:33 , Robert Bradshaw wrote: > >>> Basically, it would be to use code that's already written in Java. >>> The >>> Jython part wouldn't be expected to be fast :-) >> >> I think you can already do this with Jython, though it's not compiled >> ahead of time. > > Not sure what you mean here. Jython isn't compiled ahead of time, > true. If you want to use Java code in Jython, the Java code has to be > pre-compiled. But that works well. > > What I was thinking was basically to avoid writing the "high-speed"- > stuff in Java (and thereby avoiding lock-in to the JVM), and that > perhas it could be generated from Cython files (so that the same > source code could be used with C-based systems as well).
That's a worthwhile goal, and could possibly be done by adapting the Jython interpreter to understand the Cython type annotations. From what I understand, Jython compiles Python code on the fly to bytecodes, rather than interpreting it like CPython. (Well, that's being a bit vague, as the JVM then interprets the bytecodes, and CPython has a notion of bytecodes too, but the JVM bytecodes are "closer to the metal" and its virtual machine has a lot more optimizations like JIT compilation.) - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
