4 ms·
> Go has a minimal type system, and is able to do much of Google's internal server side work. Isn't it stil mostly Java and C++? That's what I hear all the tim
by Zababa 5y ago
> Go has a minimal type system, and is able to do much of Google's internal server side work.
Isn't it stil mostly Java and C++? That's what I hear all the time here.
Also, I'm not sure what point you're trying to make. You start by saying that fascination with types systems is not useful in practice, and end with an example where it is useful (Rust). While Go can stick a GC to avoid most of the issues that Rust is trying to solve, it stil has to ship with a defer mechanism (no linear/affine types/RAII) and a data race detector.
- acchow 5y ago> Isn't it stil mostly Java and C++? That's what I hear all the time here. Go's type system is much weaker and less expressive than either Java's or C++'s. C++ in particular has parametric polymorphism, type constructors, and dependent types. Go has none of those.
- EdwardDiego 5y agoQuestion from genuine interest, how is Go's type system weaker than Java? Is it just the (until recently) missing generics. I know that casting to interface{} is the equivalent of casting to Object, but Go 1.18 should hopefully avoid most of that. Just wondering what else you're thinking of, asking as someone who knows Java well and Go okay.
- erik_seaberg 5y agoEverything is mutable. Builtin operators like assignment and equality are hardcoded and may behave badly for user-defined types. It doesn’t have subtypes; you can slice to an embedded value but can’t get from there back to the containing struct or its methods. It doesn’t have generic covariance and contravariance; you can’t decide whether a []Animal or a []Bulldog is acceptable in place of a []Dog.
- skybrian 5y agoIt's been a while since I worked there, but the trend at Google at the time was that the amount of code written in each popular language was rapidly growing, and the number of popular languages was also slowly growing. (Despite a lot of resistance to introducing new languages.) I'm out of touch, but I would expect that there is a lot more Go code by now, and it also didn't catch up with C++ or Java.
- hiptobecubic 5y agoThis is pretty accurate I would say. Although, Go is more popular outside of Google than inside it and the original dream of "Replace all Python and most C++ and Java with Go" is laughably dead. Google used to require SRE teams to explain why they weren't using Go for new projects and they abandoned that because it was ridiculous and no one took it seriously. There are quite a few internal projects written in Go, but it feels like any time one of them gets big enough to matter, someone ends up reimplementing the important parts in C++ for performance reasons.
- sanderjd 5y agoGo has definitely gained more mindshare more quickly outside Google than inside, in my experience.