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

Good? It's an ugly hack with limited functionality (due to Go's design, not the developers' skill and good will). A good solution would be forking the reference compiler and doing a proper implementation.


The library is Go. What you're suggesting seems to be extending Go so that it becomes some other language derived from Go. Extending Go might make for a cleaner and/or better generics solution but if you have to have customized compiler to run the code then you're no longer running Go.


It would be like Java to the Pizza Language: http://en.wikipedia.org/wiki/Pizza_%28programming_language%2...


Historical tidbit: Pizza is the precursor to Java's own generics implementation (introduced in Java 5), both were written by Martin Odersky who then went on to create Scala.



- Generics (aka Parametric polymorphism) - Function pointers (aka First-class functions) - Class cases and pattern matching (aka Algebraic types)

13 years, and only it's three features has made it into Java

I wish Sun found a way to transfer the Java trademark to Odersky before dying. Scala has so many nice features that companies prohibit because the language isn't called "Java".


I'm interested in Go but haven't looked into it yet. The fact that we're even talking about "generics" makes me nervous about further exploring it. Generic collections that have clean, dry implementations seem to be pretty much a requirement for new programming languages, in the way that core support for hashes is.


I think if he gets something good enough that Go devs like, then some form of it might very well be rolled into the compiler itself.




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

Search: