Rust and Azure Sphere are a good match – a programming language that can improve safety of code with strict compile time safety checks alongside Azure Sphere’s secure identity, update, and end-to-end encrypted communication services for internet-connected devices should provide greater security to the customer applications.
Rust offers embedded developers a new level of performance and safety. It provides High-level ergonomics by bringing contemporary developer tools to systems programming and also low-level control. Low-level code is often prone to a variety of subtle bugs, which in most other languages can be caught only through extensive testing and careful code review by experienced developers. In Rust, the compiler refuses to compile code with these elusive bugs, including concurrency bugs. Rust endeavors to make safe code be fast code as well. Zero-cost abstractions ensure higher-level features compile to low-level code as fast as code is written manually. The checks performed by the Rust compiler ensures stability through feature additions and refactoring. This contrasts with the legacy code in languages without these checks, which are riskier and require closer attention, reviewing and testing.
Rust in Azure Sphere is implemented following Rust's crate system - where needed dependencies are built into what we would call the "customer app" for Azure Sphere. These dependencies interface with the same binary interfaces to the Azure Sphere OS that other applications interface with, for which we provide a long-term compatibility promise. Like other Azure Sphere apps, ones built in Rust today are expected to be fully functional in 2031, regardless of security patches, fixes, and new features added to the Azure Sphere OS by then. Rust can be highly efficient, but by including many dependencies in the app itself, you may need to evaluate how a Rust implementation utilizes memory compared to a C-language app in some cases.
Here is the link to the project – azure-sphere-gallery/Rust at main · Azure/azure-sphere-gallery · GitHub if you want to take a look to see if it might be useful - particularly the license terms (MIT) and the API and sample coverage. The code on GitHub is an active development tree. We encourage outside contributions (after dialog) and will do our best to integrate them. Please feel free to engage with the Azure Sphere team directly as we continue to build up this platform by emailing us from your corporate email to firstname.lastname@example.org.