What is Zig written in?
The Zig compiler is written in C++, Zig, and LLVM (documented). It has been rewritten in Zig. Zig is self-hosting.
Relationship Graph
All directly connected languages. Click any node to navigate to its page.
Compiler Implementation
| Language | Confidence | Notes | Source |
|---|---|---|---|
| C++ | 95% | Zig originally written in C++ before self-hosting | Source |
| Zig | 95% | Zig became self-hosting in 2022, dropped C++ compiler | Source |
| LLVM | 92% | Early Zig used LLVM, now has own backend option | Source |
Rewritten In
| Language | Confidence | Notes | Source |
|---|---|---|---|
| Zig | 95% | Zig compiler rewritten from C++ to Zig | Source |
Influenced By
- C — Zig designed as modern C replacement
- Rust — Zig influenced by Rust's safety and systems programming approach
Frequently Asked Questions
What language is Zig written in?
Zig is primarily implemented in C++ and Zig and LLVM. See the implementation section above for details and source references.
What languages influenced Zig?
Zig was influenced by Rust, C among others. See the influence section above for the full list.
Is Zig self-hosting?
Yes, Zig is self-hosting — its compiler can compile itself.
Evidence Sources
- https://ziglang.org/news/goodbye-cpp/
- https://en.wikipedia.org/wiki/Zig_(programming_language)
- https://ziglang.org/