Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IronClad equivalent for Jython

For IronPython there is a project - IronClad, that aims to transparently run C extensions in it. Is there a similiar project for Jython?

like image 945
sumek Avatar asked Apr 01 '26 06:04

sumek


2 Answers

Keep an eye on JyNI (http://www.jyni.org), which is to Jython exactly what is Ironclad to IronPython. As of this writing JyNI is still alpha state though.

If you just want to use some C-library from Jython, simply use JNA from Jython like you would do from Java. If you need finer control, look at JNI or SWIG.

Also, you might want to take a look at JEP (https://github.com/mrj0/jep) or JPY (https://github.com/bcdev/jpy).

like image 58
stewori Avatar answered Apr 03 '26 21:04

stewori


You can probably use Java's loadLibrary to do that (provided it works in your platform's java). It is in the java library: java.System.loadLibrary().

Note that sometimes you will have to write a wrapper in C and/or in Java depending on the library you want to use and target system, since details are platform dependant. Refer to the documentation for more details.

like image 29
nosklo Avatar answered Apr 03 '26 21:04

nosklo