Re:Web Assembly and Go: A look to the future
by johncolanduoni on Saturday June 23, 2018 @05:59PM
(#17383683)
JNI transitions (at least on OpenJDK and Android) are much more expensive that WebAssembly<->JavaScript transitions. For the latter the same JIT is being used on both sides and there is no need for a GC transition. JNI is also far from as fast as it could be; .NET’s PInvoke is much more efficient (and easier to use).
[ Parent
| on HN ]
Mark Reinhold already stated on a few talks, including at JavaONE that Sun designed it that way on purpose as they wanted to keep everyone true to WORA without carrying native code around.
Which is also a reason why a replacement is being done as part of Project Panama, initially advocated by Charles Nutter due to the JRuby project issues.
http://openjdk.java.net/jeps/191
In alternative, if you have the source code available there is a way not to any transitions.
Java now has GraalVM and .NET had C++/CLI (nee Managed C++) since the beginning.