From 19fa2f2d880a693af2dd6346b120bb88e615f4e5 Mon Sep 17 00:00:00 2001 From: Barrett Harber Date: Sun, 11 Jan 2026 19:20:45 -0500 Subject: feat: add zig compiler support --- README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index ab0bfd9..836bbc7 100644 --- a/README.md +++ b/README.md @@ -443,6 +443,7 @@ Zen C is designed to work with most C11 compilers. Some features rely on GNU C e ```bash zc run app.zc --cc clang +zc run app.zc --cc zig ``` ### Test Suite Status @@ -451,9 +452,22 @@ zc run app.zc --cc clang |:---|:---:|:---|:---| | **GCC** | **100%** | All Features | None. | | **Clang** | **100%** | All Features | None. | +| **Zig** | **100%** | All Features | None. Uses `zig cc` as a drop-in C compiler. | | **TCC** | **~70%** | Basic Syntax, Generics, Traits | No `__auto_type`, No Intel ASM, No Nested Functions. | -> **Recommendation:** Use **GCC** or **Clang** for production builds. TCC is excellent for rapid prototyping due to its compilation speed but misses some advanced C extensions Zen C relies on for full feature support. +> **Recommendation:** Use **GCC**, **Clang**, or **Zig** for production builds. TCC is excellent for rapid prototyping due to its compilation speed but misses some advanced C extensions Zen C relies on for full feature support. + +### Building with Zig + +Zig's `zig cc` command provides a drop-in replacement for GCC/Clang with excellent cross-compilation support. To use Zig: + +```bash +# Compile and run a Zen C program with Zig +zc run app.zc --cc zig + +# Build the Zen C compiler itself with Zig +make zig +``` --- @@ -482,6 +496,8 @@ make test # Run with different compiler ./tests/run_tests.sh --cc clang +./tests/run_tests.sh --cc zig +./tests/run_tests.sh --cc tcc ``` ### Extending the Compiler -- cgit v1.2.3