PLDB
Languages Features Calendar About Lists Add Language
GitHub icon

Rust

Rust

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

Example code from Riju:

fn main() { println!("Hello, world!"); }

Example code from hello-world:

fn main() { println!("Hello World"); }

Example code from the Hello World Collection:

// Hello world in Rust fn main() { println!("Hello World!"); }

Example code from Linguist:

extern crate foo; extern crate bar; use foo::{self, quix}; use bar::car::*; use bar; fn main() { println!("Hello {}", "World"); panic!("Goodbye") }

Keywords in Rust

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

Language features

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 ฯด

Trending Rust repos on GitHub

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

Article source

PLDB - Build the next great programming language. v5.0.0 - Acknowledgements ยท Email ยท GitHub