Paradigms | Multi-paradigm: imperative, concurrent, procedural, functional |
---|---|
Designed by | Andrew Kelley |
First appeared | 8 February 2016[1] |
Stable release | 0.13.0[2]
/ 6 June 2024 |
Typing discipline | Static, strong, inferred, structural, generic |
Memory management | Manual |
Platform | x86-64, ARM64, WebAssembly Tier 2: ARM, IA-32, RISC-V, MIPS64, POWERPC64, SPARC64, some tier-2 platforms have tier-1 support for standalone programs |
OS | Cross-platform: Linux, FreeBSD, Windows |
License | MIT |
Filename extensions | .zig, .zir, .zigr, .zon |
Website | ziglang |
Influenced by | |
C, C++, LLVM IR, Go, Rust[3] [11] |
Zig (Also known as Ziglang)[12] is an imperative, general-purpose, statically typed, compiled system programming language designed by Andrew Kelley.[13] It is free and open-source software, released under an MIT License.[14]
A major goal of the language is to improve on the C language,[15][16] (also taking inspiration from Rust[17][18]), with the intent of being even smaller and simpler to program in, while offering more functionality.[19] The improvements in language simplicity relate to flow control, function calls, library imports, variable declaration and Unicode support. Further, the language makes no use of macros or preprocessor instructions. Features adopted from modern languages include the addition of compile time generic programming data types, allowing functions to work on a variety of data, along with a small set of new compiler directives to allow access to the information about those types using reflective programming (reflection).[20] Like C, Zig omits garbage collection, and has manual memory management.[20] To help eliminate the potential errors that arise in such systems, it includes option types, a simple syntax for using them, and a unit testing framework built into the language. Zig has many features for low-level programming, notably packed structs (structs without padding between fields), arbitrary-width integers[21] and multiple pointer types.[22]
The main drawback of the system is that, although Zig has a growing community, as of 2024, it remains a new language with areas for improvement in maturity, ecosystem and tooling.[23] Also the learning curve for Zig can be steep, especially for those unfamiliar with low-level programming concepts.[23] The availability of learning resources is limited for complex use cases, though this is gradually improving as interest and adoption increase.[23] Other challenges mentioned by the reviewers are interoperability with other languages (extra effort to manage data marshaling and communication is required), as well as manual memory deallocation (disregarding proper memory management results directly in memory leaks).[23]
The development is funded by the Zig Software Foundation (ZSF), a non-profit corporation with Andrew Kelley as president, which accepts donations and hires multiple full-time employees.[24][25][26] Zig has very active contributor community, and is still in its early stages of development.[27] Despite this, a Stack Overflow survey in 2024 found that Zig software developers earn salaries of $103,000 USD per year on average, making it one of the best-paying programming languages.[28] However, only 0.83% reported they were proficient in Zig.[27]
roadtozig1.0
was invoked but never defined (see the help page).