What is Zig written in?

Zig is self-hosting: its compiler is written in Zig itself. It also relies on C++ and LLVM in its toolchain.

Zig is a programming language, first released in 2016.

Implementation

LayerWritten inNotes
CompilerC++ (since 2016)Zig originally written in C++ before self-hosting
CompilerZig (since 2022)Zig became self-hosting in 2022, dropped C++ compiler
CompilerLLVM (since 2016)Early Zig used LLVM, now has own backend option

Self-hosting

Zig is a self-hosting language: its compiler is written in Zig itself. Self-hosting means the compiler can compile its own source code, which is a milestone in a language's maturity. New versions of the compiler are built using an older version of the same compiler, a process called bootstrapping.

Self-hosting also acts as a practical stress test: if a language can compile its own compiler, most core language features have been validated in a complex, real-world workload. See what is compiler bootstrapping for a full explanation.

Explore in the Graph

See Zig's full lineage, including all implementation and influence relationships, in the interactive graph.

Open Interactive Graph →

Or view the Zig language page for the complete record.

Related Pages