Canonical 资助布里斯托大学三年博士项目,研究用 AI 将大型 C 代码库翻译成安全 Rust
Canonical backs quest to translate mountains of C into safe Rust with AI
Canonical 联合资助布里斯托大学编程语言研究组一个三年博士项目,研究 LLM 能否把“数十万行 C 代码”拆解为小组件并重写为安全、行为正确且可维护的 Rust。项目计划考察 snap-confine 和 AppArmor 两个具体工具,工程副总裁 Jon Seager 在 Ubuntu Discourse 论坛公布了这一投资。Seager 指出传统源码转换器常过度保留 C 结构,结果虽能编译为 Rust 却仍大量依赖 unsafe 操作。
正文
当前显示原文,中文全文译文尚未就绪。
SOFTWARE
Bungs banknotes at Bristol boffins to find out if mature code survives the machine
Canonical's fondness for AI and Rust is no secret. Now it is co-funding a three-year PhD project investigating whether the former can translate large C codebases into the latter.
Engineering veep Jon Seager announced the investment on Ubuntu's Discourse forum. The PhD project will be conducted at the University of Bristol's Programming Languages Research Group.
So don't panic. This is not an announcement that Canonical will turn the bots loose to rewrite all of Ubuntu as Rusty slop. (For a start, nobody can afford that many tokens.) Instead of burning dosh on bots, Canonical will pay a proto-boffin to spend several years investigating whether the idea can be made to work. That is welcome. In an industry overflowing with hype, the project should produce evidence about whether this approach can be useful.
The Reg FOSS desk interviewed Seager last year, and he struck us as sensible and pragmatic, but not lacking in boldness. Under his guidance, Ubuntu 25.10 adopted a Rust implementation of sudo as well as the entirely separate Rust-based uutils coreutils. The sudo command did hit some problems but they were quickly fixed.
Both uutils and sudo-rs were pre-existing independent projects, however. They are human-written replacements designed to reproduce the functionality of existing tools using entirely new codebases. Certainly, those human developers may have studied the original source code – that's one of the good things about FOSS, after all – but these are new implementations.
The new project will investigate whether an LLM can take programs "comprising hundreds of thousands of lines of C" and decompose them into smaller components before using an LLM to rewrite those components in "safe, behaviourally correct and maintainable Rust."
Seager's post runs to just over 1,000 words and addresses several objections that sprang to mind. For instance, existing tools attempt something similar, but their results leave much to be desired.
As Seager puts it: "Traditional source-to-source translators can process substantial amounts of code, but often preserve the structure of the C too literally. The result may compile as Rust, but still rely heavily on unsafe operations, retain awkward C idioms and require significant manual work before it resembles code a Rust maintainer would choose to own."
MORE CONTEXT
Hackers poison popular Rust crates to steal developers' credentials; Go updates may delight diehard gophers but displease AI overlords; NetBSD 11 lands with RISC-V support and lightning-fast VM boots; Next.js 16.3 aims to reduce dreaded FATAL ERROR messages
We suggest reading the post before attacking the idea. It sets out a relatively detailed and measured plan. One admirable aspect is its acknowledgment that mature codebases contain knowledge their programmers never consciously documented. Years of fixes and patches encode responses to real-world corner cases that nobody anticipated at the outset. This is the key argument of Joel Spolsky's 2000 essay: Things You Should Never Do, Part I. Such knowledge is rarely documented outside the code itself or, if you're lucky, a few comments. A machine translation might preserve some of that behavior, while a clean human rewrite based on the original design could miss it.
The proposal names two specific tools that the effort intends to examine: snap-confine and AppArmor We may be excessively cynical, but openSUSE 16 replaced AppArmor with SELinux last year. Outside the Ubuntu family, enterprise Linux has largely consolidated around the more complex SELinux, although Debian and several smaller distributions continue to support AppArmor. A hardened Rust implementation could therefore benefit AppArmor's remaining users. Snap, of course, has a narrower constituency still.
Three years is a conventional duration for a UK PhD – provided it does not overrun, of course. It's not as if someone could go into a PhD program in 1998 and then get two decades' worth of comic strips out of it or something.
The Reg FOSS desk remains staunchly skeptical of generative AI outside the narrow domain of translation between human languages. As such, we have grave doubts that this will prove viable. We suspect the difficult part will not be translating the code, but decomposing a large codebase into smaller components that bots can digest. The challenge recalls the long-running effort to divide arbitrary algorithms automatically into tasks that can be farmed out to parallel processes. Decades of research have produced useful techniques for particular cases, but no general solution. It may yet prove to be an incomputable problem, like the Halting Problem – and as that article says, if it could be solved, it would lead to solutions to the Busy Beaver function or even Goldbach's conjecture.
As with much of generative AI, more evidence is needed, and producing it is exactly what a PhD research project should do. We salute Canonical for putting real money behind the question and would be delighted to have our skepticism proved wrong. As we speculated in 2024, automatic translation between programming languages could become immensely valuable for improving software reliability – not by fixing problems automatically, but by exposing previously unknown errors. ®
Fire up that iPhone 1 emulation and party like it's 2007
Browser-based fun to remember a time before Apple's annual cash grab became a thing
New motherboards, old RAM, plenty of life left in yesterday's PCs
DDR4 makes a comeback as component costs rise, while Linux offers an escape from forced upgrades
The VMware exit is a protection upgrade
PARTNER CONTENT: VergeIO says an exit is also an opportunity
Tiny11 puts Windows 11 on a diet without the PowerShell workout
New desktop app simplifies stripping out bundled software, with heavier cuts carrying security and support risks
It won't kill you, or humanity, to get off the AI upgrade treadmill
New models arrive so fast, we already have more new tech than it's possible to understand in a career
Cisco, Nvidia team up to build fatter, faster pluggable
If you thought 1.6 Tbps was fast, just wait, Cisco's USFP targets 12.8 Tbps in a single optical pluggable
TOP STORIES
Anthropic asks users to stop being mean to Claude; '123456' password linked to Denmark data breach affecting 8.8M people; Microsoft and Anthropic play invoice tennis with startup's $17,600 Claude bill; Starlink's plan to avoid orbital near-misses: Ephemeris sharing; Shai-Hulud worm makes jump to AI infrastructure with Tensorlake compromise; Dutch tax office ditches Microsoft 365 cloud for on-premises alternative
Cisco, Nvidia team up to build fatter, faster pluggable If you thought 1.6 Tbps was fast, just wait, Cisco's USFP targets 12.8 Tbps in a single optical pluggable; Claude submitted fake murder tip to Philly police during summertime testing Anthropic took more than two months to alert cops; AI systems are fully capable of carrying out nightmare attacks against infrastructure and nobody's ready Meanwhile, AI agents move robotic arms, 'make OT device operator screens lie'; Nvidia found $1B under the couch to help secure American scientific computing dominance Commitment comes as GPUzilla prepares to fortify Uncle Sam's arsenal with at least seven AI-optimized supers; TSMC taps GlobalFoundries to bolster US silicon interposer production in $2B deal Advanced packaging tech is essential to the domestic production of high-performance semiconductors used in AI datacenters
Infosec
Security Russians are posing as Signal support to launch phishing attacks PLUS: US takes down Iranian propaganda sites; Marketing company asks 'Why Do We Have Your Information?' And more!; Security Microsoft patches failed to fix on-prem SharePoint, which is now under zero-day attack PLUS: China upgrades smartphone surveillance tools; Ring eases anti-snooping stance; and more; Black Hat and DEF CON DEF CON Franklin project enlists hackers to harden critical infrastructure Voting village reports have been so successful, says Jeff Moss, that the whole of DEF CON will now be included; Security EQT buys majority share in Swiss cybersecurity biz Acronis Went at equivalent of $3.5B+ valuation for entire firm, though portion sold not specified; Malware Month Ten years since the first corp ransomware, Mikko Hyppönen sees no end in sight On the plus side, infosec's a good bet for a long, stable career
FOSS
NetBSD may have found a new role: The AI-free FOSS OS Increasing awareness and adoption, followed by increasing donations; OpenAI dots inspire open source imitators amid technical difficulties Persistent agents appeal to AI companies, but demand isn't obvious; Ubuntu 'Stonking Stingray' beta swims out: Deeper Rust 'oxidization' plus LLM speech-to-text GNOME 51 is here, and Ubuntu interim releases are getting interesting again; Revive Raskin's 3 laws of software with humane work that considers a dev's duty of care All this, and angry NeoVim users; Firefox 157: Could bold new look be just what Mozilla needs?* Yet another new version of Firefox, with a significant reskin; KDE turns 30 and someone's brought an AI-native desktop proposal Akademy talk imagines Plasma assembling itself around a personal model of each user