This looks like a great resource, starred and upvoted.
I'm planning to learn Rust next, going to start in a week after a job interview I had already lined up at Google.
I worked with many languages professionally (JavaScript, TypeScript, Java, Python, Go, and now Dart) and many others at the university (C, C++, C#)...
...and Rust is very appealing to me. It's a modern language where the dev tools are straightforward, no need to deal with learning 30 years of legacy conventions, great performance that's on pair with C/C++, yet, at the same time high level and easy to read and reason about. The language is still young enough to make a dent in the ecosystem and build stuff for fun without people whining about JavaScript fatigue. It's versatile, so it can be used (at least theoretically) for web backend, frontend, desktop apps, command line tools, systems programming. It has all the good parts from OOP and FP.
Yes, I'm at least partially responsible for having "xyz rewritten in Rust" almost every day in the top list on HN.
One thing in a bit worried about is the job market, I've been paying attention to job adverts for months and I didn't see many companies that I'd like to join that use Rust in my area (Germany).
Learning it and doubling down on Rust feel like a gamble, but at the same time, I can't imagine that Rust will not be one of the most important languages of the next decade.
My impression is a bit different. I know a bit of Rust, and used to know C++98 inside out, but moved to more functional languages 15 years ago.
I recently added a Rust keyword to my LinkedIn profile and Who's Hiring threads, just to test the waters. Many EU companies of all sizes got in touch with really interesting proposals.
It's a systems programming language, so there are lots of problem domains it can cover.
Rust is mostly a systems programming language - like C++. The amount of jobs that require application development in such languages is a lot smaller than e.g. the amount of jobs for generic frontend (Javascript/Typescript) or backend development, since most businesses don't need to build an operating system, database or embedded system. That's why the job market for C++ was even small before Rust even showed up.
Of course one can also use Rust for applications which previously used Java, and still benefit from a stricter type system and a potential efficiency improvement. But the selling proposition becomes a bit tougher. Con's for adopting Rust are the higher complexity, and a potentially reduced developer ecosystem for particular domains which have a ton of Java/C#/Go/Javascript libraries.
It’s a complicated language, just like C++. A lot of that seems like accidental complexity from wanting to encode various attributes of algorithms and data in the type system. If one wants to use a straightforward low-level language, Rust is not it. Judging by its evolution, it will never be that either.
I can’t say I’ve ever known Rust very well, but I knew the basics and decided to wait and see before investing more time until there’s a clear sign that the language is becoming popular outside blockchain.
I don’t regret learning Rust, but haven’t seen any benefits either given my many years of C++ experience.
This is a good list, although it contains a lot of redundancy - at least, the first "how to learn" links - the youtube videos cover the same material over and over again. They are good - you may not need to watch every one in order as the author suggested.
My approach has been considerably, uhh.. lazier, if you will:
I just read through the rust book available on http://rust-lang.org.
It is easy to follow although, sometimes it doesn't fully explain the "why" behind certain things to idiots like me. For that, I turned to a quick online search, which brought up helpful blog posts, Reddit and Stack Overflow posts.
Thats it. Next, I'll try to wrap my head around Actix to create a web server.
Yeah, not really. The only big changes to the language core were non lexical lifetimes, match ergonomics, lifetime elision, auto-deref, and async, although all of these are already so old now that I wouldn't consider them constituents of modern Rust; they're just (unqualified) Rust at this point.
Releases tend to bring some minor improvements like functions you wished had always existed or making non-const functions const, but that's pretty much it. Rust is a remarkably stable language.
I think so? Modern c++ (c++11) came 13 years after c++98. Rust has been released for close to or longer than that depending on your definition of released.
Rust has improved in a number of significant ways since 1.0, those improvements are things that make it easier to work with in a number of ways. One way to think about this topic is if you found the language too hard in the beginning you may find it easier to work with now.
Also, since it was released a lot of patterns have evolved to work around the restrictions the language puts in place, and those are good to learn.
sort of? when i first learned it there was no async/await, no `?` operator for simplifying error handling, and lifetime elision was a whole other story, and you seemed to need lifetimes for any reference (can't remember but it's much better now). But is that really enough change for a new kind of rust (instead of just say, learning async rust vs normal rust?). not sure.
Editions are only necessary for otherwise-backwards-incompatible changes, to avoid breaking existing code. Even relatively major language features like the ? operator were shipped without an edition bump. But for example I think the await keyword itself was added as part of an edition, because it was incompatible with existing code that had a method named await.
The messaging around the 2018 edition was a little different here, with some attempts to use the edition release as an opportunity to advertise and summarize all the features that had shipped since 2015. But I think folks decided that was confusing, and with the 2021 edition the messaging was toned down.
Yes, that's a fair point about the actual purpose of editions being to handle forwards-compatibility.
Informally though, I think there are certainly a subset of people that use "Rust 2021" to mean all of the features included up to that point, even if it's not the precise definition.
My first piece of advice is to just start writing code.
If you are not specifically interested in super high performance systems level code, my second piece of advice would be to write code that avoids lifetime annotations until you get the basics of the borrow checker down.
For me, this meant writing a gRPC API with Rust using `tonic` with a `diesel` based persistence backend and observability with `tracing` and `opentelemetry`. This gives you a good survey of the basics and you'll learn about all of the core traits and language features in the process.
Just start coding while avoiding lifetimes is great advice, but that's easier said than done. Rust makes some hard things simple and exposes hidden complexity in things you thought were simple.
Maybe I'd reframe it as "just start writing code, and use RC<> liberally to avoid lifetimes until you get a handle on them."
Yes - that's also good advice (using Arc/RC to liberally avoid ownership issues). I've personally had good experiences with async, but I can also see how that could be challenging depending on the background you are coming from.
Slightly off topic question/comment: You are running an async server, together with a blocking database client? That sounds more like a very tricky place ot get started. Are you dispatching all your database queries into an extra threadpool?
This list undoubtedly took a lot of effort to compile, but I fear it might intimidate a newbie.
I’d say the guide to learn modern rust could be much simpler - read The Book, write some code, and listen to Clippy (the linter) and apply rustfmt regularly.
Almost all Rust code out there looks similar to each other because they pretty much follow this process - follow the standard linter and code formatter. The best part is, each Rust release introduces few changes so it’s easy to stay in tune with best practices.
I love Rust and this is a great resource that I will certainly refer too, but I wonder if there is a little too much Rust language anxiety since we have a so many articles on "how to X in Rust". Doesn't that point to some complication if the thing being implemented is necessarily so tightly coupled with the language its implemented in (ie in a Write TCP in Rust type resource) that you need a special resource on how to to do it? There are some exceptions where like trying to do Linked Lists in Rust where the language will do everything it can to stop you, merits its own article.
The substring section[1] looks a bit weird though. If you're learning Rust, diving right into how to work with char indices instead of byte offsets does not feel like the right thing to cover right away. You might really need that, but chances are you don't and would be much better served by a section that talks about how you probably don't want char offsets at all. But even that doesn't seem like you should whack a beginner with right away unless they have a specific hang-up on it.
Beginner string stuff should be talking about string representation and going over the &str and String APIs. And depending on how early you get to it in the overall tutorial, probably using it as a springboard to talk about lifetimes.
But writing code so you can go out of your way to do something that is probably wrong in the first place? Noooooo.
Anyway, sorry to pick at this specific point, but the Gell-Mann amnesia effect comes to mind.[2]
I'd be really interested in a series that would go over how you might write code in one language (say c++, java, python, whatever), how you might try to write it in Rust and the problems it entails, and then how to write it properly.
I haven't written Rust in 3-4 years, and trying to get back into it is painful.
I've been meaning to dig my teeth into rust for a long time. JT's intro to Rust videos[1] are first on my list for when I can devote the uninterrupted hours.
It's a decent joke, but one of the reasons I only took up Go almost a decade after it got started was that I wanted to invest on a stable language ecosystem that wasn't after the fad of the week (like certain runtimes we all know).
I'm actually looking forward to Rust having a few more years under its belt so I can do more than experimentation with it (and yes, I've seen the Oxide stuff, and there is plenty we can call stable right now -- I just want it to be a bit more weathered...).
The weathering on the two languages seems fairly similar.
In fact it could be argued that Rust is more stable. Golang is talking about a breaking Go2, Rust has a fairly good forward compatibility story and plans.
I don’t think there’s any plan for a Go 2. I’m willing to bet we won’t see one in the next 10 years. The main feature that might have required breaking changes (generics) was introduced successfully without any breaking changes.
Rust has no plans for 2.0 either.
Both are stable languages that have been making steady progress.
They're out there! I found a gig at a startup not in the blockchain space working with Rust, but felt pretty lucky to find it. Most of the jobs are in crypto nonsense.
Many software companies started in the last 3-4 years revolves around the blockchain. These were free to choose the best language suited to their use case. Many chose Rust, first released 7 years ago and started gaining momentum 3-4 years ago. It had good performance, fewer foot guns, good type system so it made sense for them.
Companies that started before Rust gained critical mass might already have significant investments in one language and don’t want to rewrite. This is the majority of companies. Let’s say GitHub won’t rewrite their main Ruby application, but if they were writing a new code search backend, they might choose to write that in Rust. The majority of GitHub devs would continue to write Ruby.
That means older companies (started before blockchain was hot) are going to skew towards older languages while newer companies are more likely to adopt newer tech.
Is this a normal amount of studying to be considered an expert in a language? Like not a world authority, but an expert as far as professional software development hiring.
what word are people going to use after modern. it's kind of like using the word new. we don't use modern rust around here anymore, just modern new new modern rust.
A lot of people are getting really hung up on this. "Modern Rust" is just current Rust. Once Rust moves on, that will be modern Rust and what we once called modern will no longer be modern. Like all things. You might as well get upset that somebody said something will happen "tomorrow" because in 24 hours it won't be "tomorrow" anymore.
It's more than a decade old, and I have learned Rust on 3 occasions - first when I worked at Mozilla and heard about Rust as a project Graydon was working on at either a lunch and learn, or just chit chat around the Mozilla Vancouver office. Later I learned how to write some tools in Rust after not touching it in a few years when I changed companies. Finally, a year and half ago I had to actually start working in Rust on the regular as a dev and security engineer at Fastly.
There were substantial changes in work flow and tooling each time I dove in and learned the correct way to do things.
I'm planning to learn Rust next, going to start in a week after a job interview I had already lined up at Google.
I worked with many languages professionally (JavaScript, TypeScript, Java, Python, Go, and now Dart) and many others at the university (C, C++, C#)...
...and Rust is very appealing to me. It's a modern language where the dev tools are straightforward, no need to deal with learning 30 years of legacy conventions, great performance that's on pair with C/C++, yet, at the same time high level and easy to read and reason about. The language is still young enough to make a dent in the ecosystem and build stuff for fun without people whining about JavaScript fatigue. It's versatile, so it can be used (at least theoretically) for web backend, frontend, desktop apps, command line tools, systems programming. It has all the good parts from OOP and FP.
Yes, I'm at least partially responsible for having "xyz rewritten in Rust" almost every day in the top list on HN.
One thing in a bit worried about is the job market, I've been paying attention to job adverts for months and I didn't see many companies that I'd like to join that use Rust in my area (Germany).
Learning it and doubling down on Rust feel like a gamble, but at the same time, I can't imagine that Rust will not be one of the most important languages of the next decade.