14 ms·
Why I love Rust
- middleclick 11y agoI 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.
- mcpherrinm 11y agoWhile 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.
- pcwalton 11y ago> it's still pretty immature from a production tooling point of view. I think that the production tooling for Rust is pretty good. For example, it has a package manager that everyone uses, with features like lockfiles that are specifically designed for production. Not many languages have this. It's undeniable that Go is more popular than Rust, but I think "production tooling" is not the reason.
- k__ 11y agoRust and Go are going into different directions. Rust is trying something new and Go tries to only use the stuff that worked in the past. It's no surprise that people favor Go instead of Rust. Also the last time I saw a video about a low level language discussion, only Rust had a dev there nobody really knows. C++, D and Go had prominent people speaking for them. The tooling really isn't the problem, as far as I can tell, Cargo is really one of the best package manager out there.
- nickpsecurity 11y ago"Also the last time I saw a video about a low level language discussion, only Rust had a dev there nobody really knows. C++, D and Go had prominent people speaking for them." That has nothing to do with anything. "Rust is trying something new and Go tries to only use the stuff that worked in the past. It's no surprise that people favor Go instead of Rust." That's a good point. Anyone doing something critical wants low risk. Using a proven tool or one with proven concepts is lower risk. Go's methods were proven in Pascal, Oberon, etc. So, Go is less risk. Not to knock Rust in any way with the above. Might be safer in long run due to design and improving toolchain. However, there is a risk perception and a real issue of new concepts taking time to spot then eliminate problems. So, I encourage Rust for systems use on less critical stuff right now but was shocked Dropbox uses it in storage functions.
- pcwalton 11y ago> Go's methods were proven in Pascal, Oberon, etc. So, Go is less risk. Totally disagree. Rust's ideas are tweaks of decades-old research. These tweaks are what make it interesting and constitute research in their own right, but Go did that too with their tweaks to CSP and interfaces.
- nickpsecurity 11y agoYou disagree that the basic functionality of Go, including type and memory safety, have been proven by prior language and production deployments? That's my basic premise. If Pascal/Oberon-like languages and GC's are proven, then one that's very similar to them will likely maintain those properties and deliver the same results. That's supported by the number of amateurs that ported and re-implemented Oberon OS & compilers successfully in 6 months to 2 years at ETH. Whereas Rust uses a combination of proven primitives and exotic techniques to achieve its goals. The exotic stuff, integration strategy, and implementation are new territory that exposes a level of risk a tried-and-true method (eg knock-off Oberon) doesn't have. It's new and unfamiliar territory to programmers at large even if some methods were seen in academia (eg Cyclone). It must be shown to be effective in terms of daily usage, standard libraries, and tooling because it's such new and unfamiliar territory. When it is, as I have confidence in the team(s), it will then have a different argument where it eliminates way more risks than it introduces. Already has it at application level if compiler is robust. Overall thing needs more deployment, though, so people can see if it lives up to it, how much, and in what scenarios. That's the risk perception I'm talking about. Right now, it's a big unknown to many outsiders compared to traditional languages and platforms.
- Animats 11y agoGo is really easy to learn if you're coming from a scripting language. It's used for a lot of server-side processing. It's probably more immediately useful than Rust if you want to get work. Rust is elegant and the future of serious programming, but not mainstream yet.
- steveklabnik 11y ago> there's not much production use yet I can't wait for a few weeks, when Dropbox should hopefully be giving a status report on how their new production deployment is going.
- thegeekpirate 11y agoFrom 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) 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.
- veidr 11y agoHN didn't like your link touching the parens: http://herman.asia/why-is-go-popular-in-china http://herman.asia/why-is-go-popular-in-china
- thegeekpirate 11y agoAh, cheers for the correction, it's unfortunate I can't edit it =(
- jonesb6 11y agoLearning 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.
- rjayatilleka 11y agoI 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.
- threatofrain 11y agoI've only started the read the canonical Go Programming Language book, but I believe that Go also permits shared-memory concurrency, it just advocates for CSP harder.
- namelezz 11y agoCareer 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 https://news.ycombinator.com/item?id=10822019 [2] https://github.com/golang/go/wiki/Courses https://github.com/golang/go/wiki/Courses Edit: I may be biased since I enjoy programming in Go.
- clouddrover 11y agoThe TIOBE Index for January, 2016 has Java at number one. Rust is at 47 and Go is outside the top 50: http://www.tiobe.com/index.php/content/paperinfo/tpci/ http://www.tiobe.com/index.php/content/paperinfo/tpci/
- namelezz 11y agoGo is probably a difficult term for TIOBE to get it right.
- thegeekpirate 11y agoIt absolutely is, but there's even more to it than that. From their documentation (http://www.tiobe.com/index.php/content/paperinfo/tpci/programminglanguages_definition.html http://www.tiobe.com/index.php/content/paperinfo/tpci/progra...): "In order to filter out false positives, two mechanisms are used. First of all a confidence is defined for a language. By default the confidence is 100%, but for some difficult search queries such as "Basic Programming", the confidence will be lower. Apart from the confidence, sometimes also exceptions or mandatory additions are used to weed out false positives." What they do is that add the term "+Google" to the search terms, yet for the other incredibly popular word "Rust", they don't add "+Mozilla". TIOBE is laughable.
- Animats 11y ago
- pcwalton 11y agoSpeaking 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.
- fmstephe 11y agoThis is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.
- derefr 11y agoI think the reasoning behind the debate is that, together, they mostly obsolete C/C++. Go takes the high-end and Rust takes the low-end, and there's no niche left for C to occupy in the middle. I guess the real answer is, if you want to learn "the language that people will be using instead of C in ten years"... learn both of them.
- 0xFFC 11y agoI don't think so. Of course, there is space for Rust and Go. But that does not mean there will be no niche for C and C++. That is simply not correct. Ignoring C and C++ mean you are ignoring maybe billion $ industry around them . and That is simply wishful thinking.
- ybx 11y agoSure, but you could argue the same for things like COBOL
- kamaal 11y ago>>Ignoring C and C++ mean you are ignoring maybe billion $ industry around them Right, very difficult to move the inertia in any direction. The same is true about Java too. But there are fewer reasons for any starting a new project to do it in C or C++. Newer stuff replaces older stuff, Heck when C came along, there were languages with billion $ industry around them. C replaced them.
- hellofunk 11y agoI 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.
- pcwalton 11y agoThis is a weird answer to the question, especially since Rust very probably has whatever "modern C++ techniques" you were thinking of.
- hellofunk 11y agoI disagree. As others have pointed out, the demand for C++ jobs is still much higher than Rust jobs, so I think my answer still stands as a way to set yourself apart when thinking of a new language to spend a few months on. Ideally, one would learn Rust and C++ both and see how they differ, and why.
- pcwalton 11y ago> I disagree. As others have pointed out, the demand for C++ jobs is still much higher than Rust jobs, so I think my answer still stands as a way to set yourself apart when thinking of a new language to spend a few months on. It's not going to be a particularly interesting thread if everyone who works in a language that trends higher than Go on Google chimes in to say "you should learn my language instead, because it's more popular". > Ideally, one would learn Rust and C++ both and see how they differ, and why. Aside from uninteresting language-specific details, C++ essentially doesn't teach you anything that Rust doesn't.
- bjz_ 11y agoOne 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)
- l1ambda 11y agoInteresting point there. All things being equal, I would favor someone who is learning Rust over someone who is learning Go--even if I were hiring for a job that involved writing Go!
- TheDong 11y agoIt'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.
- loudmax 11y agoGo 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.
- dagw 11y agoWhat 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.
- dozzie 11y agoIf 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.
- krylon 11y ago> Rust is not (yet) the way to go. Not sure if that was intended, but that was one epic pun!
- steveklabnik 11y agoRust is more than semi-stable: we take backwards compatibility very seriously. It will not be subject to deep changes from here on out, or at least, those changes will not break existing things.
- dozzie 11y ago> we take backwards compatibility very seriously. You're yet to display that. Half a year is too short time to give that confidence.
- steveklabnik 11y agoTheres two components of "display that": process and follow through. On the first point, we've set up a lot of tools and process to deal with stability, including testing releases against all open source code in existence. It's not perfect, but it does demonstrate commitment. The second is the actual follow through. Due to said tools, we can calculate exactly how good we've done at it: so far, it's something like 97% of all code that was ever published still builds with 1.5. I'm on mobile so I don't have the real number on me. And that breakage was due to soundness updates, which we introduce over multiple releases, starting with warnings, so there's time to adapt. Yes, it's early days, but that doesn't mean that you can't say anything.
- curun1r 11y agoDisclaimer: 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.
- oever 11y agoI've programmed only tiny bits in Go and Rust, so I will not comment on those languages. My main programming languages have been C++, Java, JavaScript and XSLT. Going from that background to Haskell is mindblowing. The language is very clean and there is very little mental capacity needed for worrying about errors because many errors that are possible in other languages are ruled out entirely or hard to make in the first place. Currently, I'm writing a website with Yesod. In Yesod, the URLs on the site are grouped in types and database queries are constructed from these checked types. Any change in database scheme will simply give a compile error. Rust also sounds attractive, but I think the web stack is not as nice as Yesod yet.
- commentzorro 11y ago> 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. This exactly is why I can never get past the first couple weeks of playing with Rust. Every few months I revisit it and every couple weeks after that I put it aside again. When I was first learning C++ I spent a huge amount of my time inside the debugger trying to figure out why a pointer wasn't ... pointing. There was always a reasonable explanation that way my fault and if I had just understood what my code was really doing I would have coded things right and it wouldn't have crashed. Now we have Rust that essentially takes away that entire problem. Just wipes it out by way of a clever compiler. Only now we substitute this same learning curve "debugging" the compiler rather than debugging memory space. (Probably a better trade-off in the long run. Rust sort of bets on that being true anyway.) Go does not suffer from either of these traits. For me, Go is not often a "fun language" to code in but it's eminently practical and is remarkably fast to pick up for what it does express. I've ported a couple pieces of C# application systems to Go and they've worked really well. But it's kind of a grind unwinding the higher level abstractions from C# into the more primitive Go space. I wish there was some way to bury Rust's borrow checker for those parts of an application where you don't want to care about it and then surface it gradually when you do want it. Because the elegance of the rest of the language is what pulls me back every few months.
- matthewrudy 11y agoFrom 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.
- matthewrudy 11y agoFrom 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 in 2014, 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.
- yoklov 11y agoYou'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).
- unexpand 11y agoI 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.
- pc86 11y agoWhat 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
- dplarson 11y agoAnother great piece of content from Julia Evans :)
- timClicks 11y agoWhat I really love about Julia Evan's posts/talks is how refreshingly honest she is
- bsaul 11y agoShe got a job offer from apple kernel team just because she tried and failed to write an OS for a few weeks ?? I don't want to sound misogynistic, but could this be related in any way to some apple policy of trying to recruite female engineers ? Or is it so hard to find people willing to work on this part of the stack ?
- n0us 11y agoI like the idea of rust but what does this cartoon have to do with anything? Am I missing something?
- steveklabnik 11y agoIt's a presentation.
- jokoon 11y agoI know C++, and have never encountered the 'let' keyword, until I tried some haskell. What does let mean ?
- icen 11y agoIt 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
- loaaa 11y agoRust is Pyramid scheme
- tux 11y agoThis should be made into comics strip "RustOS" ^_^ Thanks for fun read.
- nickpsecurity 11y agoGood 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 11y agoYes 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.
- nickpsecurity 11y agoYeah, that is unfortunate. JX OS at least might be useful for single or minimal purpose appliances. Maybe soft-real-time or non-real-time embedded, too. Singularity, esp Midori per Duffy's blog, were the biggest pushes into an inherently better OS's for desktops. I hope we see more Midori move into Windows or other tech.