13 ms·
Go: Ten years and climbing
- jff 9y agoI took a seminar class in Go in my final year of school, in the spring of 2010. I was hooked pretty early. It was a very chaotic time to be writing Go; the language would change from week to week, so if we did a pull from the Go repo, there was no guarantee last week's assignment would still compile! At the time, the canonical way to compile code was by makefile: include $(GOROOT)/src/Make.$(GOARCH) TARG=bin/command GOFILES=main.go include $(GOROOT)/src/Make.cmd The thing I miss most is the netchan. I understand the reasons they got rid of it (https://groups.google.com/forum/#!topic/golang-nuts/Er3TetntSmg https://groups.google.com/forum/#!topic/golang-nuts/Er3Tetnt...) but when it worked, it was fantastic.
- rjammala 9y agoDid you find any alternative implementation of netchan that you like?
- gtirloni 9y agoNot OP but here's a recent discussion with some pointers: https://news.ycombinator.com/item?id=14878244 https://news.ycombinator.com/item?id=14878244
- pstuart 9y agoI remember reading the netchan and thinking it would be so cool but it was gone by the time I started working Go. I figured I must have been imagining things.
- deleted 9y ago[deleted]
- fowl2 9y agoWoah! How time flies! Somehow still no one I know knows what Go is!
- Insanity 9y agoAt work we have recently started using Go. When I told one of my developer friends that I was doing some Go projects, he was confused and thought I meant "Pokemon Go". So yeah, you might have a point, sadly.
- pmarreck 9y agoa developer who hasn’t heard of Go must live under some special kind of rock
- kmicklas 9y agoHopefully it's a very good kind of rock where there are no bad languages like Go.
- hactually 9y agowhat makes it a bad language? have you written much in it? what didn't you like/couldn't you do?
- kmicklas 9y agoUnfortunately I have to write it nearly every day in my job at Google. The biggest failures are the lack of generics or any form of immutability. It's basically impossible to write any kind of abstraction in Go. That's unacceptable for a language created in the 21st century.
- choward 9y agoA rock with ".NET" written on the side of it.
- pmarreck 9y agoah, "microsoft people." Left that rigorously-walled garden a long time ago without looking back... it was the right move for me.
- yumaikas 9y agoI've been using Go on the side since mid-late 2013, so not nearly as long as some here, but I was heavily impressed by both Goroutines and channels as ideas, and by the net/http library. The general portability and simplicity of the language has made it nice for side-project work. I've since used go to write a blog engine, several APIs for school projects, and have been working on a scripting language (pisc.junglecoder.com).
- kmicklas 9y ago> but I was heavily impressed by both Goroutines and channels as ideas You know they didn't invent this right?
- deckarep 9y agoDoes that matter? Languages are born of other languages all the time. What matters are the many reasons why languages like Go flourish and what makes them impactful.
- yumaikas 9y agoI know the didn't invent them. But Go was my first exposure to them, and to date, one of the few languages to give them dedicated syntax. I realize it's less necessary to do so in some other languages, but it was still a very interesting learning experience.
- dang 9y agoWe've asked you before not to conduct programming language flamewars on HN. If you keep doing it, we're going to have to ban you. We're looking for thoughtful discussion, not stale sniping.
- hactually 9y agogoroutines are definitely unique to go. I'm sure the approach/style has been done before but this implementation is pretty unique to Go.
- kmicklas 9y ago
- artursapek 9y agoI wrote my first fibonacci sequence test program in Go about four years ago. Now I am full-time admin of a large real-time cryptocurrency charting website that pushes 30MM+ messages to clients per minute, written entirely in Go. I've learned a ton about programming from Go and I'm not sure I would have managed to build the system at all with another language. Go gets a lot of flak for its simplicity, but what it does it does very well. The concurrency model, networking packages, tooling, and simple deployment make it a joy to work with and I owe a lot to the Golang team. Happy birthday!
- kmicklas 9y agoGo is actually 50 years old in terms of design insight.
- myf01d 9y agoI hope this doesn't get deleted, because it's the truth
- mdanger007 9y agoSuccess in technology means someone posting on a forum how it's not actually new. (May all our products be so successful!)
- Thaxll 9y agoThe reddit / hn community is so toxic geez ...
- skj 9y agoIf their goal was to be innovative and bring new ideas to the programming world, you could argue that they failed. But their goal was to make it easier for people to do large scale distributed system programming. In that, they succeeded.
- lucidone 9y agoMaybe I'm spoiled, but I've had a hard time dipping my toes into Go due to the lack of batteries included frameworks (like Rails or Laravel). Can anyone recommend some resources to give it another shot?
- m_sahaf 9y agoIt's been a while since I used it, but Revel[0] is almost within the same family as Rails. The developers of Revel say they're inspired by the Play Framework. Another option that looks nice is the Buffalo[1]. It's a collection of libraries that are built to play nice with each other, but you don't have to use all of them as a bundle. You can use only the layers you want. [0] https://revel.github.io/ https://revel.github.io/ [1] https://gobuffalo.io/docs/getting-started https://gobuffalo.io/docs/getting-started
- lucidone 9y agoExactly what I was looking for. Thanks!
- pointytrees 9y agoI felt the same way you do, but then I stumbled across this article: https://medium.com/code-zen/why-i-don-t-use-go-web-frameworks-1087e1facfa4 https://medium.com/code-zen/why-i-don-t-use-go-web-framework... And, I really started digging into the native http support. Go has a lot of really nice things built in and ready to go. Still working on learning what they've got, so maybe I'll end up wanting a framework again at some point. But for now, it's got everything I need for general tasks.
- jimsmart 9y agoTake a look at Buffalo, it's very much inspired by Rails. https://gobuffalo.io/docs/getting-started https://gobuffalo.io/docs/getting-started
- konart 9y agoBuffalo I guess, but this is not what Go was build for. This is like asking for a c++ web framework. Yeah, there are some, but generally speaking you don't see people using c++ for building a web app. Components of the app or the inrastructure - yes.
- cpfohl 9y agoMy favorite line: "Go is huge in China". My first thought: don't they mean Weiqi!?
- staunch 9y agoOne of Larry Wall's slogans for Perl is "Easy things should be easy, and hard things should be possible." In its own way, that's what has made Go the kind of success that Perl once was. Perl was the glue language of the web and Go is the production language of the cloud. I'm actually a bit scared to imagine a world in which Go was not created, given how much success I've personally had with it. Thanks to the entire Go team.
- iainmerrick 9y agoI think that's a great comparison. Some people love Perl and some hate it, but there's no denying it was a tremendously important language in the 90s. The duct tape of the Internet. (I don't happen to like either Perl or Go myself! But I think I can see why others do.)
- kod 9y agoThis is a bad comparison. Core philosophy of Perl is to empower programmers with more than one way to do it. Core philosophy of Go is your coworkers are too stupid to be allowed to have nice things.
- aaron-lebo 9y agoSeems like the core philosophy of Go is the end result of Python's "there's one way to do it". The "Go's design and users are dumb" meme needs to die. It's not even a constructive criticism. It's dishonest, insulting, and it's too bad grown adults and professionals can't see beyond it.
- kod 9y agoI'm not saying Go's design is dumb, it's obviously successful at what it set out to do. I'm not trying to be dishonest or insulting. I've described the philosophy of the language in exactly those terms to Go users, in person, and gotten nods of "Yes, that's right, that's why it works." I think it's more dishonest to claim that the language designers didn't intentionally limit the language to less than the state of the art as of 30 years ago, on purpose, because of concerns about the mental capacity of users. They themselves admit as much.
- shrumm 9y agoMy introduction to Go was pretty recent about 2 years ago and we went all in. We had an internal tool that started out as a test MVP written in python. Demand was growing fast so a year later it was an absolute mess of tech debt. We knew a significant refactoring was needed and figured the best thing to do was to just redesign and build from scratch. One of the guys had played with Go in his spare time so convinced all of us to just try it. Best decision ever, at least for this use case where we needed speed and stablilty. Go's native concurrency features were an absolute joy. It's really opinionated too so it ended up very convenient to use as a team with different coding styles. Thank you Go team!
- pointytrees 9y agoI sometimes feel crummy to force my preferences on other developers I bring on board. For example, most of my work is PHP, so all of our repo's use spaces, and braces on newlines. When a new dev comes on board, they must follow that format. Funny thing is with GO, I don't mind in the slightest that go fmt . is tabs and braces on the same line. What is so much more important to me is consistency. Go has done a stellar job at providing consistency. As I read when I was getting started, no one loves gofmt's formatting, but everyone loves gofmt.
- mathw 9y agoI have mixed feelings about the language itself, and some of its tooling (GOPATH just makes no sense to me whatsoever, and I've not spent enough time hacking Go projects to understand why it wouldn't be better to just have something like Cargo to handle dependencies), but I firmly believe that go fmt might be the biggest contribution to the language tooling world I've seen for a long time. We've had autoformatters before, but they were always customisable things, sparsely used. Go shipping a formatter with the core distribution? Go projects routinely adopting it as a requirement for contributors? One standard format defined from the start? Knockdown stuff. All those pointless arguments about coding style, gone. All that worrying about how to lay things out, gone. Just run go fmt and move on. I have now become entirely reliant on rustfmt when I'm writing Rust, and I love it. I just write a total horrible mess, press save and it magically becomes neat and lovely. I wish I had something that powerful operating in my C# environment at work. Admittedly, at the moment I also wish my C# environment at work wasn't laden with iron-clad layout rules that the tooling isn't capable of fixing for me. All private members must be after the public ones, but static private ones need to be before the instance ones, and all properties go first regardless of accessibility (although remember the private properties have to go after the public properties). And usings must go inside the namespace definition, in alphabetical order except System.whatever, which all come first (in alphabetical order). And you can't split a function argument across multiple lines unless it's a lambda. Microsoft's C# style guide? What's that and why would we care and no it's not prescriptive enough anyway. It's enough to make your head spin. Good thing I'm only there for six more days. Give every language a formatter, as standard, and let's just be done with it.
- Goopplesoft 9y ago> Russ discovered—that's the right word—that the generality of Go's methods meant that a function could have methods, leading to the http.HandlerFunc idea...more general ideas too, like the the io.Reader and io.Writer interfaces, which informed the structure of all the I/O libraries. Big testament to great interfaces being hugely impactful. For me, the IO and HTTP interfaces are a big part of why Go is so nice to use; the libraries (including std) that emerged around those interfaces and their subsequent interoperability makes everything so coherent. Congrats to the Go team and their amazing work!
- chimeracoder 9y agoI've been writing Go professionally, full-time, for the past five years. I'm a polyglot, so before Go, I loved exploring every new language I could get my hands on[0]. I still do, for fun, but Go is the one language that has kept me hooked all this time. It's not for any single feature, or for the community (though that's a great part of it). It's because it's the only language which I feel gets out of the way for me and lets me write powerful, robust, and maintainable software quickly without having to think or struggle against the tools. For me, Go is like trying to do surgery wearing latex surgical gloves, instead of wearing thick woolen mittens. [0] Seriously: if you can name it, and there's a working Linux x86_64 compiler/interpreter for it, I've probably tried it.
- smnplk 9y agoOut of curiosity, what is your take on clojure then ?
- chimeracoder 9y ago> Out of curiosity, what is your take on clojure then ? I have a lot of respect for Clojure, though I don't have much of a use case for it. At the time I tried it, I was annoyed its semantics for '() and nil - they're sort of a hybrid between how Common Lisp does it and how Java does it. Which makes sense - the Common Lisp approach would be a nightmare to implement on top of the JVM while maintaining interoperability, but as someone whose primary language before that was Lisp, it was a bit weird to try and get used to. I love functional programming - before Go, Lisp did pay a number of my bills, after all! - but to me it feels more like art than work. It's fun to figure out the most elegant, Lisp-like way to approach a problem. It's fun to convert an arbitrary task into a language-recognition problem and then write the compiler to recognize that language as the implementation to the solution. I get the same feeling from it that I do when I finish a drawing and stand back to look at it. I don't want to touch it, lest I smudge it - I just want to sit back and appreciate the finished result. But it's a completely different kind of satisfaction that I get from writing Go - there, the fun is in how quickly I can solve a problem, and how confident I am in the reliability, robustness, and long-term maintainability of my initial effort. That's where Go really shines for me, and it's not like the joy of having created an beautiful work of art. It's more like the satisfaction of having built a solid American Colonial house for yourself to live in. I like them both, but for my professional work, I'll choose Go every time.
- aomix 9y agoI appreciate the ruthless design choices behind Go. Crafting a language so there are as few ways as possible, and preferably one, to solve a problem must be beautiful at a large scale organization. In my experience java codebases in big companies are nightmare factories because of the freedom you get from more similar languages. The Go dream of having a single decent solution to a problem instead of 20 that range from bizarre to really clever sounds like heaven. I wish I had more time to take a serious stab at learning it.
- deleted 9y ago[deleted]
- flavio81 9y ago>because of the freedom you get from more similar languages. Is this lack of freedom a good thing?
- ashark 9y agoThe size of the language and the (more or less) one-way-to-do-things style mean that reading someone else’s go—say, from a library you’re depending on—is really easy. The chance you’ll run into language features you aren’t familiar with (which can happen even to long-time writers of some larger languages) or one of several competing and possibly now-deprecated 3rd party bolted-on features making up for painful deficiencies in the base language (ahem, JavaScript) or some nutty flow-obscuring “helpful” nonsense is low.
- cloverich 9y agoI can see it being a good thing in many organizations. I've worked in organizations with very sharp people who did not care to limit one another, allowing a smorgasbord of languages, frameworks, idioms, etc. Watching them smartly tackle the wide variety of idiosyncrasies that came with each language and framework was frustrating because, while they solved a great many problems, delivering robust working software was not one of them. I don't think everyone would have that problem. But I'd wager a great many would (do).
- catnaroek 9y ago
- Karrot_Kream 9y agoHaving dealt with enough spaghetti code over the years (just a few of industry experience, and some more years of academia), I understand what Go's strengths are. It's an opinionated language that stops users from being too clever or writing code that's too complex. That said, I've always hated the trends that have brought Golang into popularity. The engineers I've felt who could benefit from Golang the most could also benefit by getting a better handle on their fundamentals and taking a moment to design their codebase more. As a simple language to wire pieces together, Golang is fine, but it really doesn't give you the tools (imo) to be productive for anything more complex than simple apps. It's a great alternative to JS (again imo), but not something I'd like to write. We shouldn't need to treat the developer like a toddler to get them to write safe code. I'm a much bigger proponent of languages such as Rust or Haskell which give the developer the _tools_ to ensure their own data integrity, but I guess that says something about me as a developer and why I don't like Golang.
- atomical 9y agoDevelopers may not need the sophistication that you describing. In that case it's just wasted effort learning something that is more complicated. Are Docker and InfluxDB simple apps? What do you consider simple and what do you consider complex?
- Karrot_Kream 9y ago> Are Docker and InfluxDB simple apps? What do you consider simple and what do you consider complex? Docker and InfluxDB are investor funded organizations that contribute to open source. I'd argue that their success has more to do with the monetary input than anything to do with the language itself.
- atomical 9y agoI don't understand your argument. You can't develop complicated GoLang apps unless you have tons of money? But you can develop complicated Rust apps without tons of money?
- 9y ago
- norswap 9y ago> Today, Go is the language of the cloud [...] Is that true? First time I hear of a dominance of Go in the cloud. (And what does it mean anyway -- any distributed app that runs on the cloud, or cloud infrastructure... such as?)
- detaro 9y agoInfrastructure. Some example projects of the top of my head: Kubernetes, etcd, Docker, terraform, ...
- zzzcpan 9y agoThey don't dominate anything though. And only half of those are for cloud infrastructure.
- tomsthumb 9y agoKubernetes is built on top of docker, etcd is used as a secret store for kube, and terraform is for infra as code. Google cloud platform offers kubernetes as a service. CoreOS Tectonic has the AWS plugin, and Azure has "Container Service". You can run kube on your own hardware, but the idea is that the service itself can just magically ask for more nodes which implies either on-prem cloud our the actual cloud cloud.
- camus2 9y ago> Is that true? First time I hear of a dominance of Go in the cloud. (And what does it mean anyway -- any distributed app that runs on the cloud, or cloud infrastructure... such as?) It isn't. It's like saying Ruby dominates the VM space because Vagrant uses Ruby. Sure there are a lot of orchestration tools written in Go, but look at the actual apps running in the cloud, how many efficient RDBMS written in Go widely deployed? worker queues? full text search engines? ETL solutions? streaming servers? or just actual apps users interact directly with? It's the "Go is a system language" all over again. It's at best misleading.
- 9y ago
- ubercow 9y agoI love Go for the concurrency and awesome cross platform support, but my biggest complaint about Go is still the forced GOPATH. I know this is super nitpicky, but I like to keep work and personal code completely separate and changing GOPATHs is very frustrating. With the introduction of `vendor` and software like glide and dep tool, you no longer have to store your sources in `$GOPATH/src`. Since dep/glide are also required for sane dependency version management, there seems to be no benefit of using `src` over `vendor`. Without `src`, is there any reason `GOPATH` is still required?
- hgl 9y agoI’m trying to not rely on GOPATH too, but how do you import sub packages? Are you supposed to put them in vendor too?
- infogulch 9y agoVendoring is based on the VCS, so it vendors all packages (and "sub-packages") at once.
- zenlikethat 9y agoIf you're that fussed about it why not go build -i inside your personal repo ? Or have a GOPATH with two dirs like: GOPATH="~/workgo:~/homego"
- DelightOne 9y agoCompletely separate = dont allow dependencies between or one is base and second auguments and depends on base or dont allow changes to one of them? How would your ideal system look like? What is your use case? Sidenote if it helps there is a default gopath location if its not defined: https://golang.org/doc/go1.8#gopath https://golang.org/doc/go1.8#gopath
- ubercow 9y agoMy ideal system is: clone a repo, run `go restore` to fetch dependencies and then `go build` to spit out a binary or `go run` to quickly start the main function. Nothing from outside the repo can effect that build. Likewise anything inside the repo can’t effect the outside. Compartmentalizing each project makes builds more reproducible and more obvious. If anyone else clones the same repo and runs the same commands, they should get the same result.
- gramakri 9y agoNot a Go programmer myself but I am very grateful for Go. Some of the best software I use everyday uses Go - rclone, gitlab, gogs, gosu, docker to name a few.
- gilbetron 9y agoHoly hell, Go is ten years old. 2007 was ten years ago. I'm so happy I have some Buffalo Trace whiskey sitting next to me :/
- gilbetron 9y agoDownvotes? Because I'm old? This wasn't a dis on Go, just that I think of it as brand new, and it is 10 years old :/
- christophilus 9y agoI evaluated Go a few months ago for a web project, but it seemed as if there was a lot of manual work involved in mapping objects in and out of a MySQL database and in and out of JSON (basically, 50% of my day-to-day back end work). It just seemed too arduous. The second thing that bothered me was that an edge-case bug in one of my HTTP handlers paniced the app. If that had happened in production while under load, many users would have gotten an error due to a bug in one user's request. So, serious questions: - What is the best way to map objects to/from JSON? - What is the best way to map objects to/from a database? - What is the best way to prevent a request from crashing the server and killing a bunch of unrelated requests?
- pbohun 9y agoHere's an example I wrote up for to/from json: https://gist.github.com/anonymous/8487446a2fd908910c66a2aafbe7b1ef https://gist.github.com/anonymous/8487446a2fd908910c66a2aafb... Admittedly, mapping objects to/from database entries is a bit more complicated. There are several ORMs out there or you can role your own.
- christophilus 9y agoYeah. The repeating the field, only camelCased, in JSON annotations feels needlessly painful to me. Subjective, I know, but that kind of painfulness seems pervasive in my (brief) dabbling with Go, and is one of the main reasons I moved on.
- pbohun 9y agoThe json annotation is optional, but very powerful since it allows you to set the mapped name of the field to any name you like, allowing you to map json fields with snake_case, CamelCase, kebab-case, etc.
- ovao 9y agoOne alternative to writing struct tags by hand is to write a little generator code to map the field names from, say, a reference .json, then calling `go generate` as part of your build process. I've wondered whether a wrapper library could do rule-based field name mapping automatically with Go's reflection facilities (which could be a productivity win), but I haven't really looked at it closely.
- evolighting 9y agoGoogle is there and that why Go is there. Trust me,you could never go against google's will
- deleted 9y ago[deleted]
- iainmerrick 9y agoIt's funny that the very first thing discussed is the name. "Go" always seemed like a bad idea, being hard to google for -- and while they were employed by Google, no less! It fits with the love-it-or-hate-it nature of the whole language.
- pointytrees 9y agoI find searching for things with go quite often brings up what I need anyways. When I'm unsure or hit a snag, I'll include the term golang. Have not had many problems searching for stuff.
- didibus 9y agoGo is the new Java, and I think everyone will have to come to terms with it.
- pjmlp 9y agoNot until it catches up with Java regarding language features, UI toolkits, DB drivers, graphical debuggers, clustering monitoring tools. Meanwhile most commercial JDKs do actually offer AOT compilation, with OpenJDK 9 intoducing it as well.
- cutler 9y agoFor a language that's been around for 10 years Golang's adoption rate is still pretty low. Searching Indeed.co.uk's API by job title there are currently 25 Golang jobs in London compared with 29 Perl, 188 Ruby and 511 Python. For the UK as a whole it's 34 Golang, 57 Perl, 276 Ruby and 821 Python. Golang has a long way to go yet IMHO.
- kayoone 9y agoWhich language released in the last 10 years is more popular then ? Golang is arguably niche and does not offer the huge flexibility and ecosystem of say Python, so i am pretty sure it will never come close to that, but there are a good number of usescases where it arguably is the best choice.
- cutler 9y agoScala, with 164 jobs in London and 225 nationwide, has been around for about the same time as a production-quality release. I raised the point because I think Golang's coverage on HN is disproportionate to its significance in the job market.
- mathw 9y agoSignificance in the job market has never correlated well with how excited people get about things. Hacker News is about stuff we're interested in, which is not necessarily stuff we get employed to do.
- snaky 9y agoLondon is about 'fintech', so Scala is in great demand. SF Bay Area is about 'webscale' so Go is popular, as it established as The Cloud Automation language. And HN crowd is mostly leaning to SF. OTOH you wouldn't find a great demand for Oracle DBA or C# skills in The Valley, and that's not because they are not in great demand somewhere else - maybe even basically everywhere else like C#. Places lean to some niche or other, and vice versa. Apple places its growing hardware teams in Texas despite new campus in The Valley and all that. Why? Because Austin is very much hardware place.
- baby 9y agoI love Golang, but I'll just comment on that: > It's worth stating that the language is called Go; "golang" comes from the web site address (go.com was already a Disney web site) but is not the proper name of the language.) You already have a hugely popular game called Go (WeiQi/Baiduk). It just adds confusion to queries to call the language Go instead of Golang. Even the #go channel on freenode has a disclaimer that it's not about the language. It's like calling your language football.
- hanselot 9y agoTo apply for this position you require 12 years of Senior Experience in Go and Cobol.
- throw2016 9y agoNo other social or professional setting tolerates this kind of brazen self importance and posturing seen here without mockery. This site doesn't allow satire but looks the other way when snarky claims are made without evidence. Blanket assertions must be backed up. At least show the problem you were trying to solve and the new solution in your favoured language/tool/framework so it can be judged. This is how bad ideas and complexity gain traction without scrutiny and push back. People become vested in Ruby and run down php, people become vested in Rust and run down Go, people become vested in React and run down jquery. How comes tools people were using happily just yesterday are suddenly 'completely unacceptable'? No one who befitted from these tools and languages is going to run them down publicly because they found something better. This is self serving ecosystem marketing at work that HN seems to ignore. It's as if every self congratulatory commentator often seen here was born an expert and short circuited the process of learning, and can use this platform to run down everyone else and their choices.
- real-hacker 9y agoI remembered my experience learning Go: reading Go language spec for about 2 hours and start being productive. That is not quite possible with other languages, I am afraid.