3 ms·
So I am very fascinated by both languages and work in Elixir professionally, with a pretty minimal knowledge of Rust. I was just wondering what the motivation f
by jowi-dev 6y ago
So I am very fascinated by both languages and work in Elixir professionally, with a pretty minimal knowledge of Rust. I was just wondering what the motivation for creating this project was rather than just writing the application in Elixir with NIFs in Rust whenever higher performance is needed?
- bkolobara 6y agoIf a NIF fails it takes down the whole Erlang VM, so you loose all guarantees that make Elixir great once you resort to NIFs. There are many other gotchas, like if you spend too much time inside the NIF it will affect the stability of your whole system. This is eliminated by some design choices taken by Lunatic. But as I mentioned in the blog, if you can use Elixir/Erlang do it! It's a great language and runtime.
- jowi-dev 6y agoVery interesting and good to know! I've been keeping a closer eye on Rust lately as its beginning to look more and more like it would be foolish to ignore. Rust and Go have really made it hard to conceptualize where Elixir fits into the dev world these days. Go just seems to be a faster Elixir in a lot of ways. I'll keep an eye on this project and if you need any help - feel free to tag me on github (same username as this one)
- dnautics 6y ago> Go just seems to be a faster Elixir in a lot of ways If you haven't worked with both, you just don't know. The developer experience in go is nowhere near the developer experience in Elixir. It's just so much easier to write scalable code in Elixir than Go. Sure it's not as fast, but it's not god-awful slow (speedwise, you're doing better than python django, for example), and for 90% of people shopping for what elixir and go offer, the network is the bottleneck.
- jowi-dev 6y agoI've only worked in Elixir. I think I just recently experienced some Go "fomo" because it seems to be more or less attempting to solve the same problem. I can't quite justify moving to Go from Elixir + Rust, but I'm always interested in hearing the community at-large take. Thanks for the response!
- dnautics 6y agoI've done both (Go first, actually), and I hated Go. And all of my dev friends who are still in goland have nothing but complaints. Small sample size (n ~ 3), but still.
- sdfin 6y agoI'd find it interesting to know what those complaints are about.
- FridgeSeal 6y agonot the person you're responding to, but this blog and blog post has some good, in-depth points: https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-ride https://fasterthanli.me/articles/i-want-off-mr-golangs-wild-...
- sdfin 6y agoThanks. After reading it, I wonder if the problems he mentions only occur in Go, or if they occur in most languages that are not Rust.
- dnautics 6y agoNone of these problems are problems in elixir or zig, the two langs I'm most familiar with currently (they are handled differently, of course).
- 6y ago
- rch 6y agoI haven't used it professionally, but it seems like the Rustler project mitigates some of the problems with NIFs. Is that an accurate impression?
- steveklabnik 6y agoYes, that is why Discord is doing it: https://blog.discord.com/using-rust-to-scale-elixir-for-11-million-concurrent-users-c6f19fc029d3 https://blog.discord.com/using-rust-to-scale-elixir-for-11-m...