top | item 10863114

Why I love Rust

156 points| vasuadari | 10 years ago |speakerdeck.com

154 comments

order

middleclick|10 years ago

I want to spend at least 3-4 months learning a new language but just can't figure out if I should spent time learning Rust or Go. I am thinking more of it from a career perspective than interest.

pcwalton|10 years ago

Speaking as someone who has used both languages, I think you should learn both if you can. Rust will give you experience with low level systems programming (memory management, parallelism, etc.) Go will give you experience with network-facing backend code. Both languages will teach you concurrency.

Go is significantly more popular than Rust. But if what you want to learn is a popular language, you shouldn't be looking at either Go or Rust.

Disclaimer: I'm a Rust developer.

rjayatilleka|10 years ago

I think you should learn Rust, because there are actually things there that you can't learn about in other languages.

1. How to manually manage memory more safely with aid from a borrow checker. 2. If you don't already have experience with an ML/Haskell descent language, it will teach you about more powerful static type systems. 3. General low-level programming concepts that you wouldn't know without experience in C/C++.

Whereas Go doesn't really have much to teach you. The community says it themselves: Go is a very simple language. Even if you needed to learn it for a job, onboarding new workers onto a Go project is really easy. So I don't think you'd add much to your resume just by tacking Go onto the list of languages you know. What Go can teach you about:

1) CSP - Communicating Sequential Processes. I believe this is the concurrency model behind goroutines and channels. But you can learn about CSP in other languages.

hellofunk|10 years ago

I actually think you'd go far to spend 3 - 4 months learning C++. Almost every language you can likely encounter in your career will use some feature that will get introduced to you in C++, especially modern C++, and, almost any language will be easier to learn and use after first going through a C++ learning curve.

Besides, C++ is still the big player, more than all others. Even Apple's new language Swift is written in C++. It's a good language to know something about.

It also sets you into a different category of programmers, from what I have found recently, since C++ techniques are not taught much in college programs any more (based on my conversations with recent CS grads), which really surprises me. It's a special skill that would set you apart if you know it.

mcpherrinm|10 years ago

While I'm bullish on Rust being a big language in the next few years, there's not much production use yet -- it's still pretty immature from a production tooling point of view.

Go, on the other hand, has a lot of adoption. So if you're looking for a language to use on the job today, it's gonna be Go.

curun1r|10 years ago

Disclaimer: I say this having spent much of last year learning Go and the last couple months learning Rust. I'm a big fan of both languages. I see Go as my go to language for more situations right now, but I think that once Rust has matured a bit more, I'll choose it for more and it will probably become more useful to me than Go. I doubt I'll ever get to the point where I'd choose it for everything over Go, but I can see that possibility.

That said, if you haven't already, I think you should learn Haskell instead. Learning Haskell, for me, was the biggest departure from my previous programming experience. It forced me to re-examine more of the things that I thought I knew about organizing my thoughts into a program. And while I don't feel that I ever really got good at Haskell, I feel that my time learning Go and Rust has been so much more valuable for having learned Haskell first.

It's very unlikely that you'll find a job programming Haskell...there are a few, but not many. But I feel confident in saying that learning Haskell will make you a better programmer in whatever language you do end up getting paid to write.

That said, if the choice is really between the two, I'd probably say learn Go. 3-4 months into programming Go and you'll probably be quite adept with it. 3-4 months into programming Rust and you may just be getting past the phase where it takes you 10 minutes of fighting the borrow checker to get relatively simple code to compile. I'm a couple months into Rust and I feel like I'm a least 6 months away from being productive with it.

thegeekpirate|10 years ago

