4. Infos zu Rust
• 2006 als privates Projekt des Entwicklers Graydon Hoare gestartet.
• Ab 2009 von seinem Arbeitgeber (Mozilla) unterstützt.
• Rust 1.0 am 15. Mai 2015.
• 2021 wurde die Rust Foundation gegründet.
• Sponsoren/Nutzer: Amazon (AWS), Microsoft, Google, Mozilla, uvm.
• "Most loved programming language" seit 2016 im Stack Overflow
Developer Survey.
• Stabile Releases alle 6 Wochen, alle 3 Jahre eine neue "Edition".
5. Besondere Merkmale von Rust
• Sicheres, automatisches Speichermanagement ohne Garbage Collector.
• Nebenläufigkeit ohne Data Races ("Fearless Concurrency").
• Abstraktionen mit möglichst geringem Overhead ("Zero Cost Abstractions").
• Effizientes Interface zu C/C++.
• Aussagekräftige Fehlermeldungen des Compilers.
14. Tools, Tools, Tools...
• rustup – Verwaltung der Rust-Installation
• rustc – Der Rust-Compiler
• cargo – Project-/Build-/Test-/Documentation-/Package-Management
• Knurling Tools
• probe-run – cargo runner zum Flashen und Ausführen von Anwendungen (z.B. über JTAG)
• defmt – Logging Framerwork
• flip-link – Stack Protection
• app-template – Vorlagen für eigene Anwendungen
• defmt-test – Test-Framework für On-Device-Tests
15. rustc – Target Platform Support Policy
• Tier 1: Continuous Integration checks that tier 1 targets will always
build and pass tests.
• Tier 2: Continuous Integration checks that tier 2 targets will always
build, but they may or may not pass tests.
• Tier 3: No guarantees about tier 3 targets; they exist in the codebase,
but may or may not build.
https://doc.rust-lang.org/rustc/target-tier-policy.html
18. std vs. no_std
Feature no_std std
heap (dynamic memory) * ✓
collections (Vec, HashMap, etc) ** ✓
stack overflow protection ✘ ✓
runs init code before main ✘ ✓
libstd available ✘ ✓
libcore available ✓ ✓
writing firmware, kernel, or
bootloader code
✓ ✘
* => Nur bei Verwendung des alloc Crates und eines passenden Allocators, wie z.B. alloc-cortex-m
** => Nur bei Verwendung der alloc oder heapless Crates
https://docs.rust-embedded.org/book/intro/no-std.html
31. Fazit
Rust als Sprache für eingebettete Systeme bietet:
• Hohe Performance, geringer Speicherverbrauch.
• Sicheres Speichermanagement.
• Sichere Nebenläufigkeit.
• Viele unterstützte Architekturen (ARM, RISC-V, etc.), Microcontroller und Boards.
• Viele Treiber für externe Hardware bereits vorhanden.
• Komfortables Tooling, welches etablierten Sprachen und Frameworks in nichts nachsteht.
• Teilweise steile Lernkurve (aber es lohnt sich!)
• Freundliche und hilfsbereite Community.
• Open Source (Bitte unterstützen!).