I am (again) looking through JEP-370 (
https://openjdk.java.net/jeps/370). It is really hard to understend wether it is usable without actual examples, but it seems like it would allow to simplify working with foreign data structures like numpy arrays.
@roman.belov have you considered to use something like this? I was thinking more about Apache Arrow for that, but I am not sure yet.