Rust is a programming language created in 2010 by Graydon Hoare.
#26on PLDB | 13Years Old | 302.2kUsers |
65Books | 36Papers | 357kRepos |
Try now: Riju · TIO · Replit
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...
// Type your code here, or load an example.
pub fn square(num: i32) -> i32 {
num * num
}
// If you use `main()`, declare it as `pub` to see it in the output:
// pub fn main() { ... }
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 | Token | Example |
---|---|---|---|
Conditionals | ✓ | ||
Constants | ✓ | ||
While Loops | ✓ | ||
Booleans | ✓ | true false | |
Line Comments | ✓ | // | // A comment |
Type Inference | ✓ | ||
Print() Debugging | ✓ | println! | println!("Hi"); |
Pattern Matching | ✓ | ||
Operator Overloading | ✓ | ||
Macros | ✓ | // https://doc.rust-lang.org/book/ch19-06-macros.html #[macro_export] macro_rules! vec { ( $( $x:expr ),* ) => { { let mut temp_vec = Vec::new(); $( temp_vec.push($x); )* temp_vec } }; } |
|
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" |
Case Insensitive Identifiers | X | ||
Semantic Indentation | X |
title | authors | year | citations | influentialCitations |
---|---|---|---|---|
The rust language | Nicholas D. Matsakis and Felix S. Klock | 2014 | 238 | 25 |
RustBelt: securing the foundations of the rust programming language | Ralf Jung and Jacques-Henri Jourdan and R. Krebbers and Derek Dreyer | 2017 | 192 | 23 |
Is Rust Used Safely by Software Developers? | A. Evans and Bradford Campbell and M. Soffa | 2020 | 23 | 5 |
Understanding memory and thread safety practices and issues in real-world Rust programs | Boqin Qin and Yilun Chen and Zeming Yu and Linhai Song and Yiying Zhang | 2020 | 23 | 5 |
POSTER: Rust SGX SDK: Towards Memory Safety in Intel SGX Enclave | Yu Ding and Ran Duan and Long Li and Yueqiang Cheng and Yulong Zhang and Tanghui Chen and Tao Wei and Huibo Wang | 2017 | 21 | 4 |
Sandcrust: Automatic Sandboxing of Unsafe Components in Rust | Benjamin Lamowski and C. Weinhold and A. Lackorzynski and Hermann Härtig | 2017 | 20 | 3 |
Verifying Rust Programs with SMACK | Marek S. Baranowski and Shaobo He and Z. Rakamaric | 2018 | 20 | 1 |
Safe systems programming in Rust | Ralf Jung and Jacques-Henri Jourdan and R. Krebbers and Derek Dreyer | 2021 | 17 | 0 |
KRust: A Formal Executable Semantics of Rust | Feng Wang and Fu Song and Min Zhang and Xiaoran Zhu and Jun Zhang | 2018 | 12 | 1 |
Exploring Rust for Unikernel Development | Stefan Lankes and J. Breitbart and Simon Pickartz | 2019 | 12 | 0 |
Understanding and evolving the Rust programming language | Ralf Jung | 2020 | 11 | 1 |
Fidelius Charm: Isolating Unsafe Rust Code | Hussain M. J. Almohri and David Evans | 2018 | 8 | 2 |
Design of a DSL for Converting Rust Programming Language into RTL | K. Takano and Tetsuya Oda and M. Kohata | 2020 | 8 | 0 |
Identifying Barriers to Adoption for Rust through Online Discourse | Anna Zeng and Will Crichton | 2019 | 7 | 0 |
Memory-Safety Challenge Considered Solved? An In-Depth Study with All Rust CVEs | Hui Xu and Zhuangbin Chen and Mingshen Sun and Yangfan Zhou and Michael R. Lyu | 2020 | 6 | 1 |
Securing UnSafe Rust Programs with XRust | Peiming Liu and Gang Zhao and Jeff Huang | 2020 | 6 | 2 |
GhostCell: separating permissions from data in Rust | Joshua Yanovski and Hoang-Hai Dang and Ralf Jung and Derek Dreyer | 2021 | 5 | 1 |
A Lightweight Formalism for Reference Lifetimes and Borrowing in Rust | David J. Pearce | 2021 | 5 | 0 |
What can the programming language Rust do for astrophysics? | S. Blanco-Cuaresma and É. Bolmont | 2016 | 5 | 0 |
On utilizing rust programming language for Internet of Things | Tunç Uzlu and E. Saykol | 2017 | 4 | 0 |
Structured Stream Parallelism for Rust | Ricardo Pieper and Dalvan Griebler and L. G. Fernandes | 2019 | 3 | 0 |
Keeping Safe Rust Safe with Galeed | Elijah Rivera and Samuel Mergendahl and Howie Shrobe and H. Okhravi and N. Burow | 2021 | 3 | 0 |
RustHornBelt: a semantic foundation for functional verification of Rust programs with unsafe code | Yusuke Matsushita and Xavier Denis and Jacques-Henri Jourdan and Derek Dreyer | 2022 | 2 | 0 |
Towards Profile-Guided Optimization for Safe and Efficient Parallel Stream Processing in Rust | Stefan Sydow and Mohannad Nabelsee and S. Glesner and Paula Herber | 2020 | 2 | 0 |
Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale | Yechan Bae and Youngsuk Kim and Ammar Askar and Jungwon Lim and Taesoo Kim | 2021 | 2 | 1 |
Detecting Unsafe Raw Pointer Dereferencing Behavior in Rust | Zhijian Huang and Y. Wang and J. Liu | 2018 | 1 | 0 |
Basics of Rust | J. Bhattacharjee | 2019 | 1 | 0 |
Devise Rust Compiler Optimizations on RISC-V Architectures with SIMD Instructions | Heng Lin and Piyo Chen and Yuan-Shin Hwang and Jenq-Kuen Lee | 2019 | 1 | 0 |
Verification of Safety Functions Implemented in Rust - a Symbolic Execution based approach | Marcus Lindner and Nils Fitinghoff and Johan Eriksson and P. Lindgren | 2019 | 1 | 0 |
Verifying Dynamic Trait Objects in Rust | Alexa VanHattum and Daniel Schwartz-Narbonne and Nathan Chong and Adrian Sampson | 2022 | 1 | 0 |
SafeDrop: Detecting Memory Deallocation Bugs of Rust Programs via Static Data-Flow Analysis | Mohan Cui and Chengjun Chen and Hui Xu and Yangfan Zhou | 2021 | 1 | 0 |
VRLifeTime -- An IDE Tool to Avoid Concurrency and Memory Bugs in Rust | Ziyi Zhang and Boqin Qin and Yilun Chen and Linhai Song and Yiying Zhang | 2020 | 1 | 0 |
Approach of a Coding Conventions for Warning and Suggestion in Transpiler for Rust Convert to RTL | K. Takano and Tetsuya Oda and M. Kohata | 2020 | 1 | 0 |
Translating C to safer Rust | Mehmet Emre and Ryan Schroeder and Kyle Dewey and B. Hardekopf | 2021 | 1 | 0 |
Performance vs Programming Effort between Rust and C on Multicore Architectures: Case Study in N-Body | Manuel Costanzo and Enzo Rucci and M. Naiouf and A. D. Giusti | 2021 | 1 | 0 |
On Evaluating Rust as a Programming Language for the Future of Massive Agent-Based Simulations | Alessia Antelmi and G. Cordasco and Matteo D'Auria and Daniele De Vinco and A. Negro and Carmine Spagnuolo | 2019 | 1 | 0 |