We all love Java and other managed languages but sometimes they're just not enough. Need an access to the machine learning library, written on C? Or you just want to call the small method from OS API? Or (for just one of your modules!) you need to have a bit more performance than you can ever squeeze out of Java? Well, native code is your choice!
At first it seems so simple and straightforward - you write a native method, load the native library, call the method and that's it, you are in native code! But then suddenly: JVM starts to crash in random places, performance drops significantly and your repository becomes flooded with the endless C files with so many J-N-I letter inside. At which exact moment something went so terribly wrong?
In this talk we will try to sort all things out: what is so unusual in the interop between Java and native code, and what history it has; how to work with native code right now to avoid segfaultы, performance drawdowns, sudden OOMs; and finally, what awaits us in the future with such projects as Panama and Sulong and will it make any sense to talk about interop when they arrived.