git404hub

what is crustc fr?

fractalfir/crustc — explained in plain English

Analysis updated 2026-05-18

331CAudience · developerComplexity · 5/5Setup · hard

tl;dr

crustc is the entire Rust compiler translated into 46 million lines of C, letting you build a working Rust compiler with only GCC and make to support platforms that have no native Rust toolchain.

vibe map

mindmap
  root((crustc))
    What it is
      Rust compiler in C
      46 million lines
      Demo for cilly
    How it works
      GCC builds it
      LLVM for codegen
      GNU make
    cilly toolchain
      Rust to C compiler
      Probes target compiler
      Network transparent
    Use cases
      Old hardware support
      Cross compile Rust
      Obscure OS targets
    Setup
      GCC and make
      LLVM version match
      ARM64 Linux tested

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Build a working Rust compiler on hardware that only has a C compiler, enabling Rust where no official toolchain exists.

VIBE 2

Cross-compile Rust programs for obscure or legacy targets using the cilly Rust-to-C backend.

VIBE 3

Run the Rust compiler on a Linux host and compile for a remote non-standard OS target over a TCP connection.

VIBE 4

Study how a Rust-to-C compiler backend probes and adapts to different C compiler capabilities.

what's the stack?

CRustGCCLLVMmake

how it stacks up fr

fractalfir/crustctorvalds/hunspellcolorizejustrach/merjs
Stars331344346
LanguageCCC
Setup difficultyhardeasymoderate
Complexity5/51/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · hard time til it works · 1h+

Requires GCC, GNU make, and a specific LLVM version matching the nightly Rust toolchain, building with optimizations may stall on large generated files.

in plain english

Rust is a programming language. A compiler is the tool that translates code written by humans into instructions a computer can actually run. This repo contains the entire Rust compiler, converted into the C programming language, resulting in 46 million lines of C code. The practical result is that you can now build the Rust compiler itself using GCC, which is one of the oldest and most widely available C compilers in existence. GCC can run on old and obscure hardware that never received official Rust support. This means you can write programs in Rust and still target hardware that would otherwise be incompatible. This is a demo for a larger project called cilly. The cilly toolchain is a Rust-to-C compiler that can translate any Rust code into C, not just the Rust compiler itself. The clever part is that cilly probes the C compiler on your target platform first, checking what features it actually supports, then generates output tailored to that specific compiler and hardware combination. This makes it compatible with obscure or old C compilers that would choke on standard assumptions. A standout feature is network transparency. You can run the Rust compiler on a normal Linux machine while sending the C compilation work over a network connection to another computer running a completely different operating system or processor architecture. The author demonstrated this by compiling Rust programs for an x86 Plan 9 operating system from an ARM64 Linux machine. To build this demo yourself you need GCC, GNU make, and a specific version of LLVM, the code generation library that Rust normally uses internally. Building without optimizations takes about 78 seconds on the author's machine. The cilly toolchain itself is not yet publicly released, this repo is a teaser showing what it can do.

prompts (copy fr)

prompt 1
Walk me through building crustc on an ARM64 Linux machine with GCC 13, including providing the correct LLVM library path.
prompt 2
How does the cilly toolchain generate C code compatible with different C compilers using witness programs?
prompt 3
What is the network transparency feature of cilly and how do I set it up to compile Rust for a remote target over TCP?
prompt 4
How do I build the Rust standard library (std) after successfully compiling crustc from source?
prompt 5
Show me a cilly config snippet for targeting an SDCC Z180 embedded compiler.

Frequently asked questions

what is crustc fr?

crustc is the entire Rust compiler translated into 46 million lines of C, letting you build a working Rust compiler with only GCC and make to support platforms that have no native Rust toolchain.

What language is crustc written in?

Mainly C. The stack also includes C, Rust, GCC.

How hard is crustc to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is crustc for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.