Rust Language

Rust tutorial: Get started with the Rust language

Here's how to get your feet wet with Rust, from using Rust’s toolchain to creating projects, working with third-party code, managing libraries, and more.

1 2 Page 2
Page 2 of 2
  • One such tool is Cross, which runs directly on a 64-bit x86 Linux host and provides what its creator describes as “zero-setup” cross-compiling to a wide variety of targets, including 64-bit Windows and MIPS.
  • Another tool is Trust, a Travis CI and AppVeyor template that can automatically publish binary releases of a Rust project. Trust can build for Linux, Windows, and macOS, although it requires not only use of the Travis CI and AppVeyor services, but also that your project be hosted on GitHub.
  • The crossbuild project provides a multi-architecture Docker image that can be used to cross-build between all three major platforms.

Note that of these three tools, only Cross has been updated recently.

Work with other Rust projects

A good way to get your legs with Rust is to check out a third-party project and work on it locally. The easy way to do that is just make a Git clone of a Rust project’s repository. As long as the repo has a Cargo.toml file in its root, it’ll be recognized by Cargo.

One thing Cargo can’t do, at least not yet, is make a local clone of a crate by itself. This is possible with Git, and most anyone doing serious work with Rust should have Git installed anyway. But you can add that functionality to Cargo directly via the third-party Cargo subcommands cargo-clone and cargo-clone-crate.

Where can you find projects to tinker with and learn from? For starters, go to the Awesome Rust repository on GitHub. Among them is the Servo web browser engine project, one of Rust’s first intended real-world applications. Also of interest is the mdBook project, for generating online books and e-books from Markdown documents.

Many other projects are useful on their own merit, not only for getting a leg up with Rust or because they’re components of a larger effort. These include Trust-DNS (a DNS server and client), Alacritty (a GPU-enhanced terminal emulator), and the MaidSafe decentralized data platform. (For fun, check out Magog, a Rogue-like game.)

Awesome Rust also lists many of the best crates and third-party tools to learn about and put to use.

If you’re hunting for a project to get involved with as a full-blown developer, try searching GitHub for Rust-based projects that have open issues tagged with “good-first-issue.” That tag indicates an issue that will be relatively easy for a new developer to help out with. It's a great way to learn the ropes with Rust while helping out the project.

Copyright © 2022 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2