5 ms·
Ask HN: Go or Rust, which one should I learn first?
Some background: I work mostly on middle-tier web applications. Usually micro-services. Either REST APIs (internal and external), blockchains, or event bus systems.
My bottlenecks are typically IO (usually disk, raw TCP, database, or HTTP/S) and memory (usually caching and filters to limit IO).
I use Javascript primarily so that the whole team can understand (or at least read) the full stack and because it help me manage blocking IO. I also know C, C++, Ruby, PHP, Java, C#, R and AWK well. I have passing knowledge in a few Scheme based languages.
So my question is, if I want to learn another language should it be Go, Rust, or something else?
- ddorian43 10y agoSo why do you want to learn a new language ? To fix your bottlenecks ?
- throwaway2016a 10y agoNode.js fixes the bottlenecks fine but is a bit memory and CPU intensive and can sometimes encourage bad coding practices. It also doesn't take advantage of multiple cores very well. I'm probably not going to switch production services any time soon but I don't want my skills to stagnate. Also, I edited the title a bit to clarify this wasn't a flame either or question. Although based on your comment I don't think you read it that way.
- ddorian43 10y agoIf you want to fix the bottlenecks check out seastar framework in c++.
- throwaway2016a 10y agoThanks I'll check that out.
- partisan 10y agoThe code reads very cleanly. I never transitioned to "modern" C++, but the syntax here makes it look somewhat appealing.
- max_ 10y agoGolang has a very minimal footprint compared to Rust if that matters.
- steveklabnik 10y agoIn what sense?
- max_ 10y agomemory usage.
- steveklabnik 10y agoInteresting, where do you get that from? I'd like to learn more about this.
- adrianN 10y agoWhy not both? "Which language is better" is mostly opinion based, so invest two or three weeks in each language and decide for yourself.
- throwaway2016a 10y agoGood question. My bandwidth is pretty limited right now. And I like to learn by doing a practical project. So I guess the better question is which one "first"? Edit: I updated the title.
- maxaf 10y agoConsidering the limited time you have available, I would suggest learning Rust as a means of getting more bang for your buck. Go offers very little over other similar languages, whereas Rust will yield copious food for thought and will change the way you approach software design. Rust has unique features (memory safety expressed via type system, borrow checker) not present in other languages, and definitely not present in Go, making the time investment a good one.
- iends 10y agoWhat languages are similar to go? Elixir, Erlang?
- maxaf 10y agoIMHO it's a weird cross between Python and C.
- iends 10y agoMaybe, but the real value in Go to me is the concurrency model.
- maxaf 10y agoFor many people Scala offers the same concurrency model in the form of actors without having to change runtimes/ecosystems. Go seems to have been too little too late for too few people; released a few years before Scala reached maturity, Go would have made a significant difference.
- rubiquity 10y agoIf IO is your constraint I think the best bang for your buck in terms of learning something new, solving the problem, and growing as a programmer would be Erlang/Elixir.
- kasey_junk 10y agoOne of the unquestioned strong points of Golang is how easy it is to learn with not a new concept to be found. It also sits right in the wheelhouse of the problems you currently solve. Whether these are arguments for or against it being your next language is really more for you to decide.
- baccheion 10y agoYou can pick up Go in less than a day. It may take longer to fully grasp Rust. So, start with Go, then begin learning about Rust on day 2. Other languages worth looking into: Kotlin, Swift, Nim, Crystal, Elixir, and Julia. Also, Haskell is good as far as receiving an "expand your mind" type of educational experience (if you haven't actively used a functional programming language before). The following is a ranking of programming languages (based on demand, salary, and employer rating): https://www.quora.com/What-will-be-the-top-in-demand-programming-languages-skills-frameworks-in-2016/answer/Joel-Johnson-1?srid=ieH https://www.quora.com/What-will-be-the-top-in-demand-program... . If you ignore demand, you can combine salary and employer rating to get a sense of which languages to learn. The following is an HN poll that ranked several languages: https://news.ycombinator.com/item?id=6527104 https://news.ycombinator.com/item?id=6527104
- grok2 10y agoI second picking up Go first and Rust later (or as an ongoing thing since Rust takes time). I tried both and was quickly able to make use of Go, but had to give up on Rust because the paradigms in Rust are very different from the languages I am used to (mostly C). I will invest more time in Rust because I like the concepts baked into Rust (and as a replacement for the things I use C for), but it's going to be when I get a lot more free time. BTW, if anyone knows of a good online class teaching Rust, please let me know.