Rustlings Rewrite

Tags: #rust

Reading time: ~5min


Rustlings is a program with a set of small exercises to get you used to reading and writing Rust code ๐Ÿฆ€

I have been working on version 6 of Rustlings for more than 3 months. During this time, I rewrote the whole program, extended it, improved the exercises and added idiomatic solutions. Now, I am happy to finally release it ๐ŸŽ‰

In this blog post, I will talk a about my journey of becoming a maintainer and working on the new version ๐Ÿ˜ƒ

Keep reading if you are interested in creating your own set of Rustlings exercises! ๐Ÿคฉ

If you are only interested in the new features and changes, check out the CHANGELOG ๐Ÿ”—

Landscape mode recommended on mobile devices

Becoming a maintainer

I used Rustlings as interactive exercises in my Rust course at my university. I created a fork and later pushed some of the improvements to upstream (the official Rustlings project). After teaching the course for the second time and understanding how students interact with Rustlings and what their struggles are, I wrote an email to the maintainer Liv (shadows-withal) asking if they need a maintainer. Liv's reply was very lovely and I am really thankful for their continuous support ๐Ÿค—

After some days, I was given permissions on Github. Becoming an open source maintainer could be that easy! Just start contributing and get some pull requests merged. Then, ask the maintainers kindly if they need a new maintainer ๐Ÿ˜ƒ

Don't be disappointed if they don't need any new maintainers. Introducing new maintainers to a project and communicating with them is extra work that has to be justified. You can continue contributing without becoming a maintainer.

What to do as a new maintainer?

After becoming a maintainer, I started working on open issues. Many issues were either outdated or already resolved. Cleaning up an issue tracker can be really satisfying! ๐Ÿงน

To get a better understanding of the (rather small) codebase, I started reading the pieces of the source code that I didn't touch yet. As a performance addict, I found it very helpful to try to optimize the code while reading it. This gives me a much deeper understanding. It is also an opportunity to touch the code without any breaking changes.

After getting comfortable with the codebase, I started introducing my own ideas to improve the project. It is fine to have a vision as a motivated new maintainer, but make sure to communicate it with the other maintainers and get their approval before starting the work. Your ideas need to align with the vision of the project.

A new milestone

After getting the approval from Liv, I created a milestone for version 6 on Github. The milestone is useful to organize everything that has to be done before releasing a new version.

A long-term plan is important, but it doesn't have to be in the form of a milestone. A shared todo list should be enough โœ…

I created a new branch named v6 where all the development for the new version happened. It is important to keep the main branch functional, especially for people compiling from source. This also allows you to merge pull requests like fixes to the current version.

Changes and new features

To avoid duplication, check out the CHANGELOG of version 6 to learn about what is new โœจ

The highlights are:

Third-Party Exercises

The new support for third-party exercises is something that has to be called out. You are now able to create your own set of exercises and let the Rustlings program handle them.

For example, Thelie came up with a name idea for third-party exercises: Toughlings! ๐Ÿ’ช๐Ÿผ That would be an idea for advanced exercises that users can start with after being done with the official Rustlings exercises.

Speedlings is also an idea for performance oriented exercises ๐ŸŽ๏ธ

What about Frenchlings? A translation of the official Rustlings exercises in French ๐Ÿ‡ซ๐Ÿ‡ท This is something that people asked for at least twice. Now, you can do it without us needing to maintain it.

Maybe Macrolings, Asynclings or Unsafelings? ๐Ÿค”

I am very excited about your ideas! Go ahead and create your set of exercises and we can link to your project in the README of the official Rustlings ๐Ÿ“Ž

Beta testing

After implementing the main features of version 6, I published a beta version and started a public testing phase. I am very thankful to all the feedback that I got. Most importantly, I need to thank dotjpg3141 and orhun for their extensive feedback ๐Ÿฅฐ

dotjpg3141's feedback is something that open source projects can only dream of ๐Ÿ˜ Contributing to open source is not only about submitting code!

Try it out!

What are you waiting for? Go ahead and try out the new version ๐Ÿƒ๐Ÿผ You can find instructions in the README for getting started.

If you find any issues in the new version, please create an issue on Github.

I wrote all the solutions myself, but I am open to improvements ๐Ÿค—

You can suggest improvements on the website's repository

Content license: CC BY-NC-SA 4.0