Elixir to/from JVM

I found this interesting effort to interop between Haskell and JVM:

Q: Is there a possibility of doing the same with Elixir?.

3 Likes

Erlang already has code for the JVM to act as an erlang node. You can easily make a Java/Kotlin/Whatever ‘node’ using that library and connect it to an erlang mesh then just communicate between them as normal (including serializing up java code and sending it to the java side to do whatever it wants with it, though a proper api is always better).

As for writing and calling java within elixir, could easily define it via a macro set of stuff and just have it communicate to a local java via a port.

But still, ew? ^.^
/me is not a fan of the JVM or .NET engines, their design is near identical and both horrible.

3 Likes

For haskell jvm there is https://github.com/Frege/frege
To inter opt elixir java I think I would prefer http://www.grpc.io/ (client <-> Server)
Most google APIs are exposed by grpc.

1 Like

For note, here is the built-in erlang java interop library docs: http://erlang.org/doc/apps/jinterface/jinterface_users_guide.html

2 Likes

My first goto choice for integrating something else into Erlang are ports. I’ve blogged about it here. The example in the post interops with Ruby, but the same can be done with any other language.

If interoping with a separate standalone system is required, I’d just use HTTP requests.

6 Likes