kud1ing / rucaja

Calling the JVM from Rust via JNI
https://docs.rs/rucaja
Apache License 2.0
31 stars 7 forks source link

Provide easier to use high-level functions #31

Open kud1ing opened 6 years ago

kud1ing commented 6 years ago

Currently it takes a lot of code in order to call a JVM method: resolve the class, resolve the method, build the arguments from Rust data, possibly convert the result back to Rust data types etc.

It would be nice to be able to do this with less code in Rust. I think being more wasteful, like resolving classes/method, constructing data with each call, is fine for the sake of convenience. Users can still opt to avoid those calls by using the current wordy interface.

The official recommendation is - and maybe we should reproduce the tip exlicitely in our documentation - is to use as few JNI calls as possible.

The signature builder from https://github.com/kud1ing/rucaja/issues/3 supports usability too.