Rust is a programming language created in 2010 by Graydon Hoare.
Rust is a systems programming language sponsored by Mozilla Research, which describes it as a "safe, concurrent, practical language," supporting functional and imperative-procedural paradigms. Rust is syntactically similar to C++, but its designers intend it to provide better memory safety while maintaining performance. Rust is an open source programming language. Read more on Wikipedia...
Try now: Riju ยท TIO ยท Replit
#20on PLDB | 12Years Old | 194.0kUsers |
fn main() {
println!("Hello, world!");
}
fn main() {
println!("Hello World");
}
// Hello world in Rust
fn main() {
println!("Hello World!");
}
extern crate foo;
extern crate bar;
use foo::{self, quix};
use bar::car::*;
use bar;
fn main() {
println!("Hello {}", "World");
panic!("Goodbye")
}
abstract alignof as become box break const continue crate do else enum extern false final fn for if impl in let loop macro match mod move mut offsetof override priv proc pub pure ref return Self self sizeof static struct super trait true type typeof unsafe unsized use virtual where while yield
Feature | Supported | Example | Token |
---|---|---|---|
Conditionals | โ | ||
Constants | โ | ||
While Loops | โ | ||
Booleans | โ | true false | |
Line Comments | โ | // A comment |
// |
Print() Debugging | โ | println!("Hi"); |
println! |
Operator Overloading | โ | ||
Macros | โ | https://doc.rust-lang.org/book/ch19-06-macros.html |
|
Iterators | โ | for n in 0..42 { println!("{}", n); } |
|
File Imports | โ | use ::std::fs; // Imports from the `std` crate, not the module below. use self::std::fs as self_fs; // Imports the module below. mod my; use self::foo::Zoo as _; #[path = "foo.rs"] mod c; |
|
Directives | โ | // A conditionally-compiled module #[cfg(target_os = "linux")] mod bar { /* ... */ } // General metadata applied to the enclosing module or crate. #![crate_type = "lib"] // A function marked as a unit test #[test] fn test_foo() { /* ... */ } // A lint attribute used to suppress a warning/error #[allow(non_camel_case_types)] type int8_t = i8; // Inner attribute applies to the entire function. fn some_unused_variables() { #![allow(unused_variables)] let x = (); let y = (); let z = (); } |
|
MultiLine Comments | โ | /* A comment */ |
/* */ |
Comments | โ | // https://doc.rust-lang.org/reference/comments.html // a comment |
|
Strings | โ | "hello world" |
" |
Semantic Indentation | ฯด |
repo | stars | description |
---|---|---|
rust | 38932 | Empowering everyone to build reliable and efficient software. |
druid | 623 | Data-oriented Rust UI design toolkit. |
yew | 8506 | Rust framework for building client web apps |
zola | 2306 | A fast static site generator in a single binary with everything built-in. |
wasmer | 4321 | The Universal WebAssembly Runtime |
wrangler | 644 | ๐ค wrangle your cloudflare workers |
awesome-rust | 12178 | A curated list of Rust code and resources. |
wasmtime | 1282 | "Standalone JIT-style runtime for WebAssembly using Cranelift" |
tokio | 5810 | "A runtime for writing reliable asynchronous applications with Rust. Provides I/O networking scheduling timers ..." |
Rocket | 7888 | A web framework for Rust. |
hyper | 5153 | An HTTP library for Rust |
futures-rs | 2833 | Zero-cost asynchronous programming in Rust |
spotifyd | 2017 | A spotify daemon |
azul | 3105 | Desktop GUI Framework |
regex | 1200 | An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs. |
servo | 14762 | The Servo Browser Engine |
tracing | 262 | Application level tracing for Rust. |
cranelift | 2066 | Cranelift code generator |
ggez | 1715 | Rust library to create a Good Game Easily |
cargo | 4696 | The Rust package manager |
bat | 15094 | A cat(1) clone with wings. |
substrate | 1437 | Substrate: The platform for blockchain innovators |
gfx | 3334 | A low-overhead Vulkan-like GPU API for Rust. |
rust-clippy | 3740 | A bunch of lints to catch common mistakes and improve your Rust code |
reqwest | 1782 | An easy and powerful Rust HTTP Client |