Conversation

Go has GC and Rust doesn't. If you were to design an explicitly C-like language with memory safety and without GC, it would look a lot more like Rust than Go. The idea that Rust was designed by a bunch of C++ fans is absurd. Most of us were ML fans more than anything. t.co/SWJhLJptY3
This Tweet is unavailable.
3
238
This Tweet was deleted by the Tweet author. Learn more
The issue is that generics are basically a requirement for memory safety without GC as Rust does it. Otherwise you can't create safe abstractions, which would mean that every time you want a linked list you have to write unsafe code. That would undermine memory safety.
2
15
Replying to and
How do you write a function receiving a slice like &[Type] and returning a reference to the initial value as &Type if you don't have generics? It needs to be generic based on the lifetime of the reference even if Type is a specific type rather than a generic type parameter.
2
1
In order for the language to be usable, you need a way to write code that's generic across different lifetimes along with a way to express which lifetime something is based on for non-trivial cases where the language can implicitly infer what is meant. It's still generic though.