Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.

Responsive image


Zig (programming language)

Zig
ParadigmsMulti-paradigm: imperative, concurrent, procedural, functional
Designed byAndrew Kelley
First appeared8 February 2016 (2016-02-08)[1]
Stable release
0.13.0[2] Edit this on Wikidata / 6 June 2024 (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[3]

[4] [5] [6] [7] [8] [9] [10]

[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]

  1. ^ Kelley, Andrew. "Introduction to the Zig Programming Language". andrewkelley.me. Retrieved 8 November 2020.
  2. ^ "Release 0.13.0".
  3. ^ "What are the pros and cons of Zig vs Rust? I see Zig mentioned more and more her... | Hacker News".
  4. ^ "Why Zig when There is Already C++, D, and Rust? ⚡ Zig Programming Language".
  5. ^ "No surprises on any system: Q&A with Loris Cro of Zig - Stack Overflow". 2 October 2023.
  6. ^ "Zig's New Relationship with LLVM | Hacker News".
  7. ^ "Zig moving away from LLVM and LLVM ecosystem". 14 July 2023.
  8. ^ "What's Zig got that C, Rust and Go don't have? (With Loris Cro)". YouTube. 15 November 2023.
  9. ^ https://news.ycombinator.com/item?id=25797025
  10. ^ "Overview ⚡ Zig Programming Language".
  11. ^ "After a day of programming in Zig". 29 December 2023.
  12. ^ "Home ⚡ Zig Programming Language". ziglang.org. Retrieved 2024-12-31.
  13. ^ "Taking the warts off C, with Andrew Kelley, creator of the Zig programming language". Sourcegraph. 2021-10-19. Retrieved 2024-04-18.
  14. ^ "ziglang/zig". GitHub. Retrieved 2020-02-11.
  15. ^ Cite error: The named reference roadtozig1.0 was invoked but never defined (see the help page).
  16. ^ "The Zig Programming Language". Ziglang.org. Retrieved 2020-02-11.
  17. ^ "Zig programming language". SudoNull. Retrieved 2020-02-11.
  18. ^ Yegulalp 2016.
  19. ^ "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.
  20. ^ a b "The Zig Programming Language". Ziglang.org. Retrieved 2020-02-11.
  21. ^ Anderson, Tim (2020-04-24). "Keen to go _ExtInt? LLVM Clang compiler adds support for custom width integers". www.theregister.co.uk. Retrieved 2024-12-30.
  22. ^ "Documentation". Ziglang.org. Retrieved 2020-04-24.
  23. ^ a b c d Chigozie, Oduah (2024-06-04). "Comparing Rust vs. Zig: Performance, Safety, and More". LogRocket Blog. Retrieved 2024-07-16.
  24. ^ "Jakub Konka on Twitter". Twitter. Archived from the original on 2022-04-10. Retrieved 2021-05-28.
  25. ^ "Announcing the Zig Software Foundation". Ziglang.org. Retrieved 2021-05-28.
  26. ^ "Sponsor ZSF". Ziglang.org. Retrieved 2021-05-28.
  27. ^ a b Kavanagh, Amanda (June 25, 2024). "Why Zig has become the highest-paying programming language". The Next Web. Retrieved Dec 15, 2024.
  28. ^ McBride, Aoibhinn (July 16, 2024). "3 programming languages you need to know about". VentureBeat. Retrieved Dec 15, 2024.

Previous Page Next Page