4 ms·
> the friction is coming from the fact that Rust can't be changed any more so that it becomes as ergonomic as other languages people are used to. What is your
by pcwalton 8y ago
> the friction is coming from the fact that Rust can't be changed any more so that it becomes as ergonomic as other languages people are used to.
What is your proposal, specifically?
It's not that we weren't listening to C++ programmers 10 years ago. We put a ton of effort into making Rust as easy to use as possible. Rather, it's that the problem of memory safety without GC is fundamentally hard. If I could wave a magic wand and release an incompatible Rust 2.0 with memory safety and no new concepts to learn over C++, I'd do it. But it's easy to just say you want a new language. It's a lot harder to actually design such a thing.
I generally think that if you want memory safety, you must either have a garbage collector or the mutability rules and borrow check. There is no other option.
- dan-robertson 8y agoDo you think it was obvious that such mutability rules and borrow checks were sufficient before languages like rust were invented? What about a more impractical approach like e.g. ATS?
- tombert 8y agoSpeaking out of genuine ignorance here...if the only ways to get memory safety without GC, how does Swift or Objective C do it with ARC?
- deleted 8y ago[deleted]
- littlestymaar 8y agoArc is a kind of automatic memory management that's included when people talk about GC in general.
- pcwalton 8y agoReference counting is a form of garbage collection.
- tombert 8y agoYes but this is done at compile-time, not runtime, isn't it? EDIT: Upon reading some stuff, apparently I am mistaken, and it's got runtime overhead. Silly me.
- steveklabnik 8y agoYou're not totally wrong; that's the "A" in ARC: Automatic. It automatically inserts code at compile time, but that code has a runtime effect.
- blub 8y agoMy only proposal is that the Rust community spends more time coding and less time criticising other languages and praising Rust. Making proposals about the ergonomics of Rust is way overdue, but I will note that jumping through even more hoops to get correct code is not progress, nor the huge victory that the Rust community hails it to be. Humans use compilers to do work for them, not vice versa. GC for example is brilliant, Swift is also quite nice. Even if neither solution is applicable, they are both excellent examples on how a user-friendly solution can look like - almost zero user effort.