2 ms·
Nothing ever comes close to P/Invoke in ease of use* (while remaining practically zero-overhead if you don't need to marshal strings). JNI is on the opposite si
by neonsunset 3y ago
Nothing ever comes close to P/Invoke in ease of use* (while remaining practically zero-overhead if you don't need to marshal strings). JNI is on the opposite side of the spectrum and should never be even compared as it is at least ten times worse developer experiences (and equally higher overhead).
*in garbage-collected languages, otherwise it's pretty much like calling C from Rust.
- ncruces 3y agoI'm sorry. The debugging experience of trying to whip up PInvoke wrappers for the COM library for Kinect 2 that worked with Unity Engine's awful version of Mono was charring. Also had “fun” building some Xamarin Android PInvoke-to-JNI bindings. I just died a little bit remembering this.
- neonsunset 3y agoNo language has good interop story with Android unless there's no interop and you are using Java/Kotlin. As for the first argument - this really does not represent the average experience in the current day ecosystem. Kinect 2 was a thing 9 years ago and together with Unity it's pretty much an exotic scenario. Unity in general is really not a good example until they get Unity 6 out and move over to vanilla .NET.