We can have nice things
summary
Claim: legacy system code can be incrementally replaced with Rust while keeping the C ABI and build chain working. Method: annotate structs with repr(C), expose functions with no_mangle extern "C", build a static library via cargo and link from C. Example: Rust can reorder fields to shrink struct size but must match C layout when needed. Case study: LibreSVG begins Rust work in 2016, porting a ~30,000 lines C codebase, test coverage and CI cause source to grow yet contributors to old C code drop to zero and the rewrite succeeds.
AI-written summary · about
chapters (13)
- 0:00Intro
- 1:50Federico Mena
- 7:20History of software
- 11:14The 90s
- 16:09The nice things
- 17:58A horror story
- 23:02Git
- 25:17Reusable environments
- 27:17Rewrite it in Rust
- 29:46What have we learned
- 30:12Continuous integration
- 30:52Integrating Rust into C
- 38:20Conclusion
related talks
26mMoving to modern languages in long-living projects
28mC2Rust: Migrating Legacy Code to Rust
31mUsing Rust from C... or Any Language
42mRewrite It In Rust: Can We RIIR Everything?
26mIntroducing Rust into a Legacy Embedded System
01h 11mDuck-Tape Chronicles - Rust C++ Interop
06mHow We Replace Common C and C++ Libraries
31mEmbedding Rust in C/C++
