Skip to content

Instantly share code, notes, and snippets.

@brson
Last active July 25, 2022 09:06
Show Gist options
  • Save brson/b6d927d5a374cdfde113ede42fee4a06 to your computer and use it in GitHub Desktop.
Save brson/b6d927d5a374cdfde113ede42fee4a06 to your computer and use it in GitHub Desktop.

Become a next-generation systems hacker with Rust

Rust is a novel systems programming language, designed for writing and maintaining large-scale, ultra-reliable software in the domains where typically only C and C++ are appropriate. It is the only production programming language in the world that is memory safe - meaning Rust software does not segfault - but does not have a garbage collector or rely on reference counting, and that makes it suitable for writing all kinds of software. It is also arguably the fastest programming language in the world. And with a focus on developer ergonomics, Rust makes the most difficult types of programming accessible to a wide audience.

Rust is known for it's welcoming and rewarding community. Although sponsored by Mozilla (the creators of Firefox), it has a thriving community of contributors, and many of the greatest parts of Rust have been written by ambitious students. There is great opportunity yet for making a name for oneself in the growing Rust ecosystem.

In this hackfest we're going to learn how to contribute to open source generally, by learning how to participate in Rust. We're going to first learn a bit of Rust, and in the process we're going to socialize with, and get help from, other Rust hackers; we're going to figure out how to discover appropriate contribution opportunities, and we'll each submit a quick, simple patch, to get some early success. Then we'll hack on whatever cool thing we feel like.

Our primary goal will be to have a good time with Rust, and we can be flexible about what exactly we work on.

Resources

Phase 1: Getting started

Where to get help

The first thing to do is join #rust-beginners on Mozilla's IRC network. This is the best place to go to get started with Rust and the Rust community. There are usually people there happy to help, and you should ask for help freely. IRC is where much of the Rust community collaborates, and being on IRC is a good way to make friends and stay in the loop.

The easiest way to join is through Mibbit, a web based IRC client, but any IRC client will work. XChat, mIRC, and Colloquy are good options.

The community page on the Rust website lists other places to look for help.

Installation

Follow the installation instructions. It is usually straightforward.

Additionally, Windows users will need the Microsoft Visual C++ Build Tools, or a recent version of Visual Studio. Mac users will need XCode. Linux users will need gcc.

Use the editor of your choice. VS Code, emacs, and vim are the most widely used editors with Rust. Most editors have at least syntax highlighting for Rust, while some have more advanced features. Details about Rust editors can be found at areweideyet.com. For VS Code, use the RustyCode plugin, emacs use rust-emacs, vim use rust.vim.

With a working installation you should be able to type rustc --version at the command line and get a useful result.

Read the book and do some exercises

If you are new to Rust it's probably best to spend some time on your own reading about it, trying exercises, and forming opinions and questions.

The best starting place is probably The New Rust Book. This book is incomplete, but is somewhat higher quality than The Old Rust Book. The book has a guessing game tutorial that I strongly suggest doing. It will give you a good feel for Rust. Another excellent source of Rust exercises is rustlings.

We don't need to be very knowledgable about Rust to start contributing to Rust, but it will be important to have some background. While you are acquainting yourself, keep an eye out for things that are wrong, confusing, annoying, etc. Those little things that personally affect you are often the best threads to start tugging at to find your way as a contributor.

Ask for help on #rust-beginners!

Phase 2: Making an initial contribution

One's initial contribution to any project is a critical juncture, like any new relationship. First impressions matter, for both the new contributor and maintainer. It's usually best to start small, because small contributions are most likely to be acceptable without a great amount of debate, allowing one to ease successfully into the project without yet understanding it.

Good initial contributions usually come from "scratching an itch". If you've gotten this far and you've already encountered something confusing or buggy, that's a good place to start. Was some documentation not clear enough? Fixing that is a perfect initial contribution - docs are always being improved, patches are always welcomed, and as a new user you have the right perspective to make the docs clearer. If you know what you want to do at this point, the next step is to search the appropriate bug tracker to see if anybody else is talking about the issue.

Sources for discovering Rust tasks:

  • Rust easy bugs. Bugs specifically tagged for new contributors.
  • Rust mentor bugs. Bugs for new contributors with willing mentors.
  • Rust help wanted bugs. Not easy bugs that still need help.
  • This Week in Rust. Every week they put out a call for contributions, with specific curated tasks. This is probably the best place to find community libraries that are actively seeking contributions (as opposed to contributing to Rust itself).
  • brson's someday list. This is my personal list of things that should get done but haven't. I may be able to help you pick something out of this.

Selected candidate tasks for 2017-02-24:

Phase 3: Finding your niche

TODO. A good place to contribute right now is Rust Cookbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment