Bindings for Python
Nir Lisker
nlisker at gmail.com
Mon Jan 12 20:46:49 UTC 2026
Thanks Maurizio, the section in the guide that talks about other
languages [1] could use some expansion by what I'm seeing under the
samples directory, or at least a link there as well (there's one at
the beginning of the guide).
I'll have a look at the sample.
[1] https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md#other-languages
On Mon, Jan 12, 2026 at 3:28 PM Maurizio Cimadamore
<maurizio.cimadamore at oracle.com> wrote:
>
> Hi Nir,
> Python provides a fairly complete library (libpython) that allows any
> programs compatible with a C interface to call into python.
> This library can be jextracted (see [1]), so it is possible to use
> libpython to call Python from Java (via FFM), and, maybe, even to use a
> tool to automate some of the code generation -- although we didn't do
> any deep exploration in this direction.
>
> (There's also Cython, which allows compiling Python code into C -- but I
> believe that path to be more similar to Java/JNI -- e.g. the generated C
> bindings are meant allow Python functions to be implemented in C/C++ --
> so the resulting code is still meant to be called from Python, not C)
>
> Cheers
> Maurizio
>
> [1] - https://github.com/openjdk/jextract/tree/master/samples/python3
>
> On 10/01/2026 15:26, Nir Lisker wrote:
> > Hi,
> >
> > Has interfacing with Python been looked at in the same sense that
> > interfacing with Rust can be done with cbindgen? Has it been attempted
> > internally and are there any writings on this?
> >
> > Thanks,
> > Nir
More information about the jextract-dev
mailing list