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
Generics and sum types are expected these days for productivity but with the focus on safety they become essential for usability for various reasons. It's very desirable for generics to specify the requirements for the types to specify the API properly and provide proper errors.
1
1
That leads to wanting a feature for specifying interfaces, i.e. type classes. So now you have generics, type classes and sum types as baseline features. Now, how do you implement closures in an efficient way, without forcing allocation or using them solely via generic functions?
1
Show replies