3 ms·
This is one of two main complaints I have with Go[0], which I've used professionally for the last six months or so. There have been several times when I've thou
by mratzloff 13y ago
This is one of two main complaints I have with Go[0], which I've used professionally for the last six months or so. There have been several times when I've thought "if only I had generics..."
Instead I either have to use interfaces and casts (run-time when I would prefer compile-time) or write separate functions for each type (I wrote a Cartesian product library that abstracts the math involved to indexes and lengths, then requires a simple type-specific wrapper simply because of this silly language gap).
Despite that, I still really love Go.
[0] The other being that 1.2 randomly segfaults on my code base during compilation whereas 1.1.2 works fine. For this reason I haven't yet been able to upgrade until I determine the cause.
- codygman 13y agoI wrote Go for about 6-8 months and having to do so much stuff run-time when I wanted the guarantees of compile-time started grating on me along with generics and the type system being stringly typed. I found Haskell shortly thereafter and that is where I currently stay ;)
- mratzloff 13y agoWell, I wouldn't say I have to do "so much" run-time, only when I'd like to write a generic library, and in that case I make a judgment call whether I want to write type-specific functions or type casts. When I absolutely have to, I just apply C polymorphism techniques. Stringly-typed in what sense?