
Ask HN: Go or Rust, which one should I learn first? - throwaway2016a
Some background: I work mostly on middle-tier web applications. Usually micro-services. Either REST APIs (internal and external), blockchains, or event bus systems.<p>My bottlenecks are typically IO (usually disk, raw TCP, database, or HTTP&#x2F;S) and memory (usually caching and filters to limit IO).<p>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.<p>So my question is, if I want to learn another language should it be Go, Rust, or something else?
======
maxaf
Considering 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
What languages are similar to go? Elixir, Erlang?

~~~
maxaf
IMHO it's a weird cross between Python and C.

~~~
iends
Maybe, but the real value in Go to me is the concurrency model.

~~~
maxaf
For 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
If 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
One 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
You 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-
program...](https://www.quora.com/What-will-be-the-top-in-demand-programming-
languages-skills-frameworks-in-2016/answer/Joel-Johnson-1?srid=ieH) . 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
I 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.

------
adrianN
Why not both? "Which language is better" is mostly opinion based, so invest
two or three weeks in each language and decide for yourself.

~~~
throwaway2016a
Good 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.

------
ddorian43
So why do you want to learn a new language ? To fix your bottlenecks ?

~~~
throwaway2016a
Node.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
If you want to fix the bottlenecks check out seastar framework in c++.

~~~
partisan
The code reads very cleanly. I never transitioned to "modern" C++, but the
syntax here makes it look somewhat appealing.

