Using rust with bitbake and meta-rust
- About me
- Senior Firmware Developer at Lexmark International
- Using bitbake to build laser printer firmware
- Been using bitbake professionally since 2014
- Using and advocating for rust since pre 1.0 days
- What is rust?
- Compare to go
- GC vs. no gc
- null pointers vs. not
- Algebraic types
- Borrow checker
- Extremely powerful macro system
- Why would you want to use rust?
- High performance
- Low overhead
- Safer than C/C++
- Con: increased time from "I wrote a thing" to "it builds"
- Pro: decreased time from "I wrote a thing" to "it works and covers edge cases and common security problems"
- Ideal for code that needs to process untrusted inputs
- Network client/servers
- Parsing byte streams
- Rich tool ecosystem
- Why not use rust?
- Still maturing (async/await is still maturing)
- Code size (relative to C/C++)
- Can iterate faster with a higher level language
- Not ideal for all domains (e.g. GUI app)
- meta-rust
- Used by Microsoft's meta-iotedge project
- rust is easy to cross-compile relative to other languages I've used
- Pro: cargo is "batteries included" and can do everything for you as a stand-alone tool
- Con: cargo expects to do everything for you, including dependency management
- cargo bitbake (Example?)
- meta-rust intended for cross-compile, not self-hosting yet
- Future of meta-rust (oe-core inclusion)
- Thanks to meta-rust the maintainers!
- Cody Schafer
- Doug Goldstein
- Tyler Hall
- Paul Osborne
- Derek Straka
- Everyone who has contributed
Abstract
An overview of the Rust programming language and how the meta-rust project
enables convenient Rust development in Yocto-based projects
Description
This session will discuss using the Rust programming language in Yocto-based
projects. We will cover how to enable Rust cross-compiler infrastructure using
meta-rust. By the end of the session participants will have information on
building a Rust-based application with bitbake. We will also cover the
advantages of using Rust and how it compares to other modern programming
languages. Participants will be equipped to know where Rust will be most
effective and what trade-offs exist in its use.
The ideal audience is anyone who is curious about the Rust programming
language, or new languages in general, with some familiarity of the Yocto
project. Assumes no existing knowledge about Rust.