3 ms·
Out of curiosity, in what ways is Rust that much less uglier than C++? I've only looked through the docs and the code provided and it seems to be riddled with t
by mden 13y ago
Out of curiosity, in what ways is Rust that much less uglier than C++? I've only looked through the docs and the code provided and it seems to be riddled with the same type of "ugliness" inherent to C++ - namely the ugliness symbolized by the need for all of the special characters like * and &. It seems like Rust has some nice syntax for pattern matching, but what else?
- nnethercote 13y agoYou're only thinking about syntax. Look deeper.
- evincarofautumn 13y agoSyntax is undoubtedly important, but primarily as a means of elegantly expressing the unique semantics of a language. The visible ugliness is the language being explicit about low-level details. So what else? Rust isn’t a huge innovation in terms of language features, but it does take advantage of relatively recent advances in language design (e.g. typeclasses) and has an excellent combination of defaults. The important ones are memory safety, an ownership model (think unique_ptr/shared_ptr), immutability, and isolated lightweight threads.
- mercurial 13y agoWell, it also handles lifetimes, which is certainly a huge improvement in terms of safety, though it comes at, shall we say, syntactic cost: pub fn to_rigid_body_or_fail<'r>(&'r self) -> &'r RigidBody<N, LV, AV, M, II> {