Hacker GitHub

← All repos

immunant/c2rust

View on GitHub ↗ ★ 4,832 Rust

Migrate C code to Rust

56 mentions on Hacker News by 32 people: 5 stories, 51 comments · first 2018-07-02 · latest 2026-07-05

Mentions per year 56 mentions · busiest year 2019 (14)
20082026
  1. …result in just as much unsafe) than a result of LLMs reaching for escape hatches too liberally. [1] https://github.com/immunant/c2rust
  2. …bug-free, and C and Rust's undefined behavior semantics overlap but aren't identical. One example: https://github.com/immunant/c2rust/issues/1678 I firmly believe the right way to port C and C++ (and Zig) programs to Rust is to do it…
  3. …utilize decompilation techniques, I do not see anything of that in any existing project. - C2Rust: https://github.com/immunant/c2rust From what I see, very limited testing of what C can be uplifted. - Citrus:…
    comment by kant2002 · 2025-11-03 · in Automatically Translating C to Rust
  4. There's non-LLM research towards doing this which has a few success stories: https://github.com/immunant/c2rust LLMs seem generally unsuited for the task, because they're fundamentally approximators that won't always get things right, and…
  5. Past work in the area by the folks at Immunant ( https://immunant.com/ ) that appears to be on-going https://github.com/immunant/c2rust . I think the project was also DARPA funded for a time.
  6. …this in their closing remarks: > The next goal is to convert the codebase to safe Rust. [1] https://github.com/immunant/c2rust/raw/master/docs/c2rust-ov...
    comment by jonpalmisc · 2025-07-03 · in Introducing tmux-rs
  7. …going to use tools to transpile, don't use something that hallucinates. You want it to be precise. https://github.com/immunant/c2rust reportedly works pretty well. Blog post from a few years ago of them transpiling quake3 to rust:…
    comment by Twirrim · 2025-06-18 · in Bzip2 crate switches from C to 100% Rust
  8. See https://github.com/immunant/c2rust
  9. …C to legal (unsafe) Rust is quite possible; there is indeed already a tool that does this ( https://github.com/immunant/c2rust ). The problem you run into is that the conversion is so pedantically correct that the resulting code is…
    comment by jcranmer · 2024-08-03 · in Translating All C to Rust (TRACTOR)
  10. …quick web search reveals some other efforts, such as c2rust [1]. I wonder how TRACTOR differs. [1] https://github.com/immunant/c2rust
    comment by rectang · 2024-07-30 · in Translating All C to Rust (TRACTOR)
  11. …"pie in the sky" thing, Immunant has a working C to Rust transpiler and it's really interesting: https://github.com/immunant/c2rust
    comment by jcalvinowens · 2024-07-30 · in Translating All C to Rust (TRACTOR)
  12. …An example of the latter: c2rust, which is a work in progress but is very impressive https://github.com/immunant/c2rust It currently translates into unsafe Rust, but the strategy is to separate the "compile C to unsafe Rust" steps and the…
    comment by steveklabnik · 2024-01-10 · in Converting the Kernel to C++
  13. …the article is 2022-06-13. Has there been further progress? The article links to their github repo: https://github.com/immunant/c2rust There's commits in the last hour, so at least some signal of life.
    comment by meepmorp · 2023-03-15 · in Emitting Safer Rust with C2Rust
  14. c2rust https://github.com/immunant/c2rust : > C2Rust helps you migrate C99-compliant code to Rust. The translator (or transpiler), c2rust transpile, produces unsafe Rust code that closely mirrors the input C code. The primary goal of the…
    comment by westurner · 2022-09-28 · in Bash 5.2
  15. …Rust, then try to port it back and forth. It would be much better if you can use Rust though. [1]: https://github.com/immunant/c2rust
    comment by stevefan1999 · 2022-04-09 · in Old C code – how to upgrade it?
  16. https://github.com/immunant/c2rust : > We rely on Emscripten's Relooper algorithm to translate arbitrary C control flows. Article on why Relooper isn't good enough and the superior Stackifier algorithm, which they probably should be using…
    comment by JoelJacobson · 2022-02-02 · in C2rust: Transpile C to Rust
  17. …and then refactored it to mostly safe Rust. I ran into a number of issues https://github.com/immunant/c2rust/issues?q=is%3Aissue+autho... but it generally worked ok. I found refactoring the resulting Rust code somewhat error prone a
    comment by muizelaar · 2022-02-02 · in C2rust: Transpile C to Rust
  18. What I am most curious about is the final paragraph of https://github.com/immunant/c2rust#acknowledgements-and-lice... There was a while there where they were trying to test this out on the cvs codebase, IIRC. It's a good candidate:…
    comment by steveklabnik · 2022-02-01 · in C2rust: Transpile C to Rust
  19. …This is meant to be only the first step in a Rust refactor. https://galois.com/blog/2018/08/c2rust/ https://github.com/immunant/c2rust/wiki/Known-Limitations-of...
    comment by estebank · 2022-02-01 · in C2rust: Transpile C to Rust
  20. …with C2Rust[1] framework rather than wasting time converting to this instead. [1] https://github.com/immunant/c2rust/
    comment by xvilka · 2021-02-19 · in Checked C
  21. There's a translator for C99 to (unsafe) Rust: https://github.com/immunant/c2rust So probably you can give me any C program and I'll be able to give you an equivalent Rust program. It'll probably perform about the same, too.
  22. Could the effort be bootstrapped by using a C to Rust translator, like https://github.com/immunant/c2rust , preserving the existing semantics prior to updating the code to remove the "unsafe" tags.
    comment by greg7mdp · 2020-08-12 · in QEMU should move from C to Rust
  23. …zstd and why it is so fast and such an amazing technology. I also recompiled zstd into rust using https://github.com/immunant/c2rust and tried using various webasm mechanisms to run it (I didn't get webasm quite fast enough, and teaching…
    comment by daniel_rh · 2020-08-04 · in Broccoli: Syncing Faster by Syncing Less
  24. …is a good refactoring tool[1][2] to automate the process. It also allows scripting in Lua[3]. [1] https://github.com/immunant/c2rust/tree/master/c2rust-refact... [2] https://c2rust.com/manual/c2rust-refactor/commands.html [3]…
    comment by xvilka · 2020-07-11 · in Linux kernel in-tree Rust support
  25. …C to Rust by using their tool c2rust[2]. [1] https://immunant.com/blog/2020/06/kernel_modules/ [2] https://github.com/immunant/c2rust
    comment by xvilka · 2020-07-11 · in Linux kernel in-tree Rust support
  26. …that can convert basic Java constructs to Rust. It can be taken as a base and improved. [1] https://github.com/immunant/c2rust [2] https://users.rust-lang.org/t/java-to-rust-converter-for-ted... [3] https://github.com/aschoerk/converter-pag…
    comment by xvilka · 2020-07-02 · in RedHat Mandrel Makes Java Native
  27. …to run tests. Or, on the other side, c2rust should get an Objective C support as an input. [1] https://github.com/immunant/c2rust
  28. There is also https://github.com/immunant/c2rust
  29. It can be semi-automated with the amazing c2rust[1] tool. [1] https://github.com/immunant/c2rust
  30. …looking code; in terms of readability. But as mentioned in other threads, the refactoring tool ( https://github.com/immunant/c2rust/tree/master/c2rust-refact... ) aims to fix that.
    comment by saldivarcher · 2020-01-07 · in Translating Quake 3 into Rust
  31. …in parallel (and with the intent to consume the output of) c2rust. Development on that occurs here: https://github.com/immunant/c2rust/tree/master/c2rust-refact... .
    comment by harpocrates · 2020-01-07 · in Translating Quake 3 into Rust
  32. Step 2 has been happening concurrently, and pretty much since the start of the project. See https://github.com/immunant/c2rust/tree/master/c2rust-refact... . It is just a lot tougher to get right, so it gets less publicity.
    comment by harpocrates · 2020-01-07 · in Translating Quake 3 into Rust
  33. …[1], but for Java. There exist[2] some kind of automation, buts it's too basic to be practical. [1] https://GitHub.com/immunant/c2rust [2] https://github.com/aschoerk/converter-page
  34. Just use the c2rust[1] tool to "extend" C. [1] https://github.com/immunant/c2rust
  35. …C2Rust[1] proves that. Just can be improved with new languages and refactoring capabilities. [1] https://github.com/immunant/c2rust
  36. …C2Rust[1][2] to support C++[3] and C# to ease their migration instead. [1] https://c2rust.com [2] https://github.com/immunant/c2rust [3] https://github.com/immunant/c2rust/issues/162
  37. …tool. [1] https://github.com/remacs/remacs [2] https://www.emacswiki.org/emacs/GuileEmacs [3] https://github.com/immunant/c2rust/
  38. …of lessons learned and future directions for Rust and C integration. [1] https://c2rust.com [2] https://github.com/immunant/c2rust [3] https://immunant.com/blog/2019/11/rust2020/
  39. …as c2rust tool. Would be nice to integrate with c2rust somehow, if someone wants to help. [1] https://github.com/immunant/c2rust [2] https://c2rust.com/manual/c2rust-refactor/index.html [3] https://github.com/tectonic-typesetting/tectonic/i…
    comment by xvilka · 2019-10-23 · in How to not rewrite it in Rust
  40. …the code will be removed, for example image handling can be done through image-rs crate, etc. [1] https://github.com/immunant/c2rust
    comment by xvilka · 2019-10-07 · in Tectonic – TeX/LaTeX Engine in Rust
  41. …about oxidation plans. And there is a bunch of issues[3] if you want to help the project. [1] https://github.com/immunant/c2rust [2] https://github.com/tectonic-typesetting/tectonic/issues/459 [3] https://github.com/crlf0710/tectonic/issues
    comment by xvilka · 2019-09-13 · in Rewriting TeX/LaTeX Engine in Rust
  42. Convert the QuickJS code into Rust using c2rust[1], then reuse in rq. [1] https://github.com/immunant/c2rust
    comment by xvilka · 2019-07-11 · in QuickJS JavaScript Engine
  43. …a C to -betterC transpiler just like there has for Rust (e.g. C2Rust [0], Corrode [1])? [0] https://www.github.com/immunant/c2rust [1] https://www.github.com/jameysharp/corrode
    comment by dataking · 2019-07-02 · in D as a C Replacement
  44. …next thing that is important - make it command line tool[3], instead of being a web service. [1] https://github.com/immunant/c2rust/ [2] https://github.com/aschoerk/converter-page/issues/6 [3] https://github.com/aschoerk/converter-page/issu…
    comment by xvilka · 2019-06-14 · in Simple Converter Interface, Java/Rust
  45. …become comparable too. [1] https://github.com/rust-unofficial/awesome-rust#development-... [2] https://github.com/immunant/c2rust [3] https://github.com/aschoerk/converter-page
    comment by xvilka · 2019-06-03 · in Essential Rust Tools
  46. …type definitions and extern functions to interoperate with the type and functions in the headers * https://github.com/immunant/c2rust - Inputs are C headers and source, outputs Rust code that is semantically equivalent to the C (modulo…
  47. Github link -> https://github.com/immunant/c2rust
  48. …that instrument C and Rust code so we can dynamically check their behavior when fed the same input. https://github.com/immunant/c2rust/tree/master/cross-checks
    comment by dataking · 2018-07-02 · in C2Rust: translate C into Rust code
  49. …provide. Sounds more like he's talking about the "Likely Won't Ever Support"[0] section. [0]: https://github.com/immunant/c2rust/blob/master/docs/known-li...
    comment by Sean1708 · 2018-07-02 · in C2rust vs. Corrode
  50. Note that the above acknowledgement was only just added[0], likely in response to this blog post. [0] https://github.com/immunant/c2rust/commit/e0d3adf656db000b1c...
    comment by Liquid_Fire · 2018-07-02 · in C2rust vs. Corrode