![]() | |
Paradigms | Multi-paradigm: imperative, concurrent, procedural, functional |
---|---|
Designed by | Andrew Kelley |
First appeared | 8 February 2016[1] |
Preview release | 0.13.0[2] ![]() |
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 |
Website | ziglang |
Influenced by | |
C, C++, LLVM IR, Go, Rust, JavaScript[citation needed] |
Zig is an imperative, general-purpose, statically typed, compiled system programming language designed by Andrew Kelley.[3] It is intended as a successor to the language C, with the intent of being even smaller and simpler to program in, while offering more function.[4] It is free and open-source software, released under an MIT License.
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 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 reflection.
Another set of additions to Zig is intended to improve code safety. Like C, Zig does not include garbage collection and memory handling is manual. To help eliminate the potential errors that arise in such systems, it includes option types and simple syntax for using them. A testing framework is also built into the language.