Re:Why Discord is switching from Go to Rust
by xmprt on Tuesday February 04, 2020 @09:39PM
(#22243511)
Not comparing arrays longer than 32 elements by == sounds like a feature to me.
[ Parent
| on HN ]
Re:Why Discord is switching from Go to Rust
by millstone on Tuesday February 04, 2020 @10:02PM
(#22243631)
The 32-count cliff is not just for Eq - it also defeats niceties like Debug, Hash, Default. This isn't a deliberate design decision, it's due to a (current) limitation of Rust's value-type generics.
The point is to illustrate that when you WTF using Rust, sometimes it's not you, it really is Rust.
Re:Why Discord is switching from Go to Rust
by ElderKorihor on Tuesday February 04, 2020 @11:33PM
(#22244055)
I think there are a few places were Rust didn't get it quite right, but this seems like a weird example. The 32 length limit is a temporary limitation, not a corner that Rust is painted into. Indeed, my understanding is that the limitation at this point is being maintained artificially due to an overabundance of caution (via
https://doc.rust-lang.org/std/array/trait.LengthAtMost32.htm... ). That's not WTF, that's just TODO.