4 ms·
> “Rust, from what I've heard, has a similar abstraction level as TypeScript, perhaps even closer to Haskell but that's good, I could do with a bit more help fr
by pavlov 1y ago
> “Rust, from what I've heard, has a similar abstraction level as TypeScript, perhaps even closer to Haskell but that's good, I could do with a bit more help from the compiler. But it requires me to manage memory and lifetimes, which I think is something the compiler should do for me.”
The Rust compiler does manage memory and lifetimes. It just manages them statically at compile-time. If your code can’t be guaranteed to be memory-safe under Rust’s rules, it won’t compile and you need to change it.
- PartiallyTyped 1y agoYou can use runtime ownership structures like ref cells, arcs, etc as well.
- pavlov 1y agoSure. The part that people often complain about is that they have to make these decisions, rather than having a runtime default picked for them by the language.
- PartiallyTyped 1y agoIsn’t that having your cake and eating it too? Like if you find the performance penalty acceptable, use an RC, and you have imho a better swift.
- pavlov 1y agoI agree! As an Objective-C veteran, I feel a lot of people overthink these decisions. You can write highly performant applications with prevalent reference counting, and Rust lets you optimize where it actually counts.