News for hackers. Stuff that matters.
Re:Unusual basis types in programming languages by nyanpasu64 on Wednesday January 17, 2024 @10:07PM (#39037161)
Are union/sum types another "basis"? Some languages include syntax for them at the level of structs, others require they be painfully hacked together out of libraries and template metaprogramming (std::variant, though bare unions exist without carrying a tag).
Re:Unusual basis types in programming languages by jetsetsushi on Thursday January 18, 2024 @12:45AM (#39038363)
If lists and structures are basis then sum should be too.
Re:Unusual basis types in programming languages by mayoff on Thursday January 18, 2024 @11:54PM (#39051686)
I also thought this was a major omission. After using languages with well-supported sum types (mainly Swift and Elm), I find it painful to go back to languages that lack native support.