4 ms·
Rust is sacrificing a lot for the sake of memory safety without garbage collection. The whole language is in some ways an experiment as to whether modern langua
by lmm 12y ago
Rust is sacrificing a lot for the sake of memory safety without garbage collection. The whole language is in some ways an experiment as to whether modern language design can ameliorate the costs of doing that. But for the kind of problem where Go would even be in the running, you don't need to pay those costs - maybe OCaml (or even Haskell) would deliver the benefits you want, without the complexity costs?
- TheHydroImpulse 12y agoAfter a while, the mental cost associated with Rust isn't that huge. Rust becomes a fairly productive language (even if it has some rough edges). I will say, however, that how you think of programming and structuring your application is very different from other languages. Especially when it comes to multi-threaded applications and how you deal with ownership and safety. But in the end, I think it pays off pretty well.
- lmm 12y agoHave you compared with OCaml or something like it (maybe even Haskell)? My feeling is that the overhead in Rust is lower than you might think, but it didn't seem like it would ever go away completely. But I didn't get ever so far into it.
- bjz_ 12y agoI feel like I'm actually offloading lots of my cognitive overhead to the compiler compared to all the things I need to juggle mentally when working in C or C++. It's a relief rather than a burden. I still sometimes curse the borrow checker in the moment, but I know that the quality of the resulting code is worth it. Figuring out the puzzle up front is much more enjoyable than tracking down intermittent segfaults down the road.
- lmm 12y ago> I feel like I'm actually offloading lots of my cognitive overhead to the compiler compared to all the things I need to juggle mentally when working in C or C++. It's a relief rather than a burden. Sure, but I feel like Haskell is the same thing only more so. And the invariants you keep track of - does this function access the database? could this function error? which audit events might happen in this codepath? - are IMO more useful than in Rust, where you spend the same effort tracking memory ownership. Which, sure, if you need it better to have a compiler that can help you with it, but getting good performance without it is easier than many people seem to think.