JyNI - Using native CPython-Extensions in Jython
Stefan Richthofer

TL;DR
JyNI is a layer that allows Jython to load and use native CPython extensions like NumPy and SciPy without recompilation, bridging the gap between Java and Python scientific libraries.
Contribution
It introduces JyNI, enabling Jython to support native CPython extensions directly, without recompilation or custom Jython builds, facilitating scientific computing in Java environments.
Findings
JyNI can load simple native extensions in Jython.
It is compatible with existing extension binaries.
Future work aims to fully support the Python C-API for complex libraries.
Abstract
Jython is a Java based Python implementation and the most seamless way to integrate Python and Java. However, it does not support native extensions written for CPython like NumPy or SciPy. Since most scientific Python code fundamentally depends on exactly such native extensions directly or indirectly, it usually cannot be run with Jython. JyNI (Jython Native Interface) aims to close this gap. It is a layer that enables Jython users to load native CPython extensions and access them from Jython the same way as they would do in CPython. In order to leverage the JyNI functionality, you just have to put it on the Java classpath when Jython is launched. It neither requires you to recompile the extension code, nor to build a customized Jython fork. That means, it is binary compatible with existing extension builds. At the time of writing, JyNI does not fully implement the Python C-API and it…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Physics and Python Applications · Distributed and Parallel Computing Systems · Scientific Computing and Data Management
