News for hackers. Stuff that matters.
Re:Switching from C++ to Rust by paulddraper on Monday March 13, 2023 @07:20PM (#35144651)
Agreed. I don't have much Rust experience, but I do know Scala and Haskell and Typescript.

It's one of those patterns that just comes up again and again and it's wonderful when the language offers a good solution.

Re:Switching from C++ to Rust by auggierose on Monday March 13, 2023 @07:34PM (#35144843)
And I must say that Typescript has the most flexible variation of it. I remember a while ago (> 10 years) that somebody on Lambda the ultimate asked how to flexibly represent compiler intermediate representations using the Scala type system, given that there can be many of them with overlaps. These overlaps are not a problem at all in Typescript.
Re:Switching from C++ to Rust by paulddraper on Monday March 13, 2023 @07:39PM (#35144914)
Typescript has discriminated unions, which are amazingly nice