HackerPapers

arXiv:2503.23791cs.PL

LLMigrate: Transforming "Lazy" Large Language Models into Efficient Source Code Migrators

Yuchen Liu, Junhao Hu, Yingdi Shan, Ge Li, Yanzhen Zou, Yihong Dong, Tao Xie

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

Rewriting C code in Rust provides stronger memory safety, yet migrating large codebases such as the 32-million-line Linux kernel remains challenging. While rule-based translators (e.g., C2Rust) provide accurate yet largely unsafe Rust programs, recent Large Language Model (LLM) approaches produce more idiomatic, safe Rust programs but frequently exhibit "laziness", omitting significant portions of the target code. To address the issue, in this paper, we present LLMigrate, an LLM-based C-to-Rust translation tool that splits modules into discrete functions, translating them individually, and then reintegrating them. LLMigrate uses static analysis to retain necessary context, pairs GPT-4o (a state-of-the-art LLM) with compiler-driven translation and program-repair techniques for complex core functions, and leverages call-graph-guided translation to ensure consistent interfaces. Evaluations on three representative Linux kernel modules (math, sort, and ramfs) show that LLMigrate requires modifying less than 15\% of the target code, significantly outperforming a pure GPT-4o-based migration.

arXiv comments
Journal reference
DOI
Subjects
cs.PLProgramming Languages cs.SESoftware Engineering

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Sep 2025 to Sep 2025.

Comments linking this paper, per year.

Discussed in comments1 thread

  1. What to do with C++ modules? 1 comment
    • Here are a few https://www.phoronix.com/news/Google-Linux-Binder-In-Rust https://arxiv.org/abs/2503.23791v1 https://www.darpa.mil/research/programs/translating-all-c-to... https://link.springer.com/content/pdf/10.1007/s10664-024-105... > Everybody would be doing it by now Models…

      ra1231963View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.