Zig (programming language)

Zig
ParadigmsMulti-paradigm: imperative, concurrent, procedural, functional
Designed byAndrew Kelley
First appeared8 February 2016; 8 years ago (2016-02-08)[1]
Preview release
0.13.0[2] Edit this on Wikidata / 6 June 2024; 5 months ago (6 June 2024)
Typing disciplineStatic, strong, inferred, structural, generic
Memory managementManual
Platformx86-64, ARM64, WebAssembly
Tier 2: ARM, IA-32, RISC-V, MIPS64, POWERPC64, SPARC64, some tier-2 platforms have tier-1 support for standalone programs
OSCross-platform: Linux, FreeBSD, Windows
LicenseMIT
Filename extensions.zig, .zir, .zigr, .zon
Websiteziglang.org
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 functionality.[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 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).

Another set of additions to Zig is intended to improve code safety. Like C, Zig omits garbage collection, and memory management is manual. 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.

  1. ^ Kelley, Andrew. "Introduction to the Zig Programming Language". andrewkelley.me. Retrieved 8 November 2020.
  2. ^ "Release 0.13.0".
  3. ^ "Taking the warts off C, with Andrew Kelley, creator of the Zig programming language". Sourcegraph. 2021-10-19. Retrieved 2024-04-18.
  4. ^ "Zig has all the elegant simplicity of C, minus all the ways to shoot yourself in the foot". JAXenter. 2017-10-31. Archived from the original on 2017-11-01. Retrieved 2020-02-11.