| ▲ | piinbinary 2 hours ago |
| This makes me want to find a side project for an excuse to give Go another try (I last used it professionally pre-generics). I do still wish it had discriminated unions (algebraic data types) and some better error handling ergonomics. |
|
| ▲ | ainar-g 2 hours ago | parent | next [-] |
| Re unions: https://github.com/golang/go/issues/76920 You might want to follow this proposal, if you aren't already. It's the most recent one, and it's supported by quite a few “core members” of the Go Team. I don't think it'll land in 1.28, but I like the fact that it's still a feature that's being actively discussed. |
|
| ▲ | codegeek 2 hours ago | parent | prev | next [-] |
| Do it. It is just a beautiful language to write and much simpler to pickup than many others. I am a fan boy of course but I love Go. |
| |
| ▲ | osigurdson an hour ago | parent [-] | | Go is extremely easy to pickup. If you know any language you probably know Go already for the most part (channels notwithstanding). I wouldn't say it is a "beautiful" language however. Though that is in the eye of the beholder, I don't think the Go designers were even really going for beauty. | | |
| ▲ | fragmede an hour ago | parent [-] | | They were going for readability. You can make some impossible to read code with C++ because the programmer was too clever, and the designers of golang wanted to avoid that. |
|
|
|
| ▲ | Splizard 2 hours ago | parent | prev [-] |
| Tagged unions can be implemented in user code, you dont actually need language support to use them. https://github.com/splizard/tagged |
| |
| ▲ | mirashii 2 hours ago | parent | next [-] | | This is only a small piece of the story for what people say when they want tagged unions. Without all of the ancillary support in the language, like exhaustive pattern matching, it really doesn't count. | | | |
| ▲ | kccqzy 24 minutes ago | parent | prev | next [-] | | The C++ committee said the same thing, and gave us std::variant. They are painful to work with and do not really deliver most of the benefits people want. | |
| ▲ | shhsshs an hour ago | parent | prev [-] | | That is a LOT of code (very ugly code, I would add) that could be replaced by `type Float = float32 | float64` in a language with actual support for union types. | | |
| ▲ | kccqzy 22 minutes ago | parent [-] | | Tagged unions are not union types. A union type is a supertype for any arbitrary collection of types, but a tagged union is a single type with multiple data constructors, and does not require subtyping to be implemented. |
|
|