This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
prog:rust:intro [2024/06/24 06:09] – created Frank Fegert | prog:rust:intro [2024/06/24 12:48] (current) – Frank Fegert | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Introduction ====== | ====== Introduction ====== | ||
- | FIXME | + | [[wp> |
- | ====== Links ====== | + | Rust was influenced by ideas from functional programming, |
- | FIXME | + | Software developer Graydon Hoare created Rust as a personal project while working at Mozilla Research in 2006. Mozilla officially sponsored the project in 2009. In the years following the first stable release in May 2015, Rust was adopted by companies including Amazon, Discord, Dropbox, Google (Alphabet), Meta, and Microsoft. In December 2022, it became the first language other than C and assembly to be supported in the development of the Linux kernel. |
+ | |||
+ | Rust has been noted for its rapid adoption, and has been studied in programming language theory research. | ||
+ | |||
+ | ====== Links ====== | ||
===== General ===== | ===== General ===== | ||
- | FIXME | + | [[https:// |
+ | https:// | ||
+ | [[https:// | ||
+ | [[https:// | ||
/* [[]]\\ */ | /* [[]]\\ */ | ||
Line 16: | Line 23: | ||
FIXME | FIXME | ||
+ | |||
+ | ====== Articles ====== | ||
+ | |||
+ | [[https:// | ||
====== Files and Directories ====== | ====== Files and Directories ====== | ||
Line 30: | Line 41: | ||
====== Getting Help ====== | ====== Getting Help ====== | ||
- | |||
- | FIXME | ||
Manual pages: | Manual pages: | ||
<cli> | <cli> | ||
- | user@host: | + | user@host: |
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Builtin //Cargo// help: | ||
+ | |||
+ | < | ||
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
</ | </ | ||
====== Install ====== | ====== Install ====== | ||
- | FIXME | + | To install //Rust// and its build toolchain and package manager //Cargo// on Debian: |
+ | |||
+ | < | ||
+ | root@host: | ||
+ | </ | ||
- | To install //// on Debian: | + | To install //Rust// and its build toolchain and package manager //Cargo// from a more recent version |
<cli> | <cli> | ||
- | root@host: | + | root@host: |
</ | </ | ||
Line 54: | Line 78: | ||
====== Usage ====== | ====== Usage ====== | ||
+ | |||
+ | ===== Creating a new project ===== | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Compile and run a project ===== | ||
+ | |||
+ | Compile and run a project *with* debugging information: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Compile and run a project *optimized* and *without* debugging information: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Clean a project ===== | ||
+ | |||
+ | Clean a project from the artefacts of a previous compile and run: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Add a dependency to a project ===== | ||
+ | |||
+ | Add a external library dependency to a project. E.g. '' | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | Manually add a external library dependency to a project. E.g. '' | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config hello_world/ | ||
+ | [...] | ||
+ | |||
+ | [dependencies] | ||
+ | ferris-says = " | ||
+ | </ | ||
+ | |||
+ | Update the projects main code: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | File contents: | ||
+ | |||
+ | <file config hello_world/ | ||
+ | use ferris_says:: | ||
+ | use std:: | ||
+ | |||
+ | fn main() { | ||
+ | let stdout = stdout(); | ||
+ | let message = b" | ||
+ | let width = 24; | ||
+ | |||
+ | let mut writer = BufWriter:: | ||
+ | say(message, | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Compile and run the updated project: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | </ | ||
+ | |||
+ | ===== Set a dependency to a specific version in a project ===== | ||
+ | |||
+ | Set a first and second level dependency to a specific version in a project: | ||
+ | |||
+ | <cli> | ||
+ | user@host: | ||
+ | user@host: | ||
+ | </ | ||
FIXME | FIXME |