Java Magazine: Jython 2.7 - Python and Java’s best integrating option

|

The latest edition of Java Magazine for November/December 2015, featured an article about Jython 2.7 as part of an ongoing series exploring JVM languages. An integration of Python and Java, Jython makes it easy for developers to create projects and there are plenty of reasons why many choose it. “You might choose to use it because you want to use Java packages in your Python code; explore the Java ecosystem through Jython’s interactive console; deploy a Python project that uses Django into a servlet container; or bundle your Java project with a scripting language (as found in popular tools such as Sikuli, The Grinder, and IBM WebSphere),” according to Java Magazine.

Jython’s first release 2.0, which supported Python 2.0, launched in 2001 but there were earlier releases before 2001 named JPython. According to Java Magazine, Jython has developed over the years since it was first released. Nowadays Jython is known as one of best stable alternatives for Java.

Jython 2.7, which was released in May 2015, supports Python 2.7, Python ecosystem, and is well integrated with Java. Even though Jython is not the only option to integrate Python with Java, since JPype and Py4J are valid options as well, Jython is the only option that supports Java objects and Python objects in the same way, making it easier to work with either of them. “The Python language lacks an ordered set as part of its standard library. But Jython makes it easy to use Java’s available implementations of ordered sets, including java.util .LinkedHashSet, which maintains insertion ordering, and java.util.TreeSet, which maintains natural ordering,” according to the latest edition of Java Magazine.

As any other language, Jython 2.7 has its own drawbacks. As you may already know, Jython 2.7 doesn’t suport an alternative JRE when generating Jython launchers, and requires the latest versions of Java, starting from Java 7. According to Java Magazine, Jython 2.7 releases will improve the platform by focusing on Jython’s performance and integration.

The development of Jython 3.5 has already started and it is expected to launch in the next two years. “At somefuture point, a release of Jython 3.5 is planned, paralleling the CPython 3.5 release. It is worth pointing out that Jython 2.7 basically has the same internal runtime support and stdlib as Python 3.2. But substantial work will be required to get to Jython 3.5. One eagerly anticipated feature in Python 3.5 is optional static typing, which will enable even better Java integration in Jython.”


 


Silvae Technologies Ruse, Bulgaria

44B Borisova Str.
7012, Ruse, Bulgaria

Silvae Technologies Brussels, Belgium

1000 Brussels, Belgium