The Rust Programming Language is a multi-paradigm systems programming language that focuses on safe code with high performance. Rust is syntastically similar to C++, but aims to provide memory-safe code whilst still being blazingly fast. As of writing (Sept. 2019) Rust ranks third on The Computer Language Benchmarks Game, just behind C++ and C.
To install Rust it is recommended to install the Rust toolchain manager Rustup by installing the rustup package
# xbps-install -S rustup
The package provides an initialization script that must be run afterwards
which guides you through installing a toolchain and other tools for the current user.
Creating a new project
Rustup also installs the Rust package manager Cargo alongside the rust toolchain. Cargo makes creating new projects easy by setting up most of the project structure for you. To create a new application simply run
$ cargo new <name_of_project>
If you however wish to create a new library then run
$ cargo new --lib <name_of_library>
Installing another toolchain
Should you wish to develop rust applications for an architecture other than your own, you can install a different toolchain through rustup. To do this run
$ rustup toolchain install <name_of_toolchain>
Rust for linux does not check whether a compiler toolchain is present on the system, but assumes that a C linker is present. To fix the issue simply install gcc
# xbps-install -S gcc