{"id":511126,"date":"2024-09-20T12:14:38","date_gmt":"2024-09-20T11:14:38","guid":{"rendered":"https:\/\/blog.jetbrains.com\/?post_type=rust&#038;p=511126"},"modified":"2026-02-05T15:04:40","modified_gmt":"2026-02-05T14:04:40","slug":"how-to-learn-rust","status":"publish","type":"rust","link":"https:\/\/blog.jetbrains.com\/ru\/rust\/2024\/09\/20\/how-to-learn-rust","title":{"rendered":"How to Learn Rust in 2025: A Complete Beginner\u2019s Guide to Mastering Rust Programming"},"content":{"rendered":"\n<p>So, you&#8217;re thinking about choosing Rust as your next programming language to learn. You already know what it means to write code and have some experience with at least one programming language, probably Python or JavaScript. You\u2019ve heard about Rust here and there. People say it\u2019s a modern systems programming language that brings safety and performance and solves problems that are hard to avoid in other programming languages (such as C or C++). Someone mentioned that Rust\u2019s popularity is growing. You regularly see blog posts describing how Google, Microsoft, Amazon, and other big players in the field have already adopted it. Other mentions indicate that adoption in various industries is still growing. However, it\u2019s also been whispered that Rust is not the easiest language to learn, so you worry about whether you can handle it.<\/p>\n\n\n\n<p>If you recognize yourself in the description above, this post is for you. I aim to answer all the questions you might have about approaching Rust. I\u2019ll first discuss why it\u2019s beneficial for software developers to learn Rust and compare it with other competing programming languages. Then, I\u2019ll explain which Rust features and concepts are the most important to remember. These features make Rust a significant development in the field of programming languages. With that in mind, I\u2019ll continue with recommendations for getting started, provide you with educational resources (books, guides, tutorials, and courses), and suggest the most efficient learning paths. You might encounter some challenges while learning Rust, so I\u2019ll offer guidance about overcoming them. Finally, I\u2019ll cover areas of software where Rust truly shines and show how you can approach them.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why learn Rust in 2025?<\/h2>\n\n\n\n<p>Developer surveys show that Rust is one of the top 12 programming languages heavily used in the IT industry. According to survey data, 10\u201313% of software developers work with Rust regularly. More importantly, if we look at those who are only learning to code, Rust\u2019s share reaches 11\u201318%. Rust learners are a powerful driving force for growth. For example, <a href=\"https:\/\/www.jetbrains.com\/lp\/devecosystem-2024\/\" target=\"_blank\" rel=\"noopener\">The State of Developer Ecosystem Survey<\/a> <a href=\"https:\/\/www.jetbrains.com\/lp\/devecosystem-2024\/#pl_dynamics\" target=\"_blank\" rel=\"noopener\">demonstrates<\/a> that Rust has steadily grown over the last six years and doesn\u2019t show any signs of stagnation:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1534\" height=\"1406\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/Screenshot-2025-05-30-at-10.49.08-AM.png\" alt=\"Rust usage 2024\" class=\"wp-image-571625\"\/><\/figure>\n\n\n\n<p>Developer appreciation for Rust is also unbeatable. How do I know that? Well, the StackOverflow Developer Survey provides amazing proof:<\/p>\n\n\n\n<ul>\n<li>Rust continues to be <a href=\"https:\/\/survey.stackoverflow.co\/2024\/technology#admired-and-desired\" target=\"_blank\" rel=\"noopener\">the most admired language<\/a> in the developer community, and has been for many years in a row (eight years? nine years? No one remembers!).<\/li>\n\n\n\n<li>Those already working with Rust <a href=\"https:\/\/survey.stackoverflow.co\/2024\/technology#worked-with-vs-want-to-work-with\" target=\"_blank\" rel=\"noopener\">don\u2019t want to switch<\/a> to other programming languages.<\/li>\n<\/ul>\n\n\n\n<p>As a regular participant in Rust developer conferences, I can testify that this appreciation for Rust is evident. Rustaceans love Rust and have created one of the friendliest communities to participate in.<\/p>\n\n\n\n<p>On the other hand, the StackOverflow survey <a href=\"https:\/\/survey.stackoverflow.co\/2024\/technology#4-change-in-salaries-between-2023-and-2024\" target=\"_blank\" rel=\"noopener\">reports<\/a> a decline in median yearly salary over the last couple of years, but this trend is also seen with other mainstream programming languages. Despite growing adoption among top and mid-size IT companies, we have yet to see Rust adopted by myriad smaller companies, which could bring more Rust vacancies to the job market and make it less competitive than it is these days (see <a href=\"https:\/\/www.reddit.com\/r\/rust\/comments\/174rwyf\/rust_job_market_super_competitive_october_2023\/\" target=\"_blank\" rel=\"noopener\">this engaging discussion<\/a> for context).<\/p>\n\n\n\n<p>If we look at the language, features, and ecosystem, we immediately see where the numbers come from. Rust has been developed to provide memory safety and performance simultaneously. Unique choices made by the language designers ensure that you have fewer memory access errors in your code, making security breaches less likely. The price you pay for that doesn\u2019t come with performance penalties. So, what\u2019s the price then? Well, it\u2019s the time you, as a developer, spend persuading the Rust compiler that your code is truly safe. Once the compiler has agreed with you, you\u2019re safe. Memory safety and performance are extremely valuable: together, they provide a much smoother experience for those who use software solutions (which these days means everyone). Rust\u2019s standard library, other cornerstone libraries, and tooling also enhance the developer experience. For example, developing high-performance concurrent applications in Rust is not a big deal, as the ecosystem is mature and well-equipped to support such tasks.<\/p>\n\n\n\n<p>Developers also appreciate the wide spectrum of technology domains and industries where Rust knowledge is applicable. The most recent <a href=\"https:\/\/blog.rust-lang.org\/2024\/02\/19\/2023-Rust-Annual-Survey-2023-results.html\" target=\"_blank\" rel=\"noopener\">Rust Annual Survey<\/a> identifies the following such areas:<\/p>\n\n\n\n<ul>\n<li>Server-side and other backend applications.<\/li>\n\n\n\n<li>Cloud computing applications, services, and infrastructure.<\/li>\n\n\n\n<li>Distributed systems.<\/li>\n\n\n\n<li>Computer networking.<\/li>\n\n\n\n<li>Computer security.<\/li>\n\n\n\n<li>Embedded development.<\/li>\n\n\n\n<li>Game development.<\/li>\n\n\n\n<li>Web frontends (including WebAssembly).<\/li>\n\n\n\n<li>And many others.<\/li>\n<\/ul>\n\n\n\n<p>Of course, Rust is not the only programming language used in these areas. There are competitors in each of them. Rust is often compared to C++ or Go because they share many areas but differ in various aspects, including memory safety guarantees, performance promises, availability of tooling and libraries, language simplicity, and industry adoption. While Rust might be lagging in the last three categories, it works on par with C++ in terms of performance and makes it much easier to avoid memory access pitfalls and build error-free applications.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding Rust&#8217;s core concepts<\/h2>\n\n\n\n<p>Let\u2019s get a bird\u2019s-eye view of Rust and its features. Rust is neither an object-oriented nor a functional programming language. It doesn\u2019t feature classes and doesn\u2019t directly support object-oriented patterns. It can operate with functions as first-class values, but this ability is limited compared to full-blown functional languages (such as Haskell or OCaml).<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Writing code with functions, values, and types<\/h3>\n\n\n\n<p>Programs in Rust are structured as collections of functions combined in modules. Functions manipulate values. Values are statically typed, meaning every value or expression should have an assigned type at compile time. Rust provides both primitive and compound types (arrays and structs), and its standard library also provides many additional types for collections of values. Rust supports generic types, which makes it possible to avoid mentioning specific types and provide more general definitions. Rust also provides traits as collections of methods (i.e. functions) that can be implemented for specific types. Traits allow Rust to achieve the same levels of software abstraction as object-oriented languages that support inheritance and polymorphism.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Memory management<\/h3>\n\n\n\n<p>Rust\u2019s approach to memory management is based on the following principle: <strong>the Rust compiler must know the precise locations in the code where memory is allocated, where and how it\u2019s accessed, and where it\u2019s no longer needed<\/strong>. This knowledge allows for controlling memory access and freeing allocated memory automatically by inserting the corresponding instructions directly into the generated code, thus avoiding many common pitfalls other languages might be susceptible to. This approach differs from automatic memory management (as in JavaScript, Python, Java, or C#), where memory fragments that are no longer needed are detected at runtime and garbage is collected. As a result, Rust saves the time required to execute the corresponding algorithms at runtime and achieves both memory safety and performance.<\/p>\n\n\n\n<p>To be able to infer knowledge about memory access, Rust sets limits on what can be done with memory and defines strict rules that ensure correctness:<\/p>\n\n\n\n<ul>\n<li>Every memory fragment must be owned by a single variable \u2013 Rust\u2019s <em>ownership model<\/em> is based on this.<\/li>\n\n\n\n<li>Mutating a memory fragment requires exclusive access (as opposed to just reading the memory).<\/li>\n\n\n\n<li>Rust allows creating mutable and immutable references to memory fragments (borrowing them) but uses a <em>borrow checker<\/em> to enforce correctness (for example, prohibiting more than one mutable reference).<\/li>\n\n\n\n<li>The Rust compiler computes and checks <em>lifetimes<\/em> for every variable in a program from the place it\u2019s created to the place it\u2019s dropped (where it becomes no longer accessible).<\/li>\n<\/ul>\n\n\n\n<p>The compiler&#8217;s requirements can be too strict. This can be a common frustration, especially when learning the language: The Rust compiler may fail to accept a logically correct code fragment.<\/p>\n\n\n\n<p>To make these concepts a little easier to catch, let\u2019s discuss Rust\u2019s equivalent of the following Python program:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">def print_list(numbers):\n   for number in numbers:\n       print(str(number) + \" \", end=\"\")\n   print()\n\n\ndef add_one(numbers):\n   numbers.append(1)\n\n\ndef main():\n   numbers = [1, 1, 1]\n   print_list(numbers)\n   add_one(numbers)\n   print_list(numbers)\n\n\nif __name__ == '__main__':\n   main()<\/pre>\n\n\n\n<p>So, we have a memory fragment (Python\u2019s list) with three elements. We print it, add one more element, and print it again. We never mention any type here. Python doesn\u2019t need any sign of memory management in the program, although the memory must be allocated and freed at some point. Moreover, we pass around the <code>numbers<\/code> list easily without thinking about memory access control.&nbsp;<\/p>\n\n\n\n<p>The same code in Rust is different, not only in syntax but in the whole approach to types and memory management:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"rust\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Here we take a vector by reference (&amp;).\n\/\/ We are not allowed to mutate elements.\n\/\/ We don't take ownership; we just borrow.\nfn print_vec(numbers: &amp;Vec&lt;i32>) {\n   for number in numbers {\n       print!(\"{} \", number);\n   }\n   println!()\n}\n\n\n\/\/ Here we take a vector by mutable reference (&amp;mut).\n\/\/ We are now allowed to mutate elements and the vector itself.\n\/\/ We still don't take ownership; we just borrow.\nfn add_one(numbers: &amp;mut Vec&lt;i32>) {\n   numbers.push(1)\n}\n\n\nfn main() {\n   let mut numbers = vec![1,1,1];\n   \/\/ We pass a reference\n   print_vec(&amp;numbers);\n   \/\/ We pass a mutable reference\n   add_one(&amp;mut numbers);\n   \/\/ We pass a reference again\n   print_vec(&amp;numbers);\n}<\/pre>\n\n\n\n<p>It\u2019s instructive to explore these two code fragments and find similarities and differences between them by yourself. Even without understanding Rust, you might get a general feeling for it just by looking at this code.<\/p>\n\n\n\n<p>Despite passing references around, the numbers variable still owns the allocated memory. Rust defaults to read-only memory access, requiring explicit specification for write access. Rust also ensures the memory is freed after the last usage in the second call to <code>print_vec<\/code>.&nbsp;<\/p>\n\n\n\n<p>Here\u2019s a variation of the add_one function that takes over ownership of a vector and renders the whole program incorrect:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"rust\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">fn add_one_incorrect(mut numbers: Vec&lt;i32>) {\n\u00a0\u00a0\u00a0numbers.push(1)\n}<\/pre>\n\n\n\n<p>What\u2019s the problem? Well, after calling the <code>add_one_incorrect<\/code> function, the numbers variable no longer owns the memory; its lifetime has ended, so we can\u2019t print anything! The screenshot below shows that we\u2019re in trouble:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"2414\" height=\"1303\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/Screenshot-2024-09-18-at-18.19.01.png\" alt=\"\" class=\"wp-image-511178\"\/><\/figure>\n\n\n\n<p>Before introducing the incorrect version, Rust\u2019s borrow checker could ensure that passing references didn\u2019t bring any problems. After introducing an error, it\u2019s no longer feasible. The language&#8217;s behavior here exemplifies how memory access is under strict control.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Concurrency<\/h3>\n\n\n\n<p>Concurrency is the ability of a system to execute multiple tasks or processes simultaneously or in overlapping periods to improve efficiency and performance. This can involve parallel execution on multiple processors or interleaved execution on a single processor, allowing a system to handle multiple operations simultaneously and manage multiple tasks more effectively.<\/p>\n\n\n\n<p>Rustaceans often describe Rust\u2019s concurrency as fearless. Several factors contribute to this perception:<\/p>\n\n\n\n<ul>\n<li>The ownership model adds more control over sharing data between concurrent threads.<\/li>\n\n\n\n<li>Embracing immutable data structures simplifies the implementation of concurrent algorithms and contributes to thread safety.<\/li>\n\n\n\n<li>Message passing via channels adopted in Rust dramatically reduces the complexities of shared-state concurrency.<\/li>\n\n\n\n<li>Rust\u2019s approach to lifetimes and memory management generally makes code that works with concurrency primitives such as locks, semaphores, or barriers more elegant and safe.<\/li>\n\n\n\n<li>In many cases, Rust\u2019s approach to asynchronous programming makes it possible to avoid using complex concurrency patterns and enables you to write concise and clear code.<\/li>\n<\/ul>\n\n\n\n<p>Although concurrency is not the first thing beginners learn when approaching Rust, it is still easier to grasp than in many other programming languages. More importantly, Rust helps you write less error-prone concurrent code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to get started with Rust<\/h2>\n\n\n\n<p>There are only two things that need to be installed on your computer to get started with Rust:<\/p>\n\n\n\n<ol>\n<li>Rust toolchain \u2013 a collection of tools that includes the Rust compiler and other utilities.<\/li>\n\n\n\n<li>A code editor or IDE (integrated development environment).&nbsp;<\/li>\n<\/ol>\n\n\n\n<p>The first step is easy \u2013 just go to <a href=\"https:\/\/rustup.rs\/\" target=\"_blank\" rel=\"noopener\">rustup.rs<\/a> and run a command they suggest or download an installer, depending on your operating system.<\/p>\n\n\n\n<p>The second step requires making a choice. Your options include using a code editor configured to provide Rust support (for example, Visual Studio Code supports Rust but requires some setup) or using a dedicated Rust IDE (such as <a href=\"https:\/\/www.jetbrains.com\/rust\/\" target=\"_blank\" rel=\"noopener\">RustRover<\/a>, a JetBrains IDE, which is free for anyone learning Rust).<\/p>\n\n\n    <div class=\"buttons\">\n        <div class=\"buttons__row\">\n                                                <a href=\"https:\/\/www.jetbrains.com\/rust\/download\/\" class=\"btn\" target=\"\" rel=\"noopener\">Get RustRover for free<\/a>\n                                                    <\/div>\n    <\/div>\n\n\n\n\n\n\n\n<p>If you choose RustRover, you don\u2019t need to configure anything. You can launch it, create a new project (using the <em>New Project<\/em> button on the welcome screen), and run the <em>Hello, world!<\/em> program generated by default (use the green triangle icon in the gutter to run the main function):<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"1202\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/image-18.png\" alt=\"\" class=\"wp-image-511141\"\/><\/figure>\n\n\n\n<p>If you encounter any trouble, refer to RustRover\u2019s <a href=\"https:\/\/www.jetbrains.com\/help\/rust\/quick-start-guide-rustrover.html\" target=\"_blank\" rel=\"noopener\">Quick Start Guide<\/a>.&nbsp;<\/p>\n\n\n\n<p>Anything beyond really simple stuff requires adding external dependencies. Rust projects rely on Cargo, a package manager. In Rust, packages are called <strong>crates<\/strong>. The dependencies are specified in the <code>Cargo.toml<\/code> file, for example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"raw\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[package]\nname = \"hello\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\nchrono = \"0.4.38\"<\/pre>\n\n\n\n<p>After adding the <code>chrono<\/code> crate to our dependencies, we can use the functionality it provides in our code, for example:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"rust\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">use chrono::{DateTime, Local};\n\nfn main() {\n   println!(\"Hello, world!\");\n   let local: DateTime&lt;Local> = Local::now();\n   println!(\"Today is {}\", local.format(\"%A\"));\n}<\/pre>\n\n\n\n<p>In this program, we get the current (local) date and time, format it as a day of the week, and then print a result. For example, running this program gives me:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">Hello, world!\nToday is Thursday<\/pre>\n\n\n\n<p>Learning basic syntax, data types, and control structures (if-conditionals, loops, etc.) in Rust is a parallel process to learning about the available crates and what they provide. Once you can run Rust programs, you\u2019ll be ready to work with external dependencies. Let\u2019s talk about the resources that simplify learning Rust.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning path and resources<\/h2>\n\n\n\n<p>If you&#8217;ve ever learned a foreign language, you know that various skills are required, such as reading, writing, listening, and speaking. There are also different types of activities to develop these skills. Teachers always encourage you to read texts, watch videos, listen to podcasts, speak whenever possible, post on social media, etc. Learning programming languages is no different. When learning how to code in Rust (or any other programming language), you:<\/p>\n\n\n\n<ul>\n<li>Read books, documentation, blog posts, release announcements, and social media discussions (which is all vital to staying informed and in context).<\/li>\n\n\n\n<li>Watch videos from tech video bloggers.<\/li>\n\n\n\n<li>Explore code samples (which necessarily includes reading and modifying them!).<\/li>\n\n\n\n<li>Write code to complete exercises.<\/li>\n\n\n\n<li>Follow hands-on tutorials.<\/li>\n\n\n\n<li>Develop simple projects from scratch (this is extremely important \u2013 project-based learning is always helpful for developing independent coding skills).<\/li>\n\n\n\n<li>Maybe even contribute to open-source projects (there\u2019s always something easy enough for beginners \u2013 just ask!).<\/li>\n<\/ul>\n\n\n\n<p>Note that there should be a balance between reading about programming and writing code. It\u2019s impossible to master a programming language without actually writing code. At the same time, avoiding books or other extended materials can lead to a relatively shallow understanding of the internal details; any complex case could become extremely hard to resolve without external help (which is fine but can slow you down on your path to becoming a professional developer).<\/p>\n\n\n\n<p>When you write code, it&#8217;s important to both replicate externally crafted exercises and follow your own (or borrowed) ideas for developing simple applications. Ensure that your exercises are not limited to grasping algorithms but also teach language features and library functionalities. When developing simple applications, you learn to choose a language feature or a library that best suits your goal. This is an essential skill in itself.<\/p>\n\n\n\n<p>So, the key to successful learning is combining all the approaches. Here I have a collection of resources that can help you with that.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rust books<\/h3>\n\n\n\n<p>There are many good books available for learning Rust:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"477\" height=\"630\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/image-19.png\" alt=\"\" class=\"wp-image-511152\" style=\"aspect-ratio:0.7571428571428571;width:254px;height:auto\"\/><\/figure><\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"1276\" height=\"1600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/image-20.png\" alt=\"\" class=\"wp-image-511163\" style=\"aspect-ratio:0.7975;width:256px;height:auto\"\/><\/figure><\/div>\n\n\n<ul>\n<li><a href=\"https:\/\/doc.rust-lang.org\/book\/\" target=\"_blank\" rel=\"noopener\"><em>The Rust Programming Language<\/em><\/a> is an official, regularly updated book for those learning Rust. It is known as <em>The Book<\/em> within the community. I also recommend <a href=\"https:\/\/rust-book.cs.brown.edu\/\" target=\"_blank\" rel=\"noopener\">another version<\/a> of this book that adds more interactivity, such as quizzes, visualizations, and exercises. This version was developed by Brown University researchers Will Crichton, Gavin Gray, and Shriram Krishnamurthi. There\u2019s also <a href=\"https:\/\/www.youtube.com\/watch?v=u85bozA3bv0\" target=\"_blank\" rel=\"noopener\">an interview<\/a> with Will Crichton, who discusses this experiment to enhance Rust learners&#8217; experience.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.manning.com\/books\/rust-in-action\" target=\"_blank\" rel=\"noopener\"><em>Rust in Action<\/em><\/a> by Tim McNamara (mostly known as <a href=\"https:\/\/timclicks.dev\/\" target=\"_blank\" rel=\"noopener\">timClicks<\/a> \u2013 my advice is to follow him everywhere).<\/li>\n\n\n\n<li><a href=\"https:\/\/pragprog.com\/titles\/hwrust\/hands-on-rust\/\" target=\"_blank\" rel=\"noopener\"><em>Hands-on Rust<\/em><\/a> by Herbert Wolverson \u2013 the book that is especially appealing to those who appreciate project-based learning (you can also find a lot of free videos by Herbert about various Rust concepts; I can\u2019t recommend them enough).<\/li>\n\n\n\n<li><a href=\"https:\/\/rust-for-rustaceans.com\/\" target=\"_blank\" rel=\"noopener\"><em>Rust for Rustaceans<\/em><\/a> by Jon Gjengset, a Rust book that many community members highly praise.&nbsp;&nbsp;<\/li>\n\n\n\n<li><a href=\"https:\/\/www.manning.com\/books\/code-like-a-pro-in-rust\" target=\"_blank\" rel=\"noopener\"><em>Code Like a Pro in Rust<\/em><\/a> by Brenden Matthews.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.manning.com\/books\/learn-rust-in-a-month-of-lunches\" target=\"_blank\" rel=\"noopener\"><em>Learn Rust in a Month of Lunches<\/em><\/a> by David MacLeod.<\/li>\n\n\n\n<li>After a few months of learning Rust, you should check out Mara Bos&#8217;s <em><a href=\"https:\/\/marabos.nl\/atomics\/\" target=\"_blank\" rel=\"noopener\">Rust Atomics and Locks<\/a><\/em>. It\u2019s a masterpiece in explaining the low-level concepts behind Rust concurrency.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Rust tutorials<\/h3>\n\n\n\n<p>For those who prefer more hands-on approach to learning, there are also tutorials and courses with exercises:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/google.github.io\/comprehensive-rust\/\" target=\"_blank\" rel=\"noopener\">Comprehensive Rust<\/a> is a Rust tutorial developed internally at Google but available to everyone. It is the best resource for those who want to learn all the necessary details quickly.<\/li>\n\n\n\n<li><a href=\"https:\/\/github.com\/rust-lang\/rustlings\/\" target=\"_blank\" rel=\"noopener\">Rustlings<\/a> (and its variation for an <a href=\"https:\/\/blog.jetbrains.com\/rust\/2023\/02\/21\/learn-rust-with-jetbrains-ides\/\">in-IDE learning experience<\/a>, a Rust <a href=\"https:\/\/academy.jetbrains.com\/course\/16631-learn-rust\" target=\"_blank\" rel=\"noopener\">course<\/a> from <a href=\"https:\/\/academy.jetbrains.com\/\" target=\"_blank\" rel=\"noopener\">JetBrains Academy<\/a>).<\/li>\n\n\n\n<li><a href=\"https:\/\/rust-exercises.com\/100-exercises\/\" target=\"_blank\" rel=\"noopener\">100 exercises to learn Rust<\/a> \u2013 a fantastic course with exercises developed by <a href=\"https:\/\/www.lpalmieri.com\/\" target=\"_blank\" rel=\"noopener\">Luca Palmieri<\/a> (yet another Rustacean to keep an eye on).<\/li>\n\n\n\n<li>Eleftheria Batsou presented <a href=\"https:\/\/eleftheriabatsou.hashnode.dev\/5-rust-project-ideas-for-absolutely-beginners-devs\" target=\"_blank\" rel=\"noopener\">a nice set of simple project ideas<\/a> for you to work on while learning Rust.<\/li>\n\n\n\n<li>Folks at <a href=\"https:\/\/codecrafters.io\/\" data-type=\"link\" data-id=\"https:\/\/codecrafters.io\/\" target=\"_blank\" rel=\"noopener\">codecrafters.io<\/a> composed <a href=\"https:\/\/codecrafters.io\/blog\/rust-projects\" target=\"_blank\" rel=\"noopener\">this list of projects<\/a> that you can use to get hands-on experience with Rust.<\/li>\n\n\n\n<li>You can join Herbert Wolverson\u2019s Rust training at&nbsp;<a href=\"https:\/\/www.ardanlabs.com\/training\/rust\/\" target=\"_blank\" rel=\"noreferrer noopener\">ArdanLabs<\/a>&nbsp;to master Rust fundamentals and learn about the core concepts behind it.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Rust on YouTube<\/h3>\n\n\n\n<p>For Rustaceans who like learning on YouTube, I recommend following several channels there:<\/p>\n\n\n\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/@letsgetrusty\" target=\"_blank\" rel=\"noopener\">Let\u2019s Get Rusty<\/a> \u2013 I don\u2019t know how it works, but it\u2019s hard to stop watching these videos.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/@JeremyChone\" target=\"_blank\" rel=\"noopener\">Jeremy Chone<\/a> is great at explaining complex concepts.<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/c\/chrisbiscardi\" target=\"_blank\" rel=\"noopener\">Chris Biscardi<\/a> talks about game development in Rust with the Bevy framework, among other things. Creating a game is an excellent project for anyone!<\/li>\n\n\n\n<li><a href=\"https:\/\/www.youtube.com\/@jonhoo\" target=\"_blank\" rel=\"noopener\">Jon Gjengset<\/a> \u2013 For the first couple of years of your Rust journey, it can be hard to follow his in-depth technical streams, but I recommend watching them early!&nbsp;<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Rust community<\/h3>\n\n\n\n<ul>\n<li>The <a href=\"https:\/\/www.reddit.com\/r\/rust\/\" target=\"_blank\" rel=\"noopener\">Rust community on Reddit<\/a> is worth following.<\/li>\n\n\n\n<li><a href=\"https:\/\/discord.com\/invite\/rust-lang\" target=\"_blank\" rel=\"noopener\">Rust Community Discord server<\/a> is the place where you can ask questions as a beginner.<\/li>\n\n\n\n<li><a href=\"https:\/\/this-week-in-rust.org\/\" target=\"_blank\" rel=\"noopener\">This Week in Rust<\/a> is the most important community resource for reading Rust-related news. I read it every week without exception.<\/li>\n<\/ul>\n\n\n\n<p>Of course, many more learning resources are available, but it\u2019s impossible to list all of them. The good news is that you never stop learning Rust because the language is constantly evolving.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common challenges and how to overcome them<\/h2>\n\n\n\n<p>Learning Rust can be challenging. However, you can overcome these difficulties and master the language with the right strategies. Here are some tips to help you along the way:<\/p>\n\n\n\n<ol>\n<li><strong>Understand the ownership model.<\/strong> Rust&#8217;s ownership model, which includes concepts like ownership, borrowing, and lifetimes, is often the most challenging aspect for beginners. Start with small examples and practice frequently. Focus on understanding why Rust enforces these rules rather than how to get around compiler errors.&nbsp;<\/li>\n\n\n\n<li><strong>Take your time with the borrow checker.<\/strong> The borrow checker can be frustrating, as it\u2019s strict and may lead to confusing compiler errors. When you encounter borrow checker issues, take a step back and analyze what Rust is trying to prevent. Experiment with approaches like referencing or cloning data (but try not to clone everything!). Don\u2019t be afraid to ask for help on forums like Reddit or the Rust Community Discord server. It\u2019s really useful to understand what precisely a borrow checker is. See, for example, this <a href=\"https:\/\/www.youtube.com\/watch?v=HG1fppexRMA\" target=\"_blank\" rel=\"noopener\">great explanation<\/a> by Nell Shamrell-Harrington.<\/li>\n\n\n\n<li><strong>Leverage Rust\u2019s excellent documentation.<\/strong> Rust is a relatively new language, so some things might not be as straightforward as in more established languages. Use the Rust documentation, which is known for being comprehensive and well-written. The Rust community also contributes to great resources like the <a href=\"https:\/\/doc.rust-lang.org\/rust-by-example\/\" target=\"_blank\" rel=\"noopener\">Rust by Example<\/a> guide.<\/li>\n\n\n\n<li><strong>Start with simple projects. <\/strong>Rust&#8217;s complexity can make even simple projects feel overwhelming at first. Start by implementing basic programs and gradually move to more complex ones. Examples of simple projects include building a command-line tool with <a href=\"https:\/\/clap.rs\" target=\"_blank\" rel=\"noopener\">clap<\/a>, writing simple file parsers, or creating a basic web server using a framework like<a href=\"https:\/\/rocket.rs\/\" target=\"_blank\" rel=\"noopener\"> Rocket<\/a>.<\/li>\n\n\n\n<li><strong>Learn your code editor or IDE.<\/strong> Writing Rust code manually can be error-prone. Tools can help you with code completion, linting, and formatting.<\/li>\n\n\n\n<li><strong>Participate in the Rust community.<\/strong> Learning a new language can feel isolating. Engage with the Rust community by contributing to open-source projects, joining Rust-focused chat rooms, or participating in forums. Rust\u2019s community is known for being very welcoming and helpful to newcomers.<\/li>\n\n\n\n<li><strong>Learn from mistakes. <\/strong>Rust\u2019s compiler is strict, and it can feel like you\u2019re constantly fighting with it. View each compiler error as a learning opportunity. Rust\u2019s error messages are often very descriptive and guide you toward the correct solution. Over time, you\u2019ll find that these errors help you write better, safer code.<\/li>\n\n\n\n<li><strong>Be patient.<\/strong> It\u2019s easy to get discouraged with Rust. Remember that Rust is designed to be safe and efficient, which requires you to learn some complex concepts. Take breaks when necessary, and don\u2019t be afraid to revisit topics multiple times until you\u2019re confident that you\u2019ve fully grasped them.<\/li>\n\n\n\n<li><strong>Join Rust learning groups. <\/strong>Many developers are learning Rust, and joining a group can provide support and motivation. Look for local meetups or online study groups, or even partner with a friend to learn together.<\/li>\n<\/ol>\n\n\n\n<p>Mastering Rust takes time, but the payoff is worth it. Rust\u2019s features, like its memory safety guarantees and performance, make it a powerful language for systems programming, web development, and more. Stick with it; you\u2019ll find that Rust can be fun and rewarding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Building real-world applications with Rust&nbsp;<\/h2>\n\n\n\n<p>Let\u2019s now briefly examine Rust\u2019s suitability for building real-world applications. We\u2019ll focus on several relevant technology domains, as case studies in these areas highlight Rust&#8217;s strengths and demonstrate its practical applicability.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Rust in web development<\/h3>\n\n\n\n<p>The Rust ecosystem is perfectly suitable for backend web development. Many frameworks and libraries perform general web development tasks, such as HTTP request routing, JSON and form handling, templating, database access, authentication and authorization, logging and tracing, etc., with production-ready performance. I recommend looking at the <a href=\"https:\/\/www.arewewebyet.org\/\" target=\"_blank\" rel=\"noopener\">AreWeWebYet?<\/a> website for details and useful links. As a spoiler, the answer is positive.&nbsp;<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full is-resized\"><img decoding=\"async\" loading=\"lazy\" width=\"1280\" height=\"1600\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/image-21.png\" alt=\"\" class=\"wp-image-511205\" style=\"aspect-ratio:0.8;width:248px;height:auto\"\/><\/figure><\/div>\n\n\n<p>Most web frameworks for Rust are easy to start with, and their documentation is awesome, partly thanks to the competition between them. For example, the <a href=\"https:\/\/actix.rs\/\" target=\"_blank\" rel=\"noopener\">Actix Web<\/a> community provides a nice and up-to-date <a href=\"https:\/\/github.com\/actix\/examples\" target=\"_blank\" rel=\"noopener\">collection of examples<\/a>. My colleague Khalid Abuhakmeh wrote <a href=\"https:\/\/blog.jetbrains.com\/rust\/2024\/02\/28\/how-to-write-your-first-rust-web-app-with-rocket-and-rustrover\/\">a tutorial for beginners<\/a> on building a simple HTML web application that uses Rocket, another web framework for Rust, as a backend. Luca Palmieri, whom I mentioned earlier, authored a book, <a href=\"https:\/\/www.zero2prod.com\/\" target=\"_blank\" rel=\"noopener\"><em>Zero To Production in Rust<\/em><\/a>, that helps you become a web backend developer, and he also works on <a href=\"https:\/\/github.com\/LukeMathWalker\/pavex\" target=\"_blank\" rel=\"noopener\">Pavex<\/a>, an emerging and promising web framework. One exciting thing about the latter project is that Luca carefully documents design choices in <a href=\"https:\/\/github.com\/LukeMathWalker\/pavex?tab=readme-ov-file#project-status\" target=\"_blank\" rel=\"noopener\">a series of progress reports<\/a>. It\u2019s constantly engaging to see why things are designed the way they are and not in some other way. Check out <a href=\"https:\/\/github.com\/flosse\/rust-web-framework-comparison\" target=\"_blank\" rel=\"noopener\">this web framework comparison<\/a> to understand how actively Rust web frameworks are developing.<\/p>\n\n\n\n<p>Rust is also active on the web frontend, though it may not be 100% ready for production. Still, the overall progress in Rust for WebAssembly and frameworks such as <a href=\"https:\/\/www.egui.rs\/\" target=\"_blank\" rel=\"noopener\">egui<\/a> or <a href=\"https:\/\/dioxuslabs.com\/\" target=\"_blank\" rel=\"noopener\">Dioxus<\/a> is impressive.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Integrating Rust with other programming languages<\/h3>\n\n\n\n<p>I wonder if Rust designers envisioned Rust becoming a language of choice for those who develop tooling and libraries for other programming languages, especially Python and JavaScript. Rust can provide better performance, and it\u2019s attractive enough for developers from other language ecosystems to learn and apply.&nbsp;<\/p>\n\n\n\n<p>The <a href=\"https:\/\/pyo3.rs\/\" target=\"_blank\" rel=\"noopener\">PyO3<\/a> project enables developers to implement native Python modules in Rust and to access Python in Rust binaries. By leveraging PyO3, you can provide an extremely efficient Rust implementation of a Python library for Python developers. Rust and JavaScript can be connected similarly via WebAssembly and <a href=\"https:\/\/github.com\/rustwasm\/wasm-bindgen\" target=\"_blank\" rel=\"noopener\">wasm-bindgen<\/a>.&nbsp;<\/p>\n\n\n\n<p><a href=\"http:\/\/astral.sh\" target=\"_blank\" rel=\"noopener\">Astral<\/a> and its founder, Charlie Marsh, prove that it\u2019s possible to develop Python tooling that works at the speed of light (well, we all know that that\u2019s a marketing claim, of course, but the result is truly fascinating).&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1600\" height=\"805\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2024\/09\/image-27.png\" alt=\"\" class=\"wp-image-512376\"\/><\/figure>\n\n\n\n<p><a href=\"https:\/\/deno.com\/\" target=\"_blank\" rel=\"noopener\">Deno<\/a>, a JavaScript runtime developed in Rust, delivers very good performance. This is not the only example from the JavaScript ecosystem. There\u2019s even a curated <a href=\"https:\/\/github.com\/karimould\/awesome-js-tooling-in-rust\" target=\"_blank\" rel=\"noopener\">collection of JavaScript tooling<\/a> implemented in Rust.&nbsp;<\/p>\n\n\n\n<p>Implementing interoperability between Rust and other programming languages is also possible.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Systems and embedded programming in Rust<\/h3>\n\n\n\n<p>Undoubtedly, Rust shines in systems programming. Speakers from Google and Microsoft <a href=\"https:\/\/www.theregister.com\/2024\/03\/31\/rust_google_c\/\" target=\"_blank\" rel=\"noopener\">confirm<\/a> that introducing Rust into their codebases lessens the number of security vulnerabilities, increases performance, and also keeps or sometimes improves the productivity of software developer teams. Amazon not only supports <a href=\"https:\/\/aws.amazon.com\/developer\/language\/rust\/\" target=\"_blank\" rel=\"noopener\">Rust development on AWS<\/a> but also uses it directly to <a href=\"https:\/\/aws.amazon.com\/blogs\/opensource\/sustainability-with-rust\/\" target=\"_blank\" rel=\"noopener\">implement their own infrastructure<\/a>. Cloudflare, a company that builds content delivery networks and other networking infrastructure, <a href=\"https:\/\/www.reddit.com\/r\/rust\/comments\/10c0re0\/how_much_rust_work_is_actually_going_on_at\/\" target=\"_blank\" rel=\"noopener\">relies on Rust<\/a> in a lot of low-level projects and contributes their <a href=\"https:\/\/blog.cloudflare.com\/introducing-foundations-our-open-source-rust-service-foundation-library\" target=\"_blank\" rel=\"noopener\">frameworks<\/a> to the Rust ecosystem. Ferrous Systems, a company that backs the development of rust-analyzer, also develops <a href=\"https:\/\/ferrocene.dev\/\" target=\"_blank\" rel=\"noopener\">Ferrocene<\/a>, a certified Rust toolchain for mission-critical applications. Together with other developments, this enables Rust to be used in the automotive and aerospace industries. For example, there are reports about <a href=\"https:\/\/medium.com\/volvo-cars-engineering\/why-volvo-thinks-you-should-have-rust-in-your-car-4320bd639e09\" target=\"_blank\" rel=\"noopener\">Volvo<\/a> and <a href=\"https:\/\/www.youtube.com\/watch?v=Z1xMvm3eS4k\" target=\"_blank\" rel=\"noopener\">Renault<\/a> using Rust for their in-vehicle software.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion and next steps<\/h2>\n\n\n\n<p>It\u2019s a great time to start your Rust journey. Rust is a good industrial-level language with a wealth of learning materials and a beginner-friendly community. While there are some challenges, given the unique core concepts, there are also ways to overcome them. Once you are there, the job market and various application domains are open.&nbsp;<\/p>\n\n\n\n<p>I hope that the learning path and resources I\u2019ve presented will help you on your way. I can only recommend setting a learning goal beforehand: find an open-source project you want to contribute to or develop an idea for your project early. You\u2019ll be amazed how quickly you can get close to fulfilling that goal.<\/p>\n\n\n\n<p>Be encouraged and stay on the path of learning Rust!<\/p>\n","protected":false},"author":1335,"featured_media":511228,"comment_status":"closed","ping_status":"closed","template":"","categories":[],"tags":[2019,743,530],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/rust\/511126"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/rust"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/types\/rust"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/users\/1335"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/comments?post=511126"}],"version-history":[{"count":10,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/rust\/511126\/revisions"}],"predecessor-version":[{"id":678617,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/rust\/511126\/revisions\/678617"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/media\/511228"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/media?parent=511126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/categories?post=511126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/tags?post=511126"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/ru\/wp-json\/wp\/v2\/cross-post-tag?post=511126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}