Programming in Rust
Rust is a systems programming language designed for building high-performance and robust software. It is a compiled language that is roughly similar in role as C/C++, but incorporates modern semantics and has an emphasis on enforcing safe coding practices. For these reasons, it is our language of choice for the low-level Project Elara libraries, including Elara Math, our scientific computing library, and Elara GFX, our graphics and visualization library.
// Hello world in Rust
fn main() {
println!("Hello, world!");
}Installing Rust¶
To get started with Rust, the recommended official installation method is Rustup. Simply click on the link to go to the website and follow the instructions there. It should get you set up with all the development tools required for writing Rust!
Learning Rust¶
Our recommended way to learn Rust is Rustlings. These are a set of interactive Rust tutorials that teach you the most important concepts around the Rust language. Starting from zero Rust knowledge, it can help you get started programming real Rust code in about a week!
If you want to try out some Rust code but don’t want to set up a full Rust project, we recommend using the Rust playground. This is an interactive coding environment where you can write Rust code and have it run in-browser.
Finally, other excellent resources are available in learning Rust:
The Rust Book, which is the comprehensive guide to Rust, created by the Rust developers and its community. This is the ideal way to gain a deep understanding of the Rust language but can take some time to read.
A Gentle Introduction to Rust, which is also a book, but is much shorter and more accessible.
Rust By Example, which teaches Rust through code snippets intended to explain Rust’s different features
Rust in Y minutes, a crash course in Rust, emphasizing writing Rust code. Ideal if you don’t have much time and want to learn as quickly as possible.
Oort, a game that teaches you Rust as you play