Rust is the programming language of all time. - [Website](https://www.rust-lang.org/) - Source - [Documentation](https://www.rust-lang.org/learn) - [Package Registry](https://crates.io/) See also: [[Rust - Cargo]] # Why Rust is Slower Than C++ (sometimes) > Rust doesn't have true generic programming and Rust devs use C++-03 era macro vomit and code generation to make up for that lack, coupled with a strong opt-in system that despite having a cleaner compilation model encourages endless reimplementation nearly on par with C. > When \[MSVC\] swapped to C++11 with true variadics, and they stopped doing that, the code they compiled got faster. By a *lot*. Because they had real generic programming, and not some placeholder-based, specialization-based nonsense. Guess how Rust interacts with Tuples nearly everywhere? \- JeanHeyd Meneide via [Twitter](https://twitter.com/__phantomderp/status/1639010092149272578) # Rust Errors ## The ? Operator > The `?` placed after a `Result` value is defined to work in almost the same way as the `match` expressions we defined to handle the `Result` values in Listing 9-6. If the value of the `Result` is an `Ok`, the value inside the `Ok` will get returned from this expression, and the program will continue. If the value is an `Err`, the `Err` will be returned from the whole function as if we had used the `return` keyword so the error value gets propagated to the calling code. > > There is a difference between what the `match` expression from Listing 9-6 does and what the `?` operator does: error values that have the `?` operator called on them go through the `from` function, defined in the `From` trait in the standard library, which is used to convert values from one type into another. When the `?` operator calls the `from` function, the error type received is converted into the error type defined in the return type of the current function. This is useful when a function returns one error type to represent all the ways a function might fail, even if parts might fail for many different reasons. - https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator # Tips ## Demangling Rust Symbols - https://github.com/rui314/mold/issues/371 # Resources ## Lists of Apps - https://www.reddit.com/r/rust/comments/nm96n1/awesome_rewrite_it_in_rust_a_curated_list_of/ - https://github.com/casey/awesome-rewrite-it-in-rust - https://github.com/TaKO8Ki/awesome-alternatives-in-rust - https://zaiste.net/posts/shell-commands-rust/ ## Libraries ```cardlink url: https://github.com/emilk/egui title: "GitHub - emilk/egui: egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native" description: "egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native - emilk/egui" host: github.com favicon: https://github.githubassets.com/favicons/favicon.svg image: https://opengraph.githubassets.com/77150608c92c8b2fddd36f5e7de13b48a541ccfd554db254ccc6a8733a07e3a2/emilk/egui ``` ```cardlink url: https://macroquad.rs/ title: "Macroquad" description: "Macroquad is a simple and easy to use game library for Rust programming language." host: macroquad.rs favicon: https://macroquad.rs/favicon-32x32.png ``` ```cardlink url: https://github.com/not-fl3/miniquad title: "GitHub - not-fl3/miniquad: Cross platform rendering in Rust" description: "Cross platform rendering in Rust. Contribute to not-fl3/miniquad development by creating an account on GitHub." host: github.com favicon: https://github.githubassets.com/favicons/favicon.svg image: https://opengraph.githubassets.com/7265dbbb921a134933f9dcce65cee5c005405ab64d5b002b758e55382339dc4e/not-fl3/miniquad ``` ## Algorithms A big list of [[Data Structures and Algorithms]] implemented in Rust: ```cardlink url: https://github.com/TheAlgorithms/Rust title: "GitHub - TheAlgorithms/Rust: All Algorithms implemented in Rust" description: "All Algorithms implemented in Rust . Contribute to TheAlgorithms/Rust development by creating an account on GitHub." host: github.com favicon: https://github.githubassets.com/favicons/favicon.svg image: https://opengraph.githubassets.com/6219b94e391de03cb68d8ae2acf337a44d7d4ee828e964e8937d9da46751de67/TheAlgorithms/Rust ```