Hacker News new | ask | show | jobs
by mihaigalos 1062 days ago
I've used Swig to inherit from base classes in Java to implementations in C++. Swig generated the JNI and C++ bindings.

Fun times.

3 comments

SWIG directors are awesome. It's so powerful having some functions implemented in C++ and some in Java in the same class, and able to call each other willy-nilly.
Swig is kind of clunky. But it is so much better than writing JNI yourself. JNI is gouge-your-eyeballs-out awful; SWIG is at least tolerable, and it works.
+1 or maybe +200. JNI OMG, now I will have nightmares tonight.
Yep! SWIG with Python may be a poor use-case, but it worked really well for me with Java/JNI. This was 10 years ago though!