4.2 KiB
4.2 KiB
∈cludesvg[height=.25\textheight]{img/rust-logo-blk}≠wline An introduction to Rust
- Rust
- Cargo
- Setup
- Hands on
- IDE support
- Cargo plugins
- WebDev
- Embedded
- (Standard?) crates
- Further information
- Footnotes
Rust
Abstract
#+LaTeX:∈cludegraphics[width = 0.5\textwidth]{img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg} 2
Rust, the language
- A bit more than 10 years old (2010)
- Memory safe without gcing, optional ref counting
- Ownership, lifetimes, traits, functional paradigms
- Variables are immutable by default and can be shadowed
- Performance of idiomatic Rust is comparable to the performance of idiomatic C++
- A well designed language and ecosystem
Strengths and Weaknesses1
Things Rust does measurably really well
- Compiled code about same performance as C / C++, and excellent memory and energy efficiency.
- Can avoid 70% of all safety issues present in C / C++, and most memory issues.
- Strong type system prevents data races, brings 'fearless concurrency' (amongst others).
- Seamless C interop, and dozens of supported platforms (based on LLVM).3
- "Most loved language" for 6 years in a row.
- Modern tooling:
cargo
(builds just work),clippy
(450+ code quality lints),rustup
(easy toolchain mgmt).
Strengths and Weaknesses1
Points you might run into
- Steep learning curve4 compiler enforcing (esp. memory) rules that would be "best practices" elsewhere.
- Missing Rust-native libs in some domains, target platforms (esp. embedded), IDE features.4
- Longer compile times than "similar" code in other languages.45
- No formal language specification, can prevent legal use in some domains (aviation, medical, …).6
- Careless (use of
unsafe
in) libraries can secretly break safety guarantees.
Cargo
Cargo
What is it?
- Package manager
- Build tool
Setup
Hands on
IDE support
Cargo plugins
WebDev
Embedded
(Standard?) crates
Further information
Footnotes
1
Copied list from: https://cheats.rs.
3
Work on GCC: rust-gcc and gcc rust backend.