How US Agencies Plan to Ditch C: AI Tool to Auto‑Convert Legacy C Code to Rust
The article examines DARPA's TRACTOR project, which aims to use large‑language‑model AI to automatically translate legacy C and C++ code into safe Rust, discusses the memory‑safety motivations, technical challenges, community reactions, and the broader push by US agencies to abandon unsafe languages.
DARPA has launched the TRACTOR program (Translating All C to Rust) to develop an AI‑driven tool that can automatically convert existing C and C++ codebases into Rust, targeting the same quality as experienced Rust developers and eliminating memory‑safety vulnerabilities.
The agency highlights that memory‑safety bugs are the most common software defects, citing NSA reports that 70% of Microsoft’s 2006‑2018 vulnerabilities and a similar share in Google Chrome stem from unsafe memory handling, and urging a shift from C/C++ to memory‑safe languages such as Rust, C#, Go, Java, Ruby and Swift.
Despite strong policy calls, the migration faces huge practical obstacles: decades‑old, pervasive C code in critical systems, the high cost and long‑term planning required, and technical gaps such as pointer arithmetic and undefined‑behavior constructs that Rust forbids. DARPA notes that merely relying on static analysis tools is insufficient.
TRACTOR’s approach combines static and dynamic software analysis with large‑language‑model assistance, and includes an open competition to showcase solutions. The program will hold an event on 26 August 2024, with registration due by 19 August 2024.
Community feedback is mixed. Josh Aas (Prossimo) says translating large C codebases to Rust is attractive but current tools need manual tweaking. Developer mike_heran warns about the difficulty of handling Rust’s different idioms and the challenge of analyzing lifetimes in C. Another developer, blonk, questions whether the effort is justified given code‑base size and resource allocation. Concerns are also raised about whether the tool will merely copy existing bugs into Rust or actually detect and report them.
The article concludes that while AI‑assisted one‑click conversion is an appealing idea, significant research challenges remain before TRACTOR can reliably replace legacy C code with safe Rust implementations.
Linux Code Review Hub
A professional Linux technology community and learning platform covering the kernel, memory management, process management, file system and I/O, performance tuning, device drivers, virtualization, and cloud computing.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
