3 ms·
Golang gives you none of nice features of a modern language while being about the same performance tier as Scala or Java, so there's basically no reason not to
by ndriscoll 17d ago
Golang gives you none of nice features of a modern language while being about the same performance tier as Scala or Java, so there's basically no reason not to use Scala.
- eklavya 17d agoI ported a moderate sized java project to golang. Test suite runs order of magnitude faster now. There isn't much change in terms of the architecture. Pretty much the same algos and data structures. The whole dev tooling runs on a 16 gb mac without swapping now. I used vs code for both
- ndriscoll 17d agoIME they're both in a place where Rust is maybe ~40% faster for a decent CRUD web application server, but with go you need to write much lower level code to get there (e.g. using composable generic iterators will ruin your allocations, so it's all manual for loops). You can write idiomatic high level Scala and get the same performance. Which could be as simple as the go compiler offers no ability to force inlining and has way too low of a complexity threshold, but that basically makes reusable code unusable in high performance situations. The whole go team's philosophy tends to also revolve around assuming their users don't know what they're doing, which is annoying. Like an inline keyword: thinking you know better than me doesn't mean I'm not going to inline it; it means I'm going to manually write it inline myself in the code, and then think the language sucks because it's tedious, error-prone, and verbose. Or they tend to mark lots of stuff private for no reason, and e.g. with TLS 1.3 they just ignore your config because they think they know better, etc.
- jeffbee 17d agoIsn't this mostly about java cold start costs? It might be that other people are optimizing for steady-state performance, not transient startup performance.
- eklavya 17d agoOne particular test was running for 20 minutes, doing repetitive calculations, hopefully enough to get jitted. It finishes much much faster now. I could have profiled to check what was going on but the test was simple and the dev tooling and the ram usage was a major concern for me. Also gradle upgrades were painful. Java tooling taking up a lot of ram was a major motivation for me. I have done a lot of Scala as well. I don't think either Java or Scala in the real world beat go on performance for most cases. I don't doubt that in some cases jvm can do better but at least before Valhalla delivers all the promises, in real world, I am doubtful. I have been a Java/Scala user almost for the majority of my career. I doubt I would pick jvm over golang going forward though. Also not having to deal with OOP is a plus.
- gf000 16d agoSo you compare the build tool of A and B on a short-lived job type where java is knowingly not its strongest? How is that a meaningful comparison?
- eklavya 16d agoI am not sure I understand your point. It's a meaningful comparison based on my situation. But even if it isn't, what are you arguing for? I change my use case rather than the tool/lang? Sorry if I misunderstood.
- Thaxll 17d agoGolang is faster and use way less memory than Java, never wonder why you never see Kubernetes controller / sidecar is Java? As for Scala it's pretty much a dead language, no one work with it and it's impossible to find dev for it. 10 years ago I was moving Scala code back to regular Java.
- deleted 17d ago[deleted]
- weego 17d agoIt's sad - I spent a good 12 years writing Scala every day and it was the ideal language for my brain. Until it wasn't - sbt got too complex for it's own good, everything became "very smart" developers over-using implicit conversions, you couldn't find a project that wasn't an opinion war on cats vs whatever. It collapsed on the weight of it's own smugness. go and kotlin aren't it, gleam scratches the itch but I can't justify writing code that would impossible to hire for. scala situation is a real shame.
- ndriscoll 17d agoEvery job I've has has used different languages so I don't really understand the need to find a dev for a specific language. I went from network firmware in C to banking application servers in Scala and it took like 2 weeks to ramp up. Not a big deal. Now I write lower level networking stuff again in Go, which seems like its just worse than e.g. C-with-templates (and occasional classes) style C++ so I don't really understand why people like it. I think it used to be common to just look for smart people and assume they can run with whatever stack. Wasn't that the point of abstract algorithm questions etc. (basically an IQ test)?
- logicchains 17d ago>I think it used to be common to just look for smart people and assume they can run with whatever stack. Wasn't that the point of abstract algorithm questions etc. (basically an IQ test)? Lots of companies where software isn't the focus see it as a cost center, so they'd prefer to hire lower-IQ specialists instead of higher-IQ generalists, because the latter are more expensive/have more options.
- davidee 17d agoThis made me chuckle. Aside: Scala dev here - but I only talk about how wonderful it is with people I trust (mostly Go and Rust developers I used to work with). Also, Scala Native means I don’t always have to worry about the JVM depending on the use case. ScalaJS is fun too.