
Native calls to Rust code from Java code - drrb
https://github.com/drrb/java-rust-example
======
tormeh
It would be at least as important to be able to call Java from Rust. Does
anyone know if that's hard?

~~~
AntiRush
There's a library[1] that wraps the jni, allowing just that.

I haven't tried it, but it looks featureful enough to be useful.

[1]
[https://github.com/Monnoroch/RustJni](https://github.com/Monnoroch/RustJni)

~~~
kodablah
I think the continuation of this would be a neat project. The lib starts up a
JVM, it would be interesting to see a macro [1] (or will probably have to be a
compiler plugin [2]) to model Java objects and make it clear the ownership of
memory.

1 - [http://doc.rust-lang.org/0.12.0/guide.html#macros](http://doc.rust-
lang.org/0.12.0/guide.html#macros) 2 - [http://doc.rust-lang.org/0.12.0/guide-
plugin.html](http://doc.rust-lang.org/0.12.0/guide-plugin.html)

------
simmons
Thanks for sharing this. I hadn't previously stumbled across JNA, but it seems
to support Android, so maybe it would be a good way to use general-purpose
Rust libraries within Android apps without writing a lot of new JNI shim code.

~~~
theyoungestgun
Are there any options besides JNA and multi-process shared memory (java to
native through message passing of some sort)?

~~~
yazaddaruvala
If you're not sharing memory, why not just set up a local rest server?

