什么是 Zig?
Zig is a general-purpose programming language and toolchain designed for maintaining robust, optimal, and reusable software. Created by Andrew Kelley, Zig aims to be a better alternative to C, offering modern language features while maintaining the simplicity and performance that systems programmers need.
🔥 Key Features of Zig
⚡ Simple & Fast
No hidden control flow, no hidden memory allocations, no preprocessor. Focus on debugging your application, not your language knowledge.
🔧 Comptime Magic
Compile-time code execution and lazy evaluation. Call any function at compile-time and manipulate types as values without runtime overhead.
🌐 Cross-Compilation
Built-in cross-compilation support for dozens of targets. No external dependencies needed for most platforms.
🔄 C/C++ Interop
Use Zig as a drop-in C/C++ compiler with better cross-compilation. Incrementally adopt Zig in existing codebases.
🆕 What's New in Zig 0.14.1
- Labeled Switch Statements: New control flow for finite state machines and performance-critical code
- Enhanced x86 Backend: 98% test suite compatibility with dramatically faster compilation
- Incremental Compilation: Experimental support for faster edit-compile-debug cycles
- File System Watching: Automatic rebuilds when source files change
- Improved Target Support: Better support for ARM, MIPS, PowerPC, and RISC-V architectures
- Enhanced Build System: More flexible module system and better dependency management
📦 从 debian.griffo.io 安装
步骤 1:添加仓库
步骤 2:安装 Zig
🎯 基本使用示例
Create a new project:
Compile a single file:
Use as C compiler:
🚀 为什么选择 debian.griffo.io?
- ✅ Always Latest: Get Zig 0.14.1 immediately, not months later
- ✅ Nightly Builds: Access cutting-edge features with zig-master package
- ✅ Automatic Updates: Packages updated within hours of upstream releases
- ✅ Proper Dependencies: Correctly packaged with all required dependencies
- ✅ Multi-Distribution: Works on Bookworm, Trixie, and Sid
- ✅ Zero Hassle: No manual compilation or complex setup required
📦 软件包构建仓库
Debian 软件包在这些 GitHub 仓库中自动构建和维护:
- 🇿 zig-debian (stable) - Stable release builds
- 🇿 zig-master-debian (nightly) - Nightly development builds
🔗 相关软件包
也可从 debian.griffo.io 获取:
- ZLS Language Server - IDE support for Zig
- Ghostty Terminal - Fast terminal emulator
- Yazi File Manager - Terminal file manager