Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Looks like Go is cleaning up. Love the language, but I won't commit to writing heavy-duty code in it until it either has sensible union support or sensible generic support. The type system is just too weak right now.


I actually thought that to start with but when you get used to the frankly wierd type system, it actually works extremely well without generics (bear in mind I use C# which is heavily generic programming). When you approach the problems with a Go mindset, I don't think I've found a single case that needed generic types.

I'm not sure of the value of unions now or ever as it brings what is effectively a compiler decision into user space and allows very unsafe, architecture dependent code to be accidentally written.


Discriminated unions are neither architecture-dependent nor unsafe.


A "tagged union" which is what I assume you mean is usually abstracted as a native type (struct) in other langauges (Go included). C gives you architecture level access to it. Go leaves it to the VM to decide.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: