Reproduce “C to O-O Translation: Beyond the Easy Stuff” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Marco Trudel, Carlo A. Furia, Martin Nordio, Bertrand Meyer, Manuel Oriol

Researchers at ETH Zurich developed C2Eif, an automated tool that translates C code into Eiffel, allowing for the reuse of legacy C applications within a modern object-oriented environment. The system successfully converted over 900,000 lines of diverse C code, producing functionally equivalent Eiffel programs that exhibited enhanced safety and exposed latent bugs in the original C versions.

Key insights

  • A fully automatic and complete translation of the entire C language, including its complex features, into a modern object-oriented language is technically feasible and can produce functionally equivalent code.
  • Targeting a language with strong safety features like Eiffel's Design by Contract (e.g., array bounds checking, null-pointer dereference checks) can automatically enhance the safety and debuggability of translated legacy code, revealing pre-existing bugs.
  • An incremental AST transformation approach, supported by carefully designed helper classes, provides a robust and modular methodology for bridging significant semantic differences between low-level and high-level programming paradigms.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.