Author ported the entire tmux codebase from about 67,000 lines of C to 81,000 lines of unsafe Rust after finding C2Rust output unmaintainable.
Build process evolved from autotools and Makefile integration with a static Rust library to using a Rust-centric build.rs with the cc crate to compile remaining C files.
Common bugs included implicit C function declarations truncating pointer results and struct field type mismatches between C and Rust definitions.
C idioms like raw pointers, goto statements, intrusive macros, and Yacc parsers were remapped to Rust using unsafe pointers, labeled blocks/loops, generic traits, and the lalrpop parser generator.
Development relied on Vim macros for mechanical code refactoring and trials with AI tools like Cursor, which helped reduce finger strain but introduced bugs.
Despite reaching 100% unsafe Rust, the next goal is to refactor the codebase to safe Rust and improve maintainability.
Get notified when new stories are published for "General AI News"