4 ms·
Go seems like such a strange language to me. I like its simple syntax, but it's strange that they compromised and added generics to the language but balk at bas
by nsingh2 1y ago
Go seems like such a strange language to me. I like its simple syntax, but it's strange that they compromised and added generics to the language but balk at basic things like sum types, pattern matching and type safe enums. Their simplicity design philosophy seems a bit incoherent.
- lionkor 1y agoThey might be trying to do another C, that is so simple that it will be ubiquitous? They're failing to understand that C would never take off it invented today. Go is nowhere on my list of languages I would use - there is simply nothing it's great at. Serialization/deserialization? Rust. Multithreading? Rust. Low level high performance stuff? C, Zig. Quick scripts? Bash, python, JavaScript, Rust. Really fast concurrency? C++ or Rust. Web servers and services? Either nodejs, something static on an existing webserver, or rust for backends. I completely fail to see where Go excels. Large, statically linked binaries that aren't even concurrency safe...? Really? No enums? Odd syntax (I like Rust, C++ and Haskell, I find Go's syntax odd still). Like so many Google products, it solves a problem that nobody I know has. And I guess they can afford concurrency bugs, who cares, its only a language primarily for concurrency.
- tacitusarc 1y agoHave you used Go? Most of your criticisms are, in my experience, incorrect. But ultimately there are tradeoffs, and Go seems to be a divisive language. In my experience, Go excels at pushing you towards solving the problem rather than yak shaving. And in my opinion that is worth it’s relatively minor frustrations.
- pjmlp 1y agoMany of us that critise Go, no only have been around the ecosystem since the pre-1.0 days, we also happen to have a broad experience in programming languages since the days writing complete applications in Assembly was pretty much daily business.
- ironmagma 1y agoCompilation time is fast, and it’s debuggable. Typescript would be the main competitor in my mind, but compilation with TS is slow and you have no parallelism without native extensions.
- sambeau 1y agoGo is a tiny language. I can easily hold it all in my head. I don't think I can say that about any other language I've used. Not even C.
- homebrewer 1y agoIt is a passable replacement for CLI utilities (so basically Python or bash) thanks to the rich ecosystem, easy cross-compilation, and static linking, which makes deploying the result easy while also avoiding the horrible mess and pain of handling Python dependencies, or remembering dozens of tiny incompatibilities between various flavors of UNIX utilities. Unlike Rust, one is not required to have three digit IQ to use the language, so that's why I've been using it where previously I would have resorted to Python (and then either copy venvs around, or write packages for my packages to ship dependencies of my dependencies). I too fail to see why would anybody use it for anything else, especially compilers or more complicated server stuff where you really benefit from having a proper type system, but people do, so I must be missing something...
- za3faran 1y agoIt's a better Python, that's where I see most of the real world use cases. After dealing with Python for a while now, I would take golang any day of the week lol. But for backend systems, there are far superior alternatives.
- pjmlp 1y agoThe only thing it does better than Python is being a compiled language.
- flkenosad 1y agoIt's great for large software projects that need tons of random contributers. For example, Gitea.
- pjmlp 1y agoC is only simple in theory.
- Yasuraka 1y ago> Web servers and services? That's it, mostly. CRUD is also a huge part of the industry, unlike "Serialization/deserialization", which are a means to an end. > Either nodejs, something static on an existing webserver, or rust for backends. Horrendous choices, I daresay. Why do people use Java and C# ?
- zarldev 1y ago>That's it mostly... Whole kubernetes, docker, traefik and many other cloud native tools are written in go.
- Yasuraka 1y agoThey are my daily bread and I sloppily lumped them in with "web [...] services", but in hindsight they ought to be a separate category - fundamentally about a different layer,infrastructure, and might not even be networked.
- pjmlp 1y agoMany tools on DevOps ecosystem are now going through the RIIR phenomenon, and I bet, had Rust 1.0 been available when Kubernetes decided to migrate away from Java, after Go heads joined the team (see FOSDEM talk on the matter), or Docker moving away from Python, most of those tools would have been written in Rust instead.
- Yasuraka 1y ago> most of those tools would have been written in Rust I seriously doubt it for the same reason that Google, with all of its expertise and tooling for it, didn't choose C++, twice.
- pjmlp 1y agoYou may doubt it, I keep my certainty, given how much Go is being used at Google, versus Java, Kotlin, C++ and Rust.
- pjmlp 1y agoEven back in its heyday what helped C take off was AT&T not being allowed to profit from their Bell Labs research. Do you think UNIX was sold at VMS, MVS, System/360 prices, even with university discounts, every university on the planet would have been rushing to adopt it on their timesharing systems? The lawsuits done by AT&T years later, the prohibition of Lion's book, and Sun introducing the concept UNIX developer license, shows how it would have gone.
- alpaca128 1y agoC has tagged unions, though. That's the wild thing about Go, it doesn't even cover all basic C features.
- JyB 1y agoThe generics addition is extremely incoherent indeed. Makes sense why there was a lot of push back.
- hfgjbcgjbvg 1y agoThey never should’ve done it but the way they did do it is the best way they could’ve done it.
- sureglymop 1y agoIt's just weirdly bolted on. For example, it's challenging to make fully generic methods when interfaces are implicitly implemented. They should have designed the language better from the start. It also has too many C-isms imo. It had a bit of an identity crisis as to what it wants to be from the start.