开发者

Uses of Jython while programming

开发者 https://www.devze.com 2023-01-14 12:41 出处:网络
I recently started learning Pyth开发者_C百科on and came accross the term Jython. From the Google search results, I thereby concluded that it is indeed a very important term.

I recently started learning Pyth开发者_C百科on and came accross the term Jython. From the Google search results, I thereby concluded that it is indeed a very important term. What is the experience programming/coding using Jython?


Jython is just an implementation of the Python interpreter that runs on the JVM (Java Virtual Machine).

What is JPython?

JPython is an implementation of the Python programming language which is designed to run on the Java(tm) Platform. It consists of a compiler to compile Python source code down to Java bytecodes which can run directly on a JVM, a set of support libraries which are used by the compiled Java bytecodes, and extra support to make it trivial to use Java packages from within JPython. JPython has been renamed and superseded by Jython.

So coding in Jython is the basically same as coding in Python; with the advantage of having access to Java libraries.

Read: Jython FAQ, Why Jython?


It's not just about the advantage of having access to the Java libraries. It's also being able to run on Java VM's with all their support and optimizations (i.e. JIT compilation).

Jython is also very usefull for scripting Java applications.

IronPython is a similar approach for the .NET CLI


My recommendation to you: Forget about Jython and IronPython. Nobody uses them except the beginners and their developers. As for Jython, it's much slower, less robust, and less reliable than Python (aka CPython). It doesn't have the significant number of "batteries" that come Python; moreover, threading, process, and other lower-level inner-workings are different, resulting in subtle and hard-to-debug bugs.

0

精彩评论

暂无评论...
验证码 换一张
取 消