RustConf 2023 - Fine! I'll just make my own stable ABI!

Discover how Stabi, a library, makes Rust's ABI stable, enabling dynamic linkage and compact enums, and learn about its applications in frameworks like Xeno and Rufus.

Key takeaways
  • Stable ABI in Rust is important because it allows for plugins to have a consistent layout in memory, making it easier to implement dynamic linkage.
  • C ABI is not stable, which means that the same binary can be compiled on different platforms and have different layouts in memory.
  • Rust has unstable ABI, which makes it difficult to implement dynamic linkage.
  • Stabi, a library, can make Rust’s ABI stable.
  • Stable ABI is important for dynamic linkage, and it allows plugins to be loaded dynamically.
  • Rust’s ABI stability is not just about the type’s layout in memory, but also about how functions are called and how fields are aligned.
  • Stabi uses a different approach to make Rust’s ABI stable, and it provides a way to make enums compact.
  • Compact enums are important for ABI stability, and they can be used to implement dynamic linkage.
  • Rust’s default API for product types does not support compact enums, but Stabi provides a way to make them compact.
  • ABI stability is important for Rust’s trait objects, and it allows them to be implemented in a way that is similar to normal trait objects.
  • Xeno is a data-centric, plug-in based framework that uses Rust and is designed to be flexible and self-healing.
  • Rufus is a plugin system that uses Rust and is designed to be simple and lightweight.