diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1691f22 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.png filter=lfs diff=lfs merge=lfs -text +*.jpg filter=lfs diff=lfs merge=lfs -text diff --git a/img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg b/img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg new file mode 100644 index 0000000..7fec9fb --- /dev/null +++ b/img/Bruine_roest_op_tarwe_(Puccinia_recondita_f.sp._tritici_on_Triticum_aestivum).jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f4f5404ad478234525978b8ab6683929aab025fc0d3dd039089a31776d79b88 +size 379451 diff --git a/img/cargo.png b/img/cargo.png new file mode 100644 index 0000000..39d6fd4 --- /dev/null +++ b/img/cargo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:210c2a75d9796903b80ce5984bb1add23e61303b41111bc03d05b0d319e33c04 +size 58282 diff --git a/rust-intro.org b/rust-intro.org index 716a161..ea61fa3 100644 --- a/rust-intro.org +++ b/rust-intro.org @@ -26,3 +26,79 @@ #+BEAMER_INNER_THEME: #+BEAMER_OUTER_THEME: #+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]]