Are you a beginner to intermediate Rust programmer that’s looking to hone your skills and truly understand the language?
Well, one of the most effective ways to learn Rust, or any programming language for that matter, is to build projects.
Studies have proven that this hands-on approach helps you solidify your knowledge and gain practical experience.
The thing is, you don’t want to just build any old projects.
You want to be both strategic in what you learn, and how you approach them, and as the resident Rust Instructor here at the ZTM Academy, I've found that juniors learn best by starting to build projects with guidance and code examples.
However, you can't be a junior forever (nor would you want to be!).
That's why you'll want to transition to building projects from scratch (as quickly as possible), without needing to rely on detailed instructions, to help you progress to intermediate and expert levels.
And that’s the goal of this guide. To give you a series of projects that will walk you through and then stretch your skills until you have a kick-ass Rust project portfolio.
Here’s how it works:
I’ve broken this down into 3 sections.
Will this be harder and more frustrating for you than it would be if you just had instructions to follow? Yes, but that's the point!
Trust me on this. The struggle is where you learn the most, because it’s where you start to apply theory and knowledge.
It’s not a bad thing to struggle either, because this struggle to figure things out is the most accurate representation of the workplace, and even the best Rust developers struggle and have to think through problems (that's what you get paid the big bucks for!).
But rest assured that these projects will help you become a better Rust developer, whether you are starting out as a new developer or are an experienced Rust developer looking to dig deeper.
Sidenote: Each project has a brief description along with a list of crates to help you make the project. If you want to challenge yourself, complete the "extra features" section to give yourself some more practice.
The Rust standard library is light on features, so here are some foundation crates that are great to use in nearly any project:
OK so let’s get into these and start nice and simple. These beginner Rust projects are great for developers who are starting out with programming, but they’re also good for experienced developers who are just starting to play around with Rust.
Why?
Well, each of these projects focus on a single, well-defined task, making them great for new developers. Whereas for experienced developers starting to use Rust, these help to gain understanding of the workflows and idioms used in Rust.
I've included a link below each of these beginner projects. That link contains instructions on a project that is the same (or similar) to what I'm suggesting you build here. So if you're struggling with something check out the link.
But don't forget - the goal is for you to be able to build projects without needing detailed instructions, so try to think through the problem before you look at the instructions.
When we get to the intermediate and expert projects (and in the real world), you won't have instructions as a crutch to lean on!
Command-line utilities are the gateway to learning any programming language. They have simplified input and output systems which makes the code less complex to write. This allows you to focus on the problem at hand and learn Rust instead of learning a specific problem domain.
Rewriting existing tools in Rust can provide a great baseline to get started:
echo
: repeats inputcat
: concatenates filesls
: lists directoriesfind
: locates files or directoriesgrep
: matches text in filesOther than the "foundation" crates listed at the beginning of this post, these projects don't need any extra crates.
.unwrap()
and no .expect()
)find
and grep
are good candidates for thisHaving trouble getting started? Check out this Rust coreutils rewrite which has many of the above tools written in Rust.
The humble todo list has become an unofficial first project when starting out with a new programming language. You can choose to use a CLI with clap
, or make it interactive using the crates listed below. You can even do both!
The todo list minimal feature set includes:
Here are some crates to get you started:
$EDITOR
support for editing todosNot sure how to start out with this project? Check out this CLI todo app.
A budget manager is a project that can be useful for keeping your finances in check, while also improving your Rust programming skills. Learning about databases is an important skill, and this project is a great entry point for databases thanks to its limited scope.
For an initial interface, you can use clap
to handle CLI flags and arguments, but you can also go interactive using the crates listed later in this section.
The budget manager minimal feature set includes:
Here are some crates to get you started:
If you want to see an alternative of managing bills or budgets, take a look at this project.
A unit converter provides useful functionality, and is a nice way to get familiar with converting between different data types in Rust. An argument-based CLI using clap
is a great starting point for this application.
Here are some crates to get you started:
From
trait to make your code more robust10C -> F
would convert 10° Celsius to FahrenheitThere is an interactive implementation of a unit converter called rink-rs that you can browse the code for if you want to see how a unit converter can be built.
These intermediate Rust projects are great once you have a grasp of how Rust works and have completed some beginner projects.
Generally, each project has either more than one feature to manage, or use more complicated parts of the Rust language. Getting through these projects will increase your confidence and ability to program in Rust.
As you'll see, for these intermediate projects I'm not providing links to sites that provide instructions on how to build the project.
That's up to you to figure out. Building projects from scratch is an incredible learning experience, so embrace it!
A social media bot is a fun project that can allow you to show off your skills. You could make a Discord bot to moderate your server, or a Reddit bot that replies with fun trivia, or even a Twitter bot that tweets some message based on a condition.
Here are some crates to get you started:
Although I’ve not added a direct link to how to build this, a little detective work will set you on the right path if you get stuck.
cron
job, or even a hardware projectAPIs are great, and making money from them is even greater! Create a web-accessible API and track usage per API key. The API can do anything that is interesting to you.
There's no need to connect your API to a billing source. The important part is to get correct usage tracking and database planning.
The metered API server minimal feature set includes:
Here are some crates to get you started:
Choosing the correct data structure is one of the most important tasks when creating programs. Writing your own data structure is a great way to gain a deeper understanding of how they work.
You could try creating an ordered HashMap
, or a concurrent Queue
, a binary search tree, or a persistent data structure.
Here are some crates to get you started:
This project is about creating a billing system for a utility company. It can be any utility that has metered usage. You'll need to support customer accounts, meter readings, generation of bills, and due dates.
The great thing about this project is you can start out using CLI and then transition it to a web-based system for an extra challenge.
The utility billing system minimal feature set includes:
Here are some crates to get you started:
Writing programs to handle medical information needs extra care to avoid security problems. This makes Rust's secure, reliable code the perfect fit for creating a prescription management system.
To help ensure correct operation, try using the type state pattern to encode the correct operation of the application into the type system.
The system should:
clap
or an interactive terminal interface of your own designHere are some crates to get you started:
The humble spell checker is an important bit of code that runs in the background doing its job. This project doesn't take much explanation: make a crate that takes an input string and then determine if the string has the correct spelling.
A minimal implementation can use a HashMap
, but the "intermediate" level starts with the extra features.
Here are some crates to get you started:
These projects offer a significant challenge. While the beginner and intermediate projects primarily focused on a small number of features in a specified area, these projects require knowledge in more than one discipline, and are feature-rich.
Simply put, if you can build these projects then you know Rust!
Write a parser to parse a file format of your choosing. File formats can get complicated, so starting with a minimal text-based format such as INI is a good idea. Don't stop at INI
though! There are a lot of file formats you can choose from.
You'll need one crate for this project: nom. The standard library has you covered for the remaining functionality.
&str
, for example)Audio players touch a significant number of software development aspects:
For this project, create a minimal audio player with a GUI that plays a music file.
The audio player API minimal feature set includes:
Use egui to create your interface. egui
has pre-made widgets for a minimal interface and also supports writing your own widgets for more advanced elements.
The rust.audio website has a collection of audio-related Rust crates that you can choose from your project.
There's no shortage of different programming and scripting languages available. But sometimes it's helpful to have one designed for your specific situation.
Create your own interpreter for a scripting language of your own design. If you are unfamiliar with this topic, check out this site for a comprehensive tutorial on creating a scripting language in Rust.
Here are some crates to get you started:
Yes, making your own database is a thing you can do in Rust. Don't worry, it doesn't need to be a competitive fully-featured database. A key/value store is adequate, but you can also make a time series database or a document database.
The important part is making sure that your database meets ACID compliance. Ensuring that your database is 100% reliable is a difficult problem, so start with a minimal design and expand from there.
Here are some crates to get you started:
Compression algorithms work best when they target a specific kind of data. Design your own compression algorithm for data of your choice, and then implement it as a Rust crate. You can start with a static-dictionary algorithm to get a feel for how compression works, and then move on to more advanced techniques.
Here are some crates to get you started:
Iterator
adapters)The standard library windows and chunks methods on slice
will also be useful.
Fancy a more advanced project? How about building a Full-Stack Twitter clone!
As part of the new 'portfolio projects' event that ZTM is running here for Summer, you can get access to this complete project (with code) as a ZTM member.
So there you have it - 15 of my favorite Rust practice project ideas that you can use to create a killer portfolio to improve your Rust skills faster and more efficiently.
Whether you are a beginner or an experienced programmer, working on projects is the best way to learn the Rust programming language. Especially when you push yourself to learn some Google fu, and figure things out for yourself.
You’ll grow in confidence and expertise, and wow any potential employers, and it’s a core skill that makes the difference between a beginner and a kick ass coder.
So pick a project and start working your way it. Start by building the basics, add in some extra features and keep on pushing yourself. You got this!
P.S. If you find yourself stuck, if you’re just starting out, or if you simply want to skill up even further, then come and check out my Complete Rust Programming course.
It’s designed to take you from absolute beginner to getting hired, so there’s something to learn from almost any skill level, with beginner to advanced projects that will help you stand out from the crowd.
If you've made it this far, you're clearly interested in Rust so definitely check out all of my Rust posts and content: