111763 Views
85221 Views
83639 Views
51774 Views
49949 Views
48472 Views
Obsidian - the best tool for Makers
10 Projects for your Raspberry Pi Pico
Raspberry Pi Telegraf Setup with Docker
Setting Up Dynamic DNS on a Raspberry Pi for Self-Hosting
Raspberry Pi WordPress Setup with Docker
Raspberry Pi WireGuard VPN Setup with Docker
Using the Raspberry Pi Pico's Built-in Temperature Sensor
Getting Started with SQL
Introduction to the Linux Command Line on Raspberry Pi OS
How to install MicroPython
Wall Drawing Robot Tutorial
BrachioGraph Tutorial
KevsRobots Learning Platform
7% Percent Complete
By Kevin McAleer, 4 Minutes
Rust is a system programming language focused on safety, especially safe concurrency, supporting functional and imperative-procedural paradigms. This lesson is an introduction to Rust programming, especially tailored for programmers with a background in Python or MicroPython.
Rust
Rust is a programming language that focuses on speed, memory safety, and parallelism. It is designed to be a safer, concurrent, practical language, supporting pure-functional, imperative-procedural, and object-oriented styles.
The development of Rust began as a personal project by Graydon Hoare in 2006. Mozilla sponsored the project in 2009 and announced it in 2010. The language steadily grew in popularity and saw its first stable release, Rust 1.0, on May 15, 2015. Since then, it has rapidly evolved, driven by an active community and an open development process.
The name “Rust” is a play on words related to the rust fungus, which is a parasite that grows on fast, distributed systems (a nod to the speed and concurrency aims of the language). Additionally, rust (the corrosion) is seen as a slower, more relentless process that breaks down old systems, aligning with the language’s goal to provide a safer alternative to older system programming languages like C and C++.
The goals of Rust are defined by its design choices, which aim to create a language that:
Rust’s design is intended to support highly concurrent and highly safe systems, and “safe code” can be as fast as “unsafe code” in languages like C and C++. This approach comes from the language’s unique blend of low-level control over memory with high-level language features.
The origins of Rust are deeply rooted in the desire to improve system programming through memory safety, concurrency, and performance. Created by Graydon Hoare and developed with the backing of Mozilla, Rust has grown into a widely used language that seeks to change how developers think about safe, efficient, and concurrent code. The Rust programming community continues to build on these goals, pushing the boundaries of what’s possible in system-level programming.
Rust offers memory safety without garbage collection, and concurrency without data races. It’s designed to help you write fast, reliable software. Here are some reasons to consider Rust:
To get started with Rust:
rustc --version
Let’s write your first Rust program, a classic ‘Hello, World!’:
fn main() { println!("Hello, World!"); }
To run this program:
.rs
hello_world.rs
./hello_world
hello_world.exe
You should see Hello, World! printed in the terminal.
In this lesson, you’ve been introduced to the Rust programming language. You’ve learned why Rust can be a powerful tool in your programming arsenal, how to install it, and how to write and execute your first Rust program.
Next >