DEV Community

David Solé
David Solé

Posted on

Getting Started with Rust

Rust has consistently ranked as one of the most admired programming languages in recent years. According to the StackOverflow Developer Survey, Rust holds the top spot as the most loved programming language. With the stories of benefactors and detractors I read about it, I just wanted to have my own experience.

From my first steps, I found learning Rust to be an enjoyable experience. In this post, I want to share the journey, from learning Rust as a beginner to exploring its open-source ecosystem. If you're curious about Rust or want to start your journey, this guide will help you get on track.

Why Learn Rust?

Rust is a systems programming language that focuses on performance and memory safety. It’s often compared to languages like C++ due to its ability to handle low-level tasks, but it offers modern features like safe concurrency and great tooling. Rust is known for helping developers avoid common bugs like null pointer dereferencing and data races.

The language is used in a wide range of applications, from web development and game engines to systems programming and beyond. Companies like Mozilla, Dropbox, and Cloudflare use Rust in their tech stacks. Rust's unique combination of performance, safety, and versatility makes it a valuable skill to learn for modern development.

How to Start Learning Rust

When learning a new programming language, having good documentation and resources is essential. Rust shines in this part. Below, I’ll walk you through valuable resources to get started and deepen your understanding of Rust.

1. The Rust Book
The official Rust documentation, known as "The Rust Programming Language", is the first option you need to check to start learning Rust. It’s the best place to start if you already have experience with other programming languages.

The Rust Book explains Rust’s concepts in a clear and structured way. However, if you're new to programming, some later chapters (like chapter 15 and beyond) may be challenging. Focus on understanding the basics first, and don’t hesitate to revisit the more advanced topics once you feel more comfortable with the language.

2. Rust by Example
Once you get through the basics, Rust by Example is another fantastic resource to reinforce your learning. This website allows you to practice with small, hands-on examples. The interactive approach is especially helpful for visual learners who prefer to learn by doing rather than reading alone.

These small examples are ideal for studying while on the go—whether commuting, waiting in line, or just having a few minutes to spare.

3. 100 Exercises to Learn Rust
To solidify what you’ve learned, practicing with exercises is key. The 100 Rust Exercises resource offers exactly that. It's a collection of challenges designed to deepen your knowledge and strengthen your skills.

After completing these exercises, you’ll have a better grasp of Rust’s syntax, memory management, and error handling.

4. Rustlings
After completing the basic resources, you can challenge yourself with Rustlings. This is another set of small coding exercises in a terminal that focuses on teaching you how to read and write Rust effectively. These exercises will prepare you to handle typical errors shown by the compiler.

Other useful Repositories

Apart from the last repositories, there are other useful repositories that I haven’t got deeper into, but they could give you a hand in learning.

1. Comprehensive Rust
This repository offers a complete Rust course used by the Android team at Google. It’s packed with in-depth material and exercises. The course is expected to have a 4-day agenda.

2. Rust by Practice
Rust by Practice is another repository that helps you become skilled in Rust through various exercises. Some exercises are borrowed from Rust by Example, but this repository focuses on filling the gaps and making things work.

3. Rust Web Developer Roadmap
If you're interested in web development, Rust has a growing ecosystem for building web applications. The Rust Web Developer Roadmap is a schema for web development using Rust. It offers insights into the packages, frameworks, and libraries you’ll need to become proficient in this area.

Contributing to Rust’s Open-Source Ecosystem

Once you're familiar with Rust, contributing to open-source projects is a great way to continue learning and give back to the community. GitHub hosts a wide variety of Rust projects, there are around 970 repositories with more than 1k stars, and it certainly has its awesome Rust repository. Exploring these repositories will also give you practical insights into how Rust is used in different domains.

Here are some great open-source Rust projects that I’m planning to look at:

1. Deno
Deno is a modern runtime for JavaScript and TypeScript. While it's primarily focused on these languages, Rust is used under the hood for performance and safety.

2. Tauri
Tauri is a framework for building smaller, secure desktop and mobile applications with a web front-end. If you're interested in building cross-platform apps with a focus on security, this is an excellent project to explore.

3. Rustdesk
Rustdesk is an open-source remote desktop application designed as an alternative to TeamViewer. It’s designed to be self-hosted, giving you full control over your remote desktop environment.

4. Bevy
Bevy is a data-driven game engine built in Rust. If you’re curious about game development, Bevy is a great way to explore how Rust can be used for building games. It’s still in the early stages of development.

5. Sniffnet
Sniffnet is an application to monitor your internet traffic. It’s a practical tool that highlights Rust’s strengths in handling real-time data and network performance.

6. OpenObserve
OpenObserve is an observability platform built for logs, metrics, traces, and analytics. It’s an alternative to Elasticsearch and provides a scalable solution for handling large volumes of data.

7. Burn
Burn is a dynamic deep-learning framework built with flexibility and efficiency in mind. If you're into AI or machine learning, this framework offers the ability to explore how Rust can power complex neural networks.

8. Mullvad VPN App
Mullvad is a privacy-focused VPN client with both desktop and mobile versions.

9. Hickory DNS
Hickory is a DNS client, server, and resolver. This project allows you to see how Rust can be used to handle low-level networking tasks.

10. Vpncloud
Vpncloud is a peer-to-peer VPN. It introduces peer-to-peer communications and is an excellent opportunity to learn about it.

Conclusion

Learning Rust can be a rewarding experience, whether you're new to programming or a seasoned developer looking to explore a new language. With its focus on safety, performance, and concurrency, Rust is well-suited for a wide range of applications, from web development to systems programming.

My first thought while learning was: “Why I didn’t start earlier?” and discovering all these great and open-source projects pushed my motivation further. We’ll see where this motivation reaches.

Top comments (0)