From a career perspective, Go is currently the language you'd want to learn. Here's my list of some of the largest companies from a few months ago, excluding a bunch of Chinese ones I haven't heard of (of which there are many, considering that China is most likely Go's largest adopter (http://herman.asia/why-is-go-popular-in-china)).

Walmart, Apple, Facebook, eBay, Intel, Google, Mozilla, IBM, Microsoft, DigitalOcean, Zynga, Yahoo, BBC, VMware, Uber, GitHub, Getty Images, Twitter, Stack Exchange, Docker, SpaceX, Baidu, Qiniu, Imgur, CloudFlare, Bitbucket, Dell, Twitch, Dailymotion, bitly, Cisco, Verizon, Dropbox, Adobe, New York Times, HP, Canonical, Cloud Foundry, 99designs, BuySellAds, CoreOS, MongoDB, Basecamp, Rackspace, Booking, MalwareBytes, Kingsoft, Iron.io, OpenShift, Heroku, Square, Spring, Tumblr, VMWare, Symantec, Comcast, CBS, SendGrid, Digitally Imported, Pivotal, Couchbase, Koding, Shopify, Shutterfly, MaxCDN, Linden Lab, SolarWinds, IMVU, EMC, Teradata, and I'm sure many more which I'm unaware of, are all using Go to some capacity.

namelezz|10 years ago

Career wise, you should pick up popular languages, Java/C#/Python/Ruby/JavaScript.

Between Go and Rust, I think you should pick Go because there are a significant number of developers from Python/Ruby/JavaScript enjoying programming Go. Many startups start using Go[1] and couple of universities use Go in their classes[2]. Rust targets system development primarily occupied by C/C++ developers. Many still prefer C++ and I rarely see Rust job.

[1] https://news.ycombinator.com/item?id=10822019

[2] https://github.com/golang/go/wiki/Courses

Edit: I may be biased since I enjoy programming in Go.

loudmax|10 years ago

Go is a lot easier to learn than Rust, and there are jobs programming Go available now. This means that you could be working professionally with Go quite soon.

Rust is more challenging, and there aren't many jobs available yet. But there is a possibility for Rust to displace C/C++ for certain classes of applications, and that is a very big deal. Also, skill in a more difficult language is a scarce commodity. If Rust does take off and you're one of the relatively few people who understand it well, this would make make you quite valuable.

bjz_|10 years ago

One perspective could be that Rust is the more interesting talking point, even if you don't work on it in the job you are actually applying for. But if you purely want to get a job in one or the other, Go is currently much more widely used. I have hopes that this year will see a large jump in industry adoption of Rust, but that still remains to be seen.

But as others have said - pick the one you think you'd enjoy the most. Learning anything is good. And why not try a bit of both?

(Spoken as a contributor to the Rust ecosystem)

jonesb6|10 years ago

Learning a single tool is a small value proposition to an employer. Showing an employer that you can learn a tool quickly and effectively is a large value proposition. Either one would do that.

Pick the one you enjoy most.

dozzie|10 years ago

If you don't have many languages under your belt (and wanting to spend 3-4 months and asking for advice what to choose suggests that), you don't really want to go with a language that popped semi-stable only several months ago, hence will be most probably a subject to deep changes (either in the language itself or in standard library). Rust is not (yet) the way to go.

TheDong|10 years ago

It's unfortunate that they're often talked about as comparable things (as Go vs Rust) because they're totally fundamentally different languages, including what spaces they target.

I think part of this is due to Google initially trying to position Go as a systems programming language and sorta like an easier C.

In reality, Go is so far distant from C or C++ that it would be better to describe it as Java related honestly.

The real question is what do you want to do or why do you want to learn.

Do you want:

* Something where you can quickly produce working code

* Something with a large, complex, and questionable quality ecosystem (as ruby/python have, but a smaller scale)

* Something that's pragmatic, but not elegant

* Something that's well suited for writing a webserver, cli tools, or daemon

* An ecosystem of people who do not like complicated languages and rarely talk about complex language-theory concept

* Something that fills a similar role to python, ruby, java

* Something that has a massive foothold in the docker/container ecosystem

* A language driven by a semi-opaque "open source" process with a big company and closed doors at times

* Really easy to use concurrency (but also easy to shoot yourself with)

* Nice editor integration, autocompletion, etc.

Well, Go wouldn't be bad to learn

Do you want:

* Something where you'll actually learn new concepts, ideas, and be challenged in some ways

* A fledgeling library ecosystem where the libs that exist are decent quality, but most just don't exist

* Lots of opportunities to contribute

* A community-driven project where your opinion can make real changes happen

* A powerful macro system

* Actual type safety! With real algebraic types!

* No GC pauses

* Elegant error handling and abstraction powers

* Something it's hard to write working code in, but once it compiles it's probably pretty good

* Something great for writing an OS or low level tools in, and mediocre for webserver, cli, etc currently

* Something to replace C++, possibly D, possibly ocaml

* A language that is technically an ML but doesn't feel like one

* A super-smart community willing to talk about some of the coolest topics in language design and CS

Rust could fit for you

Grain of salt, I write lots of Go and am working on getting to know rust better still.

To all the people saying "Go is used professionally, rust isn't, don't learn rust from career perspective"... there's another axis!

You also have to consider what skills you'll pick up with each. Learning Rust will improve your ability to write safe C++ and help you reason about some types of problems in all other languages, so even though rust itself isn't directly marketable, the skills you get will be helpful regardless.

Learning Go will help you reason about actors a little and some problems in other languages, but not nearly as many and, frankly, the community for Rust will teach you a lot more about everything.

pc86|10 years ago

What languages do you know currently? This will probably be an unpopular opinion but unless you know more than you can count on two hands, it's unlikely that Rust or Go will be give you the best ROI if your focus is career enhancement. The largest career ROI is probably in getting to advanced-intermediate level in a couple of the following (in absolutely no order, I intentionally put ones I don't know first):

