9 ms·
Seriously. I think Rust has a lot going for it, but I will say this: the type inference in Rust combined with its expressive type system can make sophisticated
by enneff 4y ago
Seriously. I think Rust has a lot going for it, but I will say this: the type inference in Rust combined with its expressive type system can make sophisticated programs very hard to follow. My experience was with extensively reading the cargo codebase; trying to figure out what the resulting type of an expression that maps/filters/collects over other complex expressions is a chore.
For example, I find it very hard to figure out what the type of public_dependencies is in this declaration: https://github.com/rust-lang/cargo/blob/8fbc8459d59f3acecdb6132fe6f4f2c0b3edbc47/src/cargo/core/resolver/resolve.rs#L97 https://github.com/rust-lang/cargo/blob/8fbc8459d59f3acecdb6...
This is the same kind of thing that makes JavaScript challenging to read. It requires a lot of discipline on the author’s part to make it clear what is going on, and even the best of us lack discipline at scale.
- Gwypaas 4y agoSimply looking at the Resolve struct definition tells you. /// A map from packages to a set of their public dependencies public_dependencies: HashMap<PackageId, HashSet<PackageId>>, I do agree with you that Rust is easier to read in an IDE though, since then those types gets autoresolved and hinted inline for you.