Rust in Motion
Full transcript734 wordsShow
Welcome to Rust in Motion 1, Getting Comfortable with Rust. Rust is an exciting new language aiming to be an alternative to C and C++, with the same performance characteristics of those languages, but with certain classes of common bugs eliminated at compile time.
Rust is a general purpose language, but it's especially good in situations where runtime speed is needed, memory safety is required, and you want to take advantage of multiple processors. Some areas in particular where Rust is poised to do well are high performance web services, web assembly, command line applications, and embedded devices.
Rust started as a Mozilla research project, and a significant example of production Rust usage is Firefox.
Mozilla has been using Rust to create an experimental browser called Servo, where everything is parallelized. Parts of Servo are now being incorporated into Firefox. The Firefox Quantum release included Servo's CSS rendering engine. Rust was a big part of the performance improvements Firefox made in that area.
Check out the Rust Friends page to see a list of companies using Rust in production for everything from cryptocurrency to DevOps to big data.
Speed, safety, and fearless concurrency are the benefits of Rust. One of the downsides of Rust is that it has a reputation of being hard to learn, and that's why we're here. I'm Carol Nichols. I'm a Ruby developer who got into Rust to write better performing code that wasn't C.
I'm on the Rust Core team. I'm the co-author of the Rust programming language book, and I maintain Quinceo, the Rust package registry. Rust is especially exciting to me because I think this is an opportunity for the software industry to start making some new mistakes, instead of the same memory safety problems that lead to security vulnerabilities that continue to happen over and over.
And I'm Jake Goulding. I'm a full stack developer from C to Ruby to JavaScript. I'm a member of the Rust infrastructure team. I'm the number one answer for Rust questions on Stack Over flow, and I maintain the Rust playground at play.rustlang.org. Some of my previous work involved heavy XML processing using libxml2.
I started programming in Rust because I believe it is capable of improving the safety and correctness of things like XML processing without losing any of the performance we expect from a system's programming language.
We founded Integer32, the world's first Rust focused software consultancy, and we love helping people learn Rust. I'll be teaching units 1 and 3. And you'll hear from me for units 2. 2 and 4. Rust has quite a few concepts that are different than most other mainstream languages today.
If you try to jump into the deep end with Rust without becoming familiar with these concepts, it can be a frustrating experience. We're going to go through these concepts so that you're ready to think in Rust as you continue on your Rust journey.
In Unit 1, we're going to introduce basic syntax for constructs that you've likely encountered in other languages, like variables, data types, and functions. But we'll be concentrating on what makes them different in Rust. In Unit 2, we'll cover the concepts of ownership and borrowing.
These concepts permeate all Rust code, and they help ensure memory safety in Rust. In Unit 3, we'll talk about Rust's strategy for error handling. Rust forces you to consider all the ways your program might fail, which can be frustrating while prototyping, but leads to more robust production code.
In Unit 4, we'll concentrate on lifetimes, the mechanism that the compiler uses to ensure all references are valid. You can write a lot of Rust code without needing to worry about explicit lifetime annotations, but we don't want them to be intimidating if you encounter them in error messages or when reading other people's code.
We'll demystify the concept and go through scenarios when lifetime annotations are needed. A theme in all of these units is that the Rust compiler is here to help you write better code. That means it's very common to get compiler errors when you're working.
Even experienced Rust programmers get compiler errors all the time. People have put a lot of work into making the messages understandable and helpful, so we'll be intentionally causing errors throughout the course to get experienced reading and responding to errors. Let's install Rust and get started!