This post depicts how I built a dynamic bridge between Java and v8, and how methods annotated as
As nice as it might sound, it comes with a myriad of limitations:
number, string, boolean, null, typed arraysand
array, or objectof these types can be safely converted between environments. Arrays and Objects are defined recursively.
nullwill be returned instead.
- Asynchronous calls. These can not be directly modelled with this approach. But they work under other
- It tends to be slow: reflection in Java + JNI bridge. Read on my APT articles on how to remove reflection calls.
Are all these limitations worth it ? it totally is for non critical code paths. In my case I use it for things like calling the speech synthesiser, open share dialogs, create gl textures… But definitely not for calling into every OpenGL function per frame for example.
Implementation details in an upcoming article version 2.