3 ms·
What do you think is nicer about Rust's type system? IMO Rust's type system is more principled but does much less for you, and so is more annoying to use. As a
by millstone 7y ago
What do you think is nicer about Rust's type system?
IMO Rust's type system is more principled but does much less for you, and so is more annoying to use. As a simple example, incrementing a reference count in Rust requires a clone() call; in Swift this happens automatically.
- jasonhansel 7y agoLast time I checked out Swift, I ran into some annoying issues with type erasure and generic protocols (similar to the issues Java has, where one class can't be both Iterable<Integer> and Iterable<String>). I also find Swift's "inout" params deeply confusing (especially when aliasing is involved), and I wish it made dynamic dispatch more explicit (like Rust).
- millstone 7y agoWhat would e.g. `view.superview` look like in Rust though? That seems to be the main sticking point. In UI programming it is common to walk up, down, and around the view hierarchy.
- jasonhansel 7y agoI actually think that allowing this sort of traversal is usually a bad thing, but it can always be solved with Rc<T> and Weak<T> in Rust.