Basic structure and first slides

Create a basic structure and add the first slides about Rust in
general.
This commit is contained in:
finga 2021-09-02 15:15:48 +02:00
parent 30ede357e2
commit 9ced692aa8
4 changed files with 84 additions and 0 deletions

2
.gitattributes vendored Normal file
View file

@ -0,0 +1,2 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text

Binary file not shown.

BIN
img/cargo.png (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -26,3 +26,79 @@
#+BEAMER_INNER_THEME: #+BEAMER_INNER_THEME:
#+BEAMER_OUTER_THEME: #+BEAMER_OUTER_THEME:
#+LaTeX_CLASS_OPTIONS: [smaller] #+LaTeX_CLASS_OPTIONS: [smaller]
* Rust
** Abstract
#+BEGIN_CENTER
#+LaTeX:\includegraphics[width = 0.5\textwidth]{img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg}
[fn:1]
#+END_CENTER
*** 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 Weaknesses[fn:2]
*** Things Rust does measurably really well
- Compiled code [[https://benchmarksgame-team.pages.debian.net/benchmarksgame/which-programs-are-fastest.html][about same performance as C / C++]], and excellent
[[https://dl.acm.org/doi/10.1145/3136014.3136031][memory and energy efficiency]].
- Can [[https://www.chromium.org/Home/chromium-security/memory-safety][avoid 70% of all safety issues]] present in C / C++, and most
memory issues.
- Strong type system prevents [[https://doc.rust-lang.org/nomicon/races.html][data races]], brings [[https://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html]['fearless
concurrency']] (amongst others).
- Seamless C interop, and [[https://doc.rust-lang.org/rustc/platform-support.html][dozens of supported platforms]] (based on
LLVM).[fn:3]
- [[https://insights.stackoverflow.com/survey/2021#technology-most-loved-dreaded-and-wanted]["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 Weaknesses[fn:2]
*** Points you might run into
- Steep learning curve[fn:4] compiler enforcing (esp. memory)
rules that would be "best practices" elsewhere.
- Missing Rust-native libs in some domains, target platforms
(esp. embedded), IDE features.[fn:4]
- Longer compile times than "similar" code in other
languages.[fn:4][fn:5]
- No formal language specification, can prevent legal use in some
domains (aviation, medical, ...).[fn:6]
- Careless (use of ~unsafe~ in) libraries can secretly break
safety guarantees.
* Cargo
** Cargo
#+ATTR_LaTeX: :height 0.4\textwidth
[[./img/cargo.png]]
** What is it?
- Package manager
- Build tool
* Setup
* Hands on
* IDE support
* Cargo plugins
* WebDev
* Embedded
* (Standard?) crates
* Further information
* Footnotes
[fn:1] [[https://commons.wikimedia.org/wiki/File:Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg][Wikimedia]]
[fn:2] Copied list from: https://cheats.rs.
[fn:3] Work on GCC: [[https://rust-gcc.github.io/][rust-gcc]] and [[https://news.ycombinator.com/item?id=27775544][gcc rust backend]].
[fn:4] [[https://blog.rust-lang.org/2020/04/17/Rust-survey-2019.html#why-not-use-rust][Rust survey]]
[fn:5] [[https://news.ycombinator.com/item?id=23538220][The Rust compiler isn't slow; we are]]
[fn:6] [[https://people.mpi-sws.org/%7Ejung/thesis.html][Understanding and Evolving the Rust Programming Language]]