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

Performance is not the main problem with interface{}.


Indeed, but I think if they REALLY don't want to change the Go language, an officially blessed std library of "go generate"-able collections and algorithms would be an ok workaround for private use inside a package. It's extra work for the users, but you'd get widely-used, widely-tested, type-safe collections. The main problem would be interoperability when two packages independently generate an RBTree<int64,string> that Go thinks are different types.


Right, but it's a problem tagged-unions solve.




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

Search: