4 ms·
So Rust does not include built in abstractions/frameworks for building distributed systems, but I count that as a good thing. OTP can scale well under certain c
by ilovecaching 8y ago
So Rust does not include built in abstractions/frameworks for building distributed systems, but I count that as a good thing. OTP can scale well under certain conditions. But it can also require rewriting supervision, servers, and other core pieces of OTP, which is a huge pain. BIFs can be slow or have wonky behavior, NIFs are dangerous but necessary when Erlang is too slow. When a language gives you prebuilt abstractions it can be a really good thing if they're the abstractions you need, and really bad if your requirements don't line up well, or you're coloring outside the lines in terms of scale or design. It can also be painful to introspect the BEAM to collect metrics and understand message queue pressure on a node. I'm so glad I get to work on Erlang rather than many of the other toolkits that are out there for building big distributed backend systems, but if I was going to start over again it were my choice I would choose Rust and build the right abstractions, the right protocols, and have total control over my system to make tailored performance trade-offs, and do it in a type safe environment, or I would use a third party distributed systems library like bifrost if my project was small. When I said all the things that make Erlang great, I mean pattern matching, FP, a focus on safety and reliability, and a really knowledgeable community. I'm kind of over BEAM/OTP at this point, but that's just my opinion, for the projects I'm working on.
- mledu 8y agoCouldn't you use Erlang/OTP for the main parts of the system and for the performance critical parts that Erlang isn't great for (like crunching numbers) you can use something like Rustler to be build a safer NIF? https://github.com/hansihe/rustler https://github.com/hansihe/rustler
- ilovecaching 8y agoInteresting! I haven't seen this, but it looks really exciting. I may have to bring this up at work!
- RussianCow 8y agoIt sounds like you just don't like BEAM/OTP, then. :) I don't know if I would make a sweeping recommendation for Rust as an alternative to Erlang based on that, though, as I would imagine it would take a TON of work to replicate OTP in Rust.
- ilovecaching 8y agoI guess I'm just looking partly for something different. I've been doing Erlang for a few years now, and it's just the devil I know. :) I think Rust could really take off with more support, but I think Erlang will always be niche. I'd rather see people write more Rust.