12 ms·
Thirteen Years of Go
- anderspitman 4y agoGo has been my default language for a couple years now. I don't use it for everything, but I use it for most things. It makes some of the best tradeoffs I've ever seen, which is maybe the highest praise I can give as an engineer.
- jbirer 4y agoI want to love Go, due to my background in C and UNIX sysadmin, but can't. Rust does it for me though.
- afr0ck 4y agoMay I ask why?
- tptacek 4y agoThis is an article about Go, not an article comparing Go to Rust. I'd say the same thing if the roles were reversed: don't start language debates. They spread like kudzu and choke everything else out of the threads.
- Beltalowda 4y agoI wish people would learn that "don't leave a comment" is a completely viable and reasonable option.
- halfmatthalfcat 4y agoIf HN adhered to this policy, it would be the most boring site on the web. Tangential, complementary and/or controversial conversation in posts is where some of the best content is. Comment police/gatekeeping discussion (outside of dang actually enforcing the rules) is probably the most annoying behavior on this site.
- ilyt 4y agoComment "Rust is better because I use it" does not make great discussion tho. It's just useless noise
- james-skemp 4y agoA number of applications I really enjoy are written in Go, so it's been on mind to learn enough to be dangerous. Has anyone had good success with any particular resources?
- criddell 4y agoWhat are some examples? I've always thought of Go as a server-side language.
- masklinn 4y agofzf, hub, syncthing. Possibly also scc if for some reason you're not running tokei or loc. Maybe also frp and hugo.
- konart 4y agoDocker and corresponding tools. https://github.com/abiosoft/colima https://github.com/abiosoft/colima And many others, really.
- masklinn 4y ago> Docker and corresponding tools. https://github.com/abiosoft/colima https://github.com/abiosoft/colima Neither sound like "applications I really enjoy". More like applications you suffer. > And many others, really. How about examples?
- throwawaaarrgh 4y ago
- candiddevmike 4y agoIf you can't learn Go, you're going to have a bad time with Rust.
- ohCh6zos 4y agoDon’t be so sure. I found Go to be frustrating and difficult, but Rust has been a pleasure.
- quaffapint 4y agoI do c# in my day job, and so far Rust has been much easier to pick up than Go. Maybe it just happens to be more similar to c#, but given it can be used as a system level lang like c++ I've been very surprised how quick it can be picked up (at least for basic tasks).
- smithcoin 4y ago> Lack of docs, broken and confusing functionality, limited language features, bizarre operations. You are painting with a pretty broad brush, can you provide a concrete example of these?
- dartharva 4y agoI don't know how applicable this is, but even the basic if-else syntax can hit you with hours of frustrating struggles. The parantheses have to be arranged in a specific way that was never mentioned in the online language specs over at go.dev, otherwise the code will fail: if (cond) { return x } else { return y } works, but if (cond) { return x } else { return y } doesn't.
- Queue29 4y ago> never mentioned in the online language specs over at go.dev hmm, what's this then? https://go.dev/doc/faq#Does_Go_have_a_ternary_form https://go.dev/doc/faq#Does_Go_have_a_ternary_form
- jonathanstrange 4y agoGo is an awesome language and I'm very happy I chose it as the main language for my personal projects. However, I have implemented some quirky Lisp in Go to have some more dynamic experience, too, so now my applications are becoming hybrid.
- Joker_vD 4y ago> Workspaces make it easy to work on multiple modules simultaneously, which is most helpful when you are maintaining a set of related modules with module dependencies between them. It's a somewhat uneasy feeling to see how the "solution/projects" (in Visual Studio terms) hierarchy keeps getting reinvented in every. single. bloody. ecosystem, even in non-PL ones. Surely there must be a better way to organize things?
- doorman2 4y agoGo workspaces are amazing. You create a go.work file, add a line with each module you're working on, and then the Go language server handles the rest. Solutions and projects seem way more complicated, but also not entirely congruent. A Go workspace is used when you have two modules that depend on each other and you want to work on both concurrently. The two modules are still independent and could be worked on individually by pulling in the latest release of the other module. The modules in a workspace may have entirely different ownership. For instance, let's say you're using a WebRTC library to run a selective forwarding unit as part of your video conferencing app. Maybe you notice a bug in the WebRTC library. You can check out the code for the WebRTC library and add it to your workspace so you can test your application against your local WebRTC library changes.
- 0x445442 4y agoBy amazing do you mean specifically for Go? Because I don’t see how it differs from working on two Maven projects simultaneously in Java where one depends on the other.
- doorman2 4y agoIn maven, don't you need to update the pom file of the projects to point to the local copy? What's nice about the Go workspace system is that the workspace lives above the individual modules, meaning that the individual modules don't need any modification to pull in local dependencies. E.g. if your workspace looks like this: workspace/ mod1/ mod2/ Then both mod1 and mod2 will pull their dependencies remotely. But if you add a file to workspace/go.work, then local versions of mod1 and mod2 can be used without changing either mod1 or mod2.
- Laiho 4y agoI really want to love this language, a fast and simple garbage collected lang, but feel like they missed the spot a little. I just wish they did something different with error handling / nil, doesn't feel right for the language. Also whats up with stuff like unused imports being such a big deal?
- tptacek 4y agoI keep count in my own code of the number of bugs Go's "damnable use requirement" has caught for me, and I'm now up to 5. It's not a big number, but they were real bugs that would have annoyed the shit out of me if they'd made it into shipping code. I think this is one of the polarizing decisions Go made that is going to turn out to be universal orthodoxy 10 years from now. I think error handling is the thing about Go that people get most wrong. I believe that what's happened is that Go expected its users to be people fleeing C++ (they definitely got that one wrong), and instead they got a flood of Python and Java developers. Systems programming is error programming. Hiding and abstracting errors in systems code isn't a win; it's a handicap. Fiddly decisions about errors is the whole ballgame. But that's not the case in application code (EAFP!) and Go has been beset by that countervailing sentiment ever since. That's not to say Go's got error handling perfect; it would be better with matching. But no mainstream language gets errors perfect. What unifies the strong systems languages is that they enable the overt programming of errors.
- dontlaugh 4y agoThe biggest problem with the error handling is that it's not composable. It's better than unchecked exceptions, but that's not saying much. The second problem is nil, use of which is common and doesn't enforce error handling.
- Laiho 4y agoI find it inconstant to be so pedantic about unused vars/imports to avoid bugs, but then leave error handling to what it is.
- AnimalMuppet 4y ago
- todotask 4y agoI have just embedded entire SPA dist in Go binary, much easier to deploy and reduce read from disk latency.
- Xeoncross 4y agoI've enjoyed writing Go for years. However, it's not been the language that does it for me. It's been the combination of features and ecosystem that makes it a default. It's hard to explain, but the language is one you can throw into a team of random developers and come out with benchmarks, tests, CI/CD pipelines, unified code formatting, and good parallel work models (via goroutines) almost every time. Builds are instant. Built artifacts are a single binary - not 1,200 files that must be moved. Every single package that has any traction is both easy to read and has documentation inline or via published go.dev docs. It's easy enough the frontend JS guy can write it. It's complex enough you can use goa.design or go-kit to auto generate openapi specs and complex microservice designs that support multiple transports (like gRPC). Errors always get handled because the linter points them out and the devs don't cheat by setting up multi-function try/catch blocks. I've had less issues with production Go applications than any other language. I don't want it to win over Rust though, Rust is awesome. I want Go to replace Java.
- jjice 4y agoWholely agree that Go tooling is fantastic, especially since most of it is bundled and directly supported by the language. Honestly my biggest gripe is nillability, but it really doesn't bite me nearly as much as it did in Java or C#. There's a reason it's sliding into the "boring and effective" (that's a good thing) camp of languages, but it's still got some cool factor.
- tptacek 4y agoStrong agree. Go isn't my favorite language, but it is my favorite programming tool.
- makestuff 4y agoYeah I was at a startup where maybe 10% of engineering had used go before and 20% had used Java before (it was a PHP monolith so most people were PHP developers). The Java code that was written was pretty awful (I was hired probably due to my java experience, so I had a decent idea of good java). However, the Go services were actually really good. There is something about having a simple language that works really well for backend CRUD services.
- below-0 4y ago
- Barrin92 4y agoI don't think they do, but with Go which is indeed a simple language, the focus is on letting developers build abstractions rather than providing them in the form of opinionated language features. And that is, in particular with an eye on performance, usually the right call. One of the worst traps in modern programming is rather than people building specific abstractions tailored to their own needs organically, starting out with them and trying to impose language features on a problem.
- deleted 4y ago[deleted]
- andrewmcwatters 4y agoGo has almost everything going for it. I only wish it was a bit more C-like and you had the ability to run it without a garbage collector, and that it was more suitable for systems and embedded programming. Perhaps one day someone will come up with an implementation of Go that doesn’t use a GC. It’s just such an incredible language, and it deserves the type of Rust fanaticism that Rust has, but I suspect Go users are just a different type of person and we really are fanatics, we just don’t publicize it.[1] [1]: https://survey.stackoverflow.co/2022/#most-popular-technologies-language-prof https://survey.stackoverflow.co/2022/#most-popular-technolog...
- galangalalgol 4y agoJust got told about tinygo on another thread where I was saying rust is the obvious only choice. But tinygo looks nice. I've written very little go professionally, and rust only for a few months more. Go does seem super easy. But rust doesn't really seem hard either. And the fearless concurrency is really attractivento not have to think much about data races too much. Either one is nicer than c++ which I have a quarter century of experience at.
- throwaway894345 4y agoTinyGo still has a GC, right?
- galangalalgol 4y agoIt does. https://aykevl.nl/2020/09/gc-tinygo https://aykevl.nl/2020/09/gc-tinygo Edit: but that said with sich constrained resources do people really use gc or even dynamic memory allocation often in embedded? I work embedded and it is usually standard practice to preallocate everything to avoid fragmentation. Unless it is a more performant device in which case I'll add the quotes to "embedded". But for those you could just use normal go, or python for that matter.
- rahen 4y ago> I only wish it was a bit more C-like and you had the ability to run it without a garbage collector "import C, import unsafe". You absolutely can, at least for performance critical sections where you cannot afford garbage collection. https://dgraph.io/blog/post/manual-memory-management-golang-jemalloc https://dgraph.io/blog/post/manual-memory-management-golang-...
- pipeline_peak 4y agoWhy exactly is Go so special? For a compiled language it's not very fast and doesn't seem to be making much traction. I think people simply like it because of it's Bell Labs heritage and pretty syntax.
- deleted 4y ago[deleted]
- imran-iq 4y agoIn no real order 1. wide range of OS's you can target 2. no dependency on libc, you can build and copy over a binary to a machine and it will work 3. fast compiles 4. amazing stdlib, makes writing no to low dependency code very attainable (imo) there's very little reason to start a new backend project in ruby/python/js when you can just use go and get better performance > doesn't seem to be making much traction Its one of the most in demand languages, at least according to linkedin in my area.
- lghh 4y ago> doesn't seem to be making much traction What do you mean by this? By what metrics and what would qualify as making traction? Many companies use Go and many prominent and widely used open source projects are written in Go. > it's Bell Labs heritage I have never met a person (in person, offline) who has cared about this at all. > pretty syntax One of the most common things you hear as a knock against Go are things that explicitly do not lead to "pretty" syntax, such as its error handling. Overall, your comment confuses me.
- AnimalMuppet 4y ago> > it's Bell Labs heritage > I have never met a person (in person, offline) who has cared about this at all. People care about it because the language has the Bell Labs "feel". They don't care about it the way a dog breeder would care about a dog's ancestry. (And of those who care about the "feel", some view it as a positive, others as a negative...)
- 4y ago
- sdevonoes 4y agoInteresting to see many comments regarding "Go is my favourite programming tool, but not my favourite programming language". I totally agree. I love the tooling (go build, go fmt, etc.), the performance, the ecosystem... but the language itself is not the best out there. I would love a mix between Python and Go: Python as the language with Go's tooling. That would be amazing!
- playingalong 4y agoAnyone else feeling put off by golang? The syntax, the crazy error handling, etc. To me it's like taking a step back in programming, or actually 20 years back. Not better than Java (which is annoyingly verbose), maybe better than Pascal.
- another_devy 4y agoJava is in middle or to the end of userspace, it is verbose and less opinionated. Golang is very close to systems programming hence very opinionated, you can easily build API applications with it but that’s the most non system engineering you can get out of it. The error handling is probably the best design I feel from language that’s in category of c, c++
- playingalong 4y agoGolang tend to be used for application programming these days. Not only system works. Including today's top page article.
- wting 4y agoYes, but in the end it's because people who like Go because they prioritize a certain set of features (language, community, ecosystem, etc), and those who prefer non-Go languages prioritize other features. I don't like Go personally, but I have advocated for Go to be used in many situations depending on context. It's unproductive to start a language war here since it's generally situation-dependent.
- flippinburgers 4y agoError handling at worst is an annoyance. The syntax? You will get used to it. Everyone has to adjust to every syntax whenever they learn a new language whether they realize they are or not.
- icedchai 4y agoI like Go's tooling, but I am consistently put off by the language. It's best described as "meh."
- 4y ago
- lakomen 4y agoI switched to Go in 2013. I was tired of the dogma of wrong in PHP. Everyone was an armchair expert trying to tell me how wrong everything I was doing for the last 11 years as a professional was. Go was a relief. At first I didn't get the hype, why were variable definitions the other way around? But then I took the tour and bam. Instant love and i learned so much about everything using it. It's not perfect but good enough for my needs. I feel like it's a language that is the product of a higher language, like swift. Because it's so primitive. I also find it easy to translate thought to code with Go.