Re:11 year old unsoundness bugs found in Rust borrow checker
by foldr on Tuesday October 13, 2026 @10:57AM
(#50072748)
C++ still doesn't have a sane modern pattern for tagged unions. If you want to define a type to represent, say, a simple parse tree, then Rust makes that easy and obvious, whereas C++ offers you a hundred options, all of which suck.
[ Parent
| on HN ]
Re:11 year old unsoundness bugs found in Rust borrow checker
by sltkr on Tuesday October 13, 2026 @01:26PM
(#50075385)
Isn't the obvious choice std::variant<>?
It is kind of annoying to use, but at least there is an obvious default choice.
Re:11 year old unsoundness bugs found in Rust borrow checker
by foldr on Tuesday October 13, 2026 @01:59PM
(#50075913)
I take your point about it being the default, but IMO std::variant is pretty much unusable for a parse tree. It could work for small unions that you visit once in a while, but traversing a nested tree of std::variant types is just a disaster. It somehow manages to be comprehensively worse than using manually tagged unions in all aspects except safety.