4 ms·
Fwiw it can compete in a lot of areas to a lot of languages. It doesn't represent a need to replace, say NodeJS or Python with Rust, because those languages don
by adkadskhj 5y ago
Fwiw it can compete in a lot of areas to a lot of languages. It doesn't represent a need to replace, say NodeJS or Python with Rust, because those languages don't typically have safety issues. However Rust offers low-level benefits with many high-level abstractions. It has lower level features, like generics, so the toolbag is definitely big - but that doesn't mean you always have to use the huge toolbag.
I switched from Go because i wanted more language features. Rust isn't a competitor to Go imo, but indirectly it was for me. I never use C, and while i could use C++, i ultimately wanted a good dev UX. I chose Rust for my developer experience, not because it was a "better C/C++", of which i don't need.
- Zababa 5y agoI've heard this opinion a lot, so I'm curious about it. What makes you prefer Rust to Go? (edit: It's not just about Rust vs Go but Rust vs everything else, mostly GC'd languages when you can afford the performance hit). My intuition would be the type system, as Rust is currently the most popular ML-derivative. The compiler and rust-analyzer are also very nice to use.
- adkadskhj 5y agoFor me it was things that aided user(dev) experience, and that was primarily things like iterators, enums, and functional patterns like maps (in the robust stdlib), good crate ecosystem. That made a huge DX improvement for me because it was just so applicable in so many scenarios. And to top it all off, i got the DX of things like Iterators with usually zero usability hit - Iterators themselves are fairly complex, at least in the generic param context, but Rust encapsulates that complexity so well that you rarely see it. You just Iterate and gloss over the fact that it's actually really complex.
- Zababa 5y agoWe share the same experience then! Right now I'm investing some time into OCaml to see if it could be the "GC'd Rust" that I'm looking for, but I'm having a harder time starting out than with Rust.
- adkadskhj 5y agoCurious, why do you want a GC'd Rust? I imagine there's something about Rust that you feel would be improved with a GC?
- Zababa 5y agoI like not having to think about lifetimes and ownership when I'm building a tree for example, and for most of what I do I can afford the performance hit.
- adkadskhj 5y agoIs there a reason you'd not just throw RC-like solutions on it? Ie the GC is basically going to employ a handful of techniques with overhead like RC, memory Arenas, etc - which you could also use in Rust. So i imagine you know this, is it the syntax you're trying to avoid? Ie wrapping a lot of things in RC's is annoying?
- Zababa 5y agoA few reasons. Like you said, syntax, wrapping and unwrapping is annoying. Also, RC doesn't cover cases with cyclic references. I think the difference is that for me GC is the default. For me, you need a good reason to not use a GC. Moderns GCs are very, very good and like I said I'd need a good reason to not use it. That's personal though, and I understand that not everyone agrees.
- adkadskhj 5y agoYea, i can see that. As much as i dislike Go these days, their GC is impressive as hell. I can imagine future GC's will learn a lot from Go.
- erik_seaberg 5y agoHas it improved? Last I heard Java’s tunable GCs still have much better throughput, while Go allows stack allocation more often. (Yes, GC tuning is painful, but better than rewriting code hoping you might end up with the same behavior.)
- scrubs 5y agoIs my code I/O bound? Does it have no/easy SLA? Does it fall well within the send payload, transform payload, send payload to another service or DB flow ... and provided it's along these lines not running into the zillions of iterations per second GO is ideal ... there's been lots of whining about GO not have generics. As we use a lot of JSON I don't care plus it's coming anyway. Now if we get into serious SLA or latency issues, I'll move from GO into RUST. Either way we avoid C/C++. Gotta like that.