Hacker News new | ask | show | jobs
by rvikmanis 3836 days ago
Could be killer if combined with electron.
4 comments

If the goal is having a fast "business-rules engine" coupled to a pretty HTML5-based app-wrapper, one of my own projects is to combine Electron with the Erlang VM.

Rather than trying to go whole-hog on linking the two worlds together at a process level, I've just embedded an Erlang release into the Electron package, which decompresses itself to the user's Library/APPDATA dir on Electron startup, transparently registers as a service (so it can continue to run for things like server sync when the app is quit), and then communicates with the app using Unix domain sockets.

It's a bit like the feeling of having a Service Worker, but one that just happens to be able to embed things like physics engines inside of it.

Using Erlang in a desktop application sounds great, do you have any code online somewhere? Or could you make a gist? I would love to see how you made that work.
You might want to look into BERT [0], I think there is a JavaScript library. We used it a few years ago to call Ruby from Erlang, it wasn't fast at the time, but it did what we needed it to do.

[0] https://github.com/blog/531-introducing-bert-and-bert-rpc

I'm doing the same thing with a JVM. I had to fix the bug where named pipes on Windows were totally busted in Electron before I could make any progress.
Ah, I ran into that problem (I think?) and had been just using regular IP sockets as a stop-gap, planning to switch back over after it was fixed. I'm glad to hear someone with knowledge of Electron internals ran into it as well; I feel bad that I didn't file it as a bug, though.
If you're curious, the fix was here: https://github.com/atom/electron/issues/1968

It made it out into the regular release and I think it's fixed but TBH I haven't tested for a few months.

My work is all on GH here as well: https://github.com/orbitaljs There might be some synergy here between the projects.

Give me this but with Elixir and Im sold.
why elixir over rust? I'd assume rust makes more sense because you don't need gc
What is electron in this context? (The ex-atom maybe?)
Yes
Great idea. Also wonder if using Neon to speed up Electron could give a noticeable performance boost to Atom.
Why particularly with Electron?
Presumably because Electron needs to be hackable/customizable for lots of devs and performant for lots of workloads.