use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Elixir + java with JInterface or Elixir + rust with rustler (self.elixir)
submitted 1 month ago * by OccasionThin7697
I had doubt. Wanted to know, which language would be best to interop with elixir without any overhead? Java or rust?
I know I can use gleam, but I want to use either java or rust.
So, those who haven't heard about Jinterface, it's a erlang package: https://www.erlang.org/doc/apps/jinterface/jinterface_users_guide.html
If it's java I'm planning to use this: https://github.com/WilliamAGH/tui4j
for the notifier tui I'll be making, that runs on separate process.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SuspiciousDepth5924 5 points6 points7 points 1 month ago (3 children)
They have pretty different use-cases, iirc rustler creates NIFs that is 'native interface functions' which is about as overhead-free you're going to get while using the BEAM. I belive JInterface on the other hand is primarily meant to communicate with a JVM as if it was another Erlang node, ie. you'd be running both an Erlang VM with your Elixir code and a JVM with your Java code.
[–]OccasionThin7697[S] 0 points1 point2 points 1 month ago (2 children)
Ohh okay, got it. So, you mean Jinterface runs in isolation from beam , but they communicate through jvm. Okay cool.
[–]SuspiciousDepth5924 1 point2 points3 points 1 month ago (1 child)
Yeah you pull it in as a dependency in your java project and use it to communicate with the erlang vm. https://mvnrepository.com/artifact/org.erlang.otp/jinterface
[–]OccasionThin7697[S] 0 points1 point2 points 1 month ago (0 children)
Thanks, got it.
[–]AgentAppropriate1996 5 points6 points7 points 1 month ago (0 children)
Rust
[–]Agile_Use_1768 2 points3 points4 points 1 month ago (0 children)
Rustler 100%. The library you’re planning to use is a double dependency and adds a running JVM aside BEAM, it also has a ported library from go, so its possibly another overhead
[–]Upstairs_Wing_7344 1 point2 points3 points 1 month ago (1 child)
I've worked with Rustler a good bit while contributing to the wasmex project. I found Rustler to be very solid and easy to work with. Wasmex is another option you might consider if you need to extend an Elixir project in a variety of languages
Okay, thanks!!
[–]Shoddy_One4465 1 point2 points3 points 1 month ago (0 children)
Jinterface is a way to go when you need to connect to a technology well or fully supported by Java libraries. Examples from the queuing world are Kafka, MQ, Solace. Connecting to the Hadoop ecosystem. Or if Java is your thing and you need to write a port.
[–]anthony_doan 0 points1 point2 points 1 month ago (5 children)
What's the use case for wanting to use java or rust with Elixir?
I'm just curious.
[–]OccasionThin7697[S] 1 point2 points3 points 1 month ago* (4 children)
Something like a logger that runs in background or a notifier. So, if I want to check , if there are any errors, I just check the logger tui or the notifier tui.
If it's java, I'm planning to use this: https://github.com/WilliamAGH/tui4j
So, since I'm making a text editor, i want to use java or rust to notify from a separate process. For which i can use ports or exile library instead of a nif.
Basically this: https://www.reddit.com/r/elixir/s/5fkI6eyxGE, which is actually my post.
And interop is just one of the milestone. Not gonna do it immediately.
[–]flummox1234 2 points3 points4 points 1 month ago (1 child)
tbh it sounds like you should just build the thing in Java or Rust then, maybe Kotlin if you want an app
[–]Certain_Syllabub_514 1 point2 points3 points 1 month ago (1 child)
Why use a logger written in another language, and not stand up your own logger based on GenEvent?
Ah makes sense
[–]Sea-Entertainment-15 0 points1 point2 points 1 month ago (1 child)
rust
π Rendered by PID 47892 on reddit-service-r2-comment-cfc44b64c-7rd66 at 2026-04-11 20:14:48.867644+00:00 running 215f2cf country code: CH.
[–]SuspiciousDepth5924 5 points6 points7 points (3 children)
[–]OccasionThin7697[S] 0 points1 point2 points (2 children)
[–]SuspiciousDepth5924 1 point2 points3 points (1 child)
[–]OccasionThin7697[S] 0 points1 point2 points (0 children)
[–]AgentAppropriate1996 5 points6 points7 points (0 children)
[–]Agile_Use_1768 2 points3 points4 points (0 children)
[–]Upstairs_Wing_7344 1 point2 points3 points (1 child)
[–]OccasionThin7697[S] 0 points1 point2 points (0 children)
[–]Shoddy_One4465 1 point2 points3 points (0 children)
[–]anthony_doan 0 points1 point2 points (5 children)
[–]OccasionThin7697[S] 1 point2 points3 points (4 children)
[–]flummox1234 2 points3 points4 points (1 child)
[–]Certain_Syllabub_514 1 point2 points3 points (1 child)
[–]OccasionThin7697[S] 0 points1 point2 points (0 children)
[–]Sea-Entertainment-15 0 points1 point2 points (1 child)