Memory safety means accessing memory only in valid ways, avoiding errors such as use-after-free and out-of-bounds access. In embedded Rust, compile-time checks enforce memory safety without adding runtime overhead, an important fit for tight memory budgets and predictable timing. section 1.1 section 1.0
Embedded language choices differ in how they provide memory safety and manage resource constraints:
- C and C++ offer control and a small runtime, but leave memory safety to the developer; reported failure sources include pointer aliasing, lifetime mistakes, and undefined behavior. section 1.1.3
- Rust uses compile-time checks rather than a garbage collector, preserving predictable timing and controlled memory use. Go’s collector can make timing unpredictable, while Zig relies more on developer discipline and review for safety. section 1.1.3
- MicroPython supports rapid prototyping, but its interpreter and runtime increase memory use and reduce predictability for production firmware. section 1.1.3