- Python

- Ruby

- JavaScript

- PHP (especially for WordPress if your focus is web)

- C#/F# and the .NET ecosystem generally (especially for corporate)

- Java (especially for corporate)

- VB.Net if you want a government job

- C/C++

- Enough SQL to do whatever you want with the above

dagw|10 years ago

What kind of projects to you want to work on (from a career perspective)? Rust seems to trend towards more systems programming tasks while Go seems to trend towards network server projects.

matthewrudy|10 years ago

From a career perspective, I think it depends what you want to focus on in your career.

Go is actually very diverse in its applications, but certainly has the edge on rust for building web type applications.

I learnt Go in 2014 (largely by doing HackerRank puzzles) and its good to have it in your repertoire,

But right now I'm interested to learn Rust, because its a total different approach to anything I've ever done before.

unexpand|10 years ago

I learned Go but now I am more curious to try out Rust. I never ever thought I would be learning so many languages including Javascript apart from Java which I know. And I am glad that because of simplicity of Go and Javascript I am much more confident of my abilities to learn new things and comfortable to try out new languages, which wasn't the case before.

yoklov|10 years ago

You'll probably learn more if you choose Rust, but from what I've seen, way more companies use Go at the moment (since you mentioned this was from a career perspective).

timClicks|10 years ago

What I really love about Julia Evan's posts/talks is how refreshingly honest she is

nickpsecurity|10 years ago

Good presentation with a great, artistic style. Also liked her articles about speeding Java up and "A/A testing."

Far as this one, the only correction I have is regarding the slide that says you can't write an OS in Java. Several have been written w/ JNode and JX OS coming to mind immediately. JX is my favorite given its interesting architecture is mostly compatible with high assurance requirements. Just needs a high assurance implementation. A re-write of such an architecture in Rust might be interesting. Or SPIN OS as it was done in Modula-3 before.

mike_hearn|10 years ago

Yes indeed, and of course we must not forget Singularity/Midori which were implemented in a derivative of C# and .NET

I'd really like an OS built this way to become competitive. 64 bit flat address spaces and fully type safe designs really let you simplify things a lot in some fundamental ways. And you'd be able to run existing Java desktop apps without much in the way of porting effort.

Unfortunately all the Java OS's out there are hobby/academic projects that never got very far beyond a basic window manager.

dplarson|10 years ago

Another great piece of content from Julia Evans :)

n0us|10 years ago

I like the idea of rust but what does this cartoon have to do with anything? Am I missing something?

tux|10 years ago

This should be made into comics strip "RustOS" ^_^ Thanks for fun read.

jokoon|10 years ago

I know C++, and have never encountered the 'let' keyword, until I tried some haskell.

What does let mean ?

icen|10 years ago

It just means to bind a variable:

    let x : u32 = 0;
In Haskell, it's used for temporary definitions, or pure definitions in do blocks:

    let f = \x -> x + 1 in f 2

bsaul|10 years ago

[deleted]

loaaa|10 years ago

Rust is Pyramid scheme