News for hackers. Stuff that matters.
Re:Operator constraints in Go by dinosaurdynasty on Monday May 23, 2022 @04:23PM (#31484367)
Rust handles this in a "correct", if annoying way: the stdlib sort requires its elements to have a "totally ordered" trait, and floating point doesn't have that trait. You have to either give a custom comparison function, or use a "non-NaN and totally orderable floating point" type some non-stdlib crates have.
Re:Operator constraints in Go by majewsky on Tuesday May 24, 2022 @07:39AM (#31490733)
This perfectly illustrates the cultural difference between Rust and Go: Rust wants to be "correct", Go wants to be "good enough".