7 ms·
Elixir and Ruby can talk to each other using Erlix
- pmontra 10y agoInteresting. Any real world application this has been used for?
- mackdaddysly 10y agoI wonder what the benefits of this approach is to say, a json driven microservice between elixir and ruby?
- davidw 10y agoProbably faster and more direct and less fiddling around with encoding stuff in JSON. I'm pretty sure both Ruby and Erlang have richer types than JSON.
- sjtgraham 10y agoRunning your applications in Erlang is its own microservices architecture. Each process is essentially microservice that can interact with others on any node in your cluster by sending messages. Everything is handled for your by the runtime. Processes on a different node? No problem, they're easy to discover and if a message does go to another node the serialization is handled for you. Erlang is so powerful I'd actually invert your question.
- dfischer 10y agoI hesitate using Erlang/elixir for this than aws lambda + event distribution. Any thoughts?
- vikiomega9 10y agoIsn't aws lambda better suited for short running tasks?
- dfischer 10y agoWhat's a long running task?
- vikiomega9 10y agoI think heuristic is running time of about 5 or 10 minutes.
- abritinthebay 10y agoIf you don't need low latency and are ok with the extra architectural overhead... there's nothing wrong with that. Different use cases
- dfischer 10y agoMany are preaching erlang/elixir on the OTP/microservice alternative paradigm – that doesn't seem as attractive as the low latency resiliency. At least to me, as a story.
- abritinthebay 10y agoWell... it's a win for both. It means it's easy to write performant and highly concurrent microservices. Latency is part of that.
- deleted 10y ago[deleted]
- dakull 10y ago>the Erlang node, witch is connected to Erlang VM over the network. Witches are connected to the BEAM? :) funny typo.
- Cyph0n 10y agoWell, BEAM is somewhat magical, so... Freudian slip?
- 15155 10y agoI would like to see a DRB <-> Erlang C Node (but in Ruby) system. Start Ruby process, get Erlang node.
- mmartinson 10y agoI'd be curious to see if this becomes viable as an interface wrapper for teams that writing new services in Elixir while supporting important pieces of legacy Ruby code. This seems to be the situation in a lot of Ruby shops, and it would be fantastic to see someone getting this working at a big scale and seeing some industry best practices emerge.
- enraged_camel 10y agoYeah, in the most recent Who Is Hiring post, every mention of Elixir also mentioned Ruby somewhere, usually in the context you described.
- sjtgraham 10y agoMost of those postings seem like Ruby shops that have pipe dreams of doing Elixir stuff, some day. I'm skeptical many will get there, which is a shame because Elixir is the most fun I've had writing software.
- tyre 10y agoWe started in Ruby and have moved to Elixir (not a pipe dream!). If you have an SOA already, adding Elixir isn't a big hurdle. Experienced engineers can pick it up super quickly. I agree it is incredibly fun! All of the hard work put into BEAM plus the easy-of-use of Ruby and the joys of functional programming make for a wonderful developer experience.
- mmartinson 10y agoYa I've actually seen a number a few shops making real moves in that direction, at least here in Vancouver. The OSS ecosystem is obviously pretty immature but I think it's getting good enough that it's starting to seem like a pretty viable option.
- dakull 10y agoIndeed, it seems Elixir is one part complementary to Ruby and the other a great replacement whilst also keeping the main tenets of Ruby in-place. The only issue so far is that the libraries ecosystem is indeed quite young but that is natural. Still, Ruby (even without Rails) is at the moment a more productive environment. I really hope Ruby "3x3" [0] will be released soon enough and projects like Hanami [1] become production ready so that it can coexist in a complementary way rather than becoming replaceable. [0] - https://blog.heroku.com/ruby-3-by-3 https://blog.heroku.com/ruby-3-by-3 [1] - http://hanamirb.org http://hanamirb.org
- misterbowfinger 10y agoInteresting - makes me think of ErRuby: https://github.com/johnlinvc/erruby https://github.com/johnlinvc/erruby Like JRuby, but s/Java/Erlang.
- poorman 10y agoI don't see any practical use for this. You're just sending text around. This breaks most OTP conventions, you lose insight from the Observer, etc.. If all you want is message passing you should just use something like zeromq which would allow for a lot more than just Elixir to Ruby.
- davidw 10y ago> You're just sending text around. Unless I'm mistaken, it's using Erlang's distribution protocol, which is not 'just text'. http://erlang.org/doc/apps/erts/erl_dist_protocol.html http://erlang.org/doc/apps/erts/erl_dist_protocol.html As to whether some other form of sharing data between Ruby and Erlang is more appropriate, I'm sure it depends entirely on the application. At $current_job - 1 we used the Java/Erlang libs to let Android and Erlang talk, and it worked pretty well. We did not need other systems to access the same data, or the additional overhead an extra piece of software would have required.
- poorman 10y agoAh, I see this now: https://github.com/KDr2/erlix#about-the-class-erlixmessage https://github.com/KDr2/erlix#about-the-class-erlixmessage. So I guess it is handling encoding. P.S. zeromq doesn't require you to run another system, it's just a lib.
- davidw 10y agoWell, yeah, 'just' an extra lib with its own encoding and decoding. If your system as a whole revolves around Erlang, it's a fine choice for a protocol. Other times, something more 'standard' that lots of disparate pieces can talk to is better. Totally something to be decided by whoever is building it.
- vertex-four 10y agoWhile it's just a lib, it does implement an alternative networking system to the one you're using everywhere else in Erlang, which requires different ways of interacting with it and different knowledge of all the fun edge cases.
- amorphid 10y agoIs this more or less useful than C bindings in either language?
- SnippyBoons 10y agoI thought Elixir was already able to talk to Ruby (and other languages) through it's built in Port module? http://elixir-lang.org/docs/stable/elixir/Port.html http://elixir-lang.org/docs/stable/elixir/Port.html
- ZmyWTR 10y agoCool, should be very useful...thanks for posting!
- dfischer 10y agoWith aws lambda elixir is less attractive to me. I wonder if anyone has similar thoughts?
- gamache 10y agoAt Appcues, we use a combination of both approaches. We have our Elixir backend where we need some combination of: - Low latency -- Lambda + API Gateway requests typically incur a ~200ms invocation latency - Persistent connections, e.g. WebSockets - High performance - Continuous usage, let's say at least ten calls per second all day every day forever For everything else, Lambda and API Gateway have been fantastic, even without a framework like Serverless. It's so cheap! It's so convenient! It's so reliable-enough! But we couldn't get along on a 100% Lambda backend, far from it.
- dfischer 10y agoI agree with this a lot. Especially on the web socket front. I've been thinking of an ideal structure for this. I haven't decided between elixir or bet in with Google and Firebase.
- gamache 10y agoFor what it's worth: we use Firebase in our stack too, but at this point it's confined to our customer-facing dashboard (as opposed to our end-user-facing service). I don't like it when my critical systems depend on services out of my control, especially when those services go down for hours or days at a time -- as Firebase DB has done twice in the last year, for us.