3 ms·
>My reply is intrinsically in the domain of scientific code. It is not intended to make sense in the general context. If I'm being honest with myself, I too ha
by omginternets 10y ago
>My reply is intrinsically in the domain of scientific code. It is not intended to make sense in the general context.
If I'm being honest with myself, I too have serious reservations about the extent to which Go is suited for scientific computation.
> I recommend jumping in the deep end and learning Haskell for what strong type systems can guarantee.
I'm superficially familiar with Haskell's typeclass system, but respectfully, this misses my point. What use is such a system in the context of scientific computing, or in the context of Go's mission?
I understand that there are type systems with stronger guarantees, but again, Go is not Haskell. Go is not Rust. Go is not solving these problems. My question is, in practice, what features of a type system are "these people" (the ones complaining about Go's type system -- I don't presume to label you, jerf, as one of them) pining for?
My (respectful) exasperation stems from the fact that these arguments usually compile down to something roughly equivalent to "Rust exists so why is Go not Rust? (Or Haskell)".
>I take the tradeoff because in the context I'm working, the simplicity of code tends to win out even so.
But this is exactly my point. At some point, adding features to the type-system is going to reduce the simplicity you enjoy in the context of problems for which Go was engineered. I appreciate that (to quote your linked comment) "the further away from a 'network server' you get, the less appealing Go gets", and that every success story you encounter with Go involves network servers. Moreover, I agree. Go nails this particular problem space, and I contend that this is in part because of the fast-and-loose design of its type system. We are in agreement with respect to Go's problem domain, and we are in agreement with respect to the fact that Go should not be viewed as a general-purpose concurrency language. These points, however, do not address the question of its type system.
So again: what more do you want this type system to do in the context of writing network servers? Which specific features from Haskell do you find yourself wanting, and what guarantee do we have that this would not undermine the simplicity and dynamic-i-ness that has made Go successful as a plumbing language?
>That said, I tend to consider scientific programming one of those, and a burgeoning community seems intent on proving me wrong, so shrug.
I'm inclined to agree with the caveat that certain disciplines (molecular bio and genetics for instance) increasingly rely on high-throughput streams of data. Perhaps Go is well-suited to the pipework, and perhaps it's advantageous to perform simple data transforms natively prior to doing the heavy lifting in Python or Julia ... I nevertheless remain unconvinced.
- jerf 10y ago"I'm superficially familiar with Haskell's typeclass system, but respectfully, this misses my point." I suggest becoming more than superficially familiar, then. With all due respect, I believe your core problem is that you do not understand what advanced type systems can do, so it's a mystery to you why anybody would want them, and the only cure for that is to go learn. Again, let me emphasize, I do not mean this to be mean, but sometimes there's just no way around the problem in an HN-post sized reply. I know one recurring thing I've encountered is that I'd love to be able to say that in type Something interface { DoWhatever() Something } that the return result of DoWhatever is guaranteed to be the same type as the thing you called it on. I'd love to be able to guarantee that if I have a container and a contained type that I can associate the two things together (i.e., I have a "Game" and "Move" interfaces and I'd like to associate specific Game implementations to specific Move implementations). I'd like containers that don't wrap everything in interface{}, resulting in an inefficient representation that is also hard to use in the code. I'd like non-nillable pointers. On the balance I still use it for my job because the benefits outweigh the costs, but there are tradeoffs I make for it.
- omginternets 10y ago>I suggest becoming more than superficially familiar, then. It's a work in progress :) >With all due respect No offense taken > I know one recurring thing I've encountered is that I'd love to be able to say that in [...] that the return result of DoWhatever is guaranteed to be the same type as the thing you called it on Forgive me, but isn't this generics all over again, or am I missing something? And once more, is it possible to bake these features into the type system without requiring more boilerplate code? I like the idea of strong guarantees of a type system, but I worry about having to wrestle with the compiler. One of the things I really like about Go is that the type system provides guidance but I don't spend much time making the compiler accept things that I patently know are compatible (I'm looking at you, Rust).
- steveklabnik 10y agoI'd be interested in hearing more about your Rust pain here; we're working a lot on ergonomics and productivity.