The Generic Dilemma in Go
research.swtch.com
The Generic Dilemma in Go
1–10 of 26 posts
Re: The Generic Dilemma in Go
#2Re: The Generic Dilemma in Go
#3Re: The Generic Dilemma in Go
#4Where does the Haskell type system fit into his description?
Re: The Generic Dilemma in Go
#5Where does the Haskell type system fit into his description?
http://www.haskell.org/haskellwiki/Research_papers/Generics
In the simplest case, generic programming in Haskell is done using type classes (similar to OO "interfaces"), often with the GHC extension for derivable type classes. If I understand correctly, this is generally implemented by implicitly passing a table of type information to the generic function at runtime, though I believe that compilers are able to optimize this away at compile time in some (most?) cases.
I'm not sure how well any of this would apply to Go, which doesn't have Haskell's type system.
Re: The Generic Dilemma in Go
#6Re: The Generic Dilemma in Go
#7It was my understanding that the Go language is still a moving target; the something closer to the final language spec should be known before discussing what it is missing.
Re: The Generic Dilemma in Go
#8Where does the Haskell type system fit into his description?
If you ever use GHC, you'll notice how slowly it compiles. However, this dilemma (trilemma?) is a false one. You can have unboxed (in relevant cases) generics in a language that compiles faster than C++ with full-blown templates. C# and Ada come to mind.