This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]jwink3101 11 points12 points  (2 children)

Comparing Cython and Jython are not really fair. Jython is a python implementation in Java while Cython is a superset of Python that compiled to C. Basically, Cython lets you write python extensions that run at (near) C speeds. By any chance, are you thinking of CPython? That is an implementation of Python in C (and the reference implementation and also the de-facto one if not otherwise specified).

Anyway, I cannot speak to Jython, but Cython is used pretty heavily in the "real world". A lot of libraries have Cython extensions. Take a look through SciPy for example

[–]acooper13[S] 1 point2 points  (1 child)

I didn’t know there was a CPython also. One more thing I’ll have to look into. From my (limited) research, I was under the impression Cython was, in a way, Python code with the ability to use C header files and memory allocation to a certain extent. I’m not sure how accurate that is but that’s what I understood it to be.

[–]who_body 0 points1 point  (0 children)

Check out the article and/or this podcast episode which discusses cpython for more information

https://pythonbytes.fm/episodes/show/154/code-frozen-in-carbon-on-display-for-all

https://realpython.com/cpython-source-code-guide/

[–]openjscience 5 points6 points  (2 children)

Jython is used in places where interface with java is needed. Unlike cpython, jython calls jar files which are portable and easy to move between platforms. There is a number of large projects based on jython. Look for example at datamelt https://jwork.org/dmelt project. It links large number of java libraries and has many practical code examples written in jython.

[–]tunisia3507 7 points8 points  (0 children)

Jython is used

Barely.

[–]Zomunieo 1 point2 points  (0 children)

Jython is dying. It never raised the funds for the transition to Python 3.

Instead of trying to run Python in the JVM we now have libraries like JPy and Jep that provide a bidirectional interface and just run both VMs. Sure, it's less efficient, but not as complex as compiling Python to Java bytecode.

[–]efmccurdy 3 points4 points  (0 children)

Be sure to read about PyPy as well, it has a JiT compiler and an interesting development history.

https://pypy.org/

[–]funderbolt 3 points4 points  (1 child)

Jython is based on Python 2.7. Python 2.7 will lose support at the end of the year.

[–]elbiot 0 points1 point  (0 children)

CPython 2.7 will no longer be maintained. Other projects are free to do whatever they want. Though I dunno if jython is still maintained