4 ms·
Over the previous few weeks, I've seen multiple projects including one internal project drop Go. There was the widely publicized story [1] where Dropbox was sw
by joeblau 11y ago
Over the previous few weeks, I've seen multiple projects including one internal project drop Go. There was the widely publicized story [1] where Dropbox was switching from Go to Rust. More recently one of our backend engineers who built a prototype in Go told us that they pulled all of the GoLang code out in favor of C++/Python citing a huge overhead (I don't remember if it's CPU or Memory footprint). I know a lot of people are touting the concurrency model, but I've seen so many technical analysis of unfavorable technical analysis of Go that I'm starting to question whether I should learn Go or invest my time learning something else?
[1] - http://www.wired.com/2016/03/epic-story-dropboxs-exodus-amazon-cloud-empire/ http://www.wired.com/2016/03/epic-story-dropboxs-exodus-amaz...
- IshKebab 11y agoWhile the concurrency model is nice (especially waiting on multiple channels - I haven't found a way to do that nicely in C++), I think there are other bigger advantages to Go: * The standard library is really nice. It has almost everything you want and it's written in a clean non-enterprisey way * It generates a single statically linked binary. Doing this is very difficult in most other languages. * It's really really easy to cross-compile. Again, often very difficult in other languages (you might even have to compile your own compiler). * It comes with a built in battle tested HTTP2 server, and a sane TLS library. * It's a very simple language so it is easy for beginners to pick up, and also easy to read other people's code. Don't underestimate the importance of this - there's nothing worse than writing something awesome in a language that your coworkers find difficult, and then perpetually having to support it. * The tooling is pretty good. * Performance is good, and they've done really good work on minimising GC pause lengths. Of course I wouldn't pretend there aren't downsides (cough generics), but they're mostly minor and certainly no worse than you'd have in any other system (C++/Python sounds like it would have more than its fair share of issues!). Edit: Aside from generics, my biggest complaint is the impossibility of RAII. It's too easy to forget to `close()` things. Most languages suffer from this though, and at least Go makes some attempt to improve matters with `defer`.
- cm3 11y ago> it generates a single statically linked binary. Doing this is very difficult in most other languages. For AOT platforms it's difficult mostly due to glibc. e.g. on FreeBSD and Linux musl it's trivial to build fully static binaries. Otherwise all valid statements and Golang is an improvement over other mainstream languages. So here's some future items for improvement that would make it even better and well suited for wider use: * a nicer error handling mechanism, though this may be hard * dead code elimination. Golang's static binaries are huge compared to fully statically compiled executables for other languages. I suppose the new compiler passes and backend might provide a basis to solve this. * restore compile speed, which of course was mostly due to previously missing optimizations and simple compiler passes, which were added now and made it slower. Still the Wirth'ian language design allows for much faster compile times than C or C++.
- _ph_ 11y agoAnd don't forget: no makefiles! All the building and rebuilding is entirely handled by the compiler. Which is very nice for simplifying project building.
- osweiller 11y agoGo isn't right for all projects. There has never been a language or platform that's right for all projects. It's quite a successful language, however, if it's at the point where there are now projects that realize that and are making the move to other languages. However posts that, in 2016, seriously posit "I'm trying to figure out if it's worth learning" I don't believe are being sincere. They're usually saying "I haven't, and still don't want to, and here's my current justifications". And that's okay. I don't know Rust. I haven't bothered with Swift yet. One day.
- pjmlp 11y agoGo's concurrency is great as easy starting point, but as soon as you want to use another model you need to move out to libraries. And when you need third party libraries, then other languages have much more mature libraries[1], and thanks to more powerful type systems, those libraries get to be used almost as built in types. [1] TPL, TBB, PPL, java.util.concurrent, Quasar, Cilk, C++AMP, Akka, Akka.NET, Orleans, ...
- ngrilly 11y agoThe Dropbox project where they switched from Go to Rust is very low-level, and the constraints regarding memory usage where not typical of the average project, and the developers recognize they continue to use Go and Python in most other projects at Dropbox.
- joeblau 11y agoAh thanks for clearing that up. The project that my colleague switched from Go was also a low level project. It seems like Go isn't fantastic for lower-level projects yet.
- ngrilly 11y agoAbout your colleague, what exactly made him/her switch? To define a bit more what I mean by "low-level": - I think that Go is "lower" level than Java because Go is compiled to a native executable (no virtual machine) and Go gives you control over memory layout (not everything is a reference like in Java). - I think that C/C++/Rust are lower level than Go because you control memory allocation and deallocation (no garbage collector) and you can even customize the memory allocator if you need. It's also more efficient to interface with C libraries because the calling conventions are identical.
- joeblau 11y agoUnfortunately, I'm under an NDA, but I just went back in slack to see what the issue was. Seems to be that we didn't have the build process and tooling to support Go and our system is under extreme resource constraints so supporting anything outside of our existing tools is a no-go (no pun intended). In terms of the other languages you've mentioned, I went to school and all they thought us was C++ so I'm fairly comfortable there. I still haven't used Rust, but I've touched a ton of other languages. The language I've been experimenting with the most recently is Swift since I'm an iOS developer.
- thegeekpirate 11y agoThis is incorrect. Dropbox replaced their most performance-intensive section with Rust to squeeze out every last drop. They're still very much so a Go and Python shop.