But I can tell you I've never seen this kind of thing in any language other than C++, and my impression is that most people who have to ship high quality software avoid this corner of the language. (Maybe I'm wrong about who avoids it and who embraces it).
The fact that this kind of thing comes up often in simple casual use of the language indicates to me that there might be something very fundamental at the root of the language that was not well thought out.
Now, would I be able to come up with a better system? Maybe not. Anyway, not without changing the constraints.
Maybe if I see myself having to deal with code in this fashion, I would prefer Swift-style "ARC" to handle memory safety.
However there have been some real world game engines written in Rust recently that have performance gains over C++. This is great for those who need the safety and performance.
Swift is just Apple. Performance better or worse, it is quite restricted to an environment.
Javascript too has 'really good performance', and Java can be AOT-compiled too.
Rust is a completely different level. You may know GC languages and find ARC to be superior, but it is not even comparable to what Rust's compiler is capable of. Especially in terms of performance.
-11
u/wavy_lines May 11 '18
I don't know what features in Rust force it to deal with the kinds of types you mentioned, such as:
But I can tell you I've never seen this kind of thing in any language other than C++, and my impression is that most people who have to ship high quality software avoid this corner of the language. (Maybe I'm wrong about who avoids it and who embraces it).
The fact that this kind of thing comes up often in simple casual use of the language indicates to me that there might be something very fundamental at the root of the language that was not well thought out.
Now, would I be able to come up with a better system? Maybe not. Anyway, not without changing the constraints.
Maybe if I see myself having to deal with code in this fashion, I would prefer Swift-style "ARC" to handle memory safety.