Zig is a relatively new programming language that seeks to take the best of all the rest and offer comparable performance with a better and more reliable experience for developers, Infoworld writes.

Its creation was started back in 2015 by Andrew Kelly. Zig’s ambition is quite significant in the history of software: to become the successor to C’s long reign as both a low-level portable language and the standard against which other languages are compared.

Design and Syntax
Zig allows developers to work directly with system memory – a requirement for writing code that can be maximized for its task. Direct memory allocation is a feature shared by the C family, Rust, and other low-level system languages.

Zig strives to be a simpler system language than its predecessors and to make it easier to write safe and correct code. It also strives for a better experience for developers by reducing the sharp edges found when writing C-like software.

Zig is currently being used to implement the JavaScript runtime Bun.js as an alternative to Node.js.

“Zig is something similar to writing in C, but with better memory safety features in debug mode and advanced features like defer (something similar to Go) and arbitrary code that can be executed at compile time via comptime. It has very few keywords, so it’s much easier to learn than C++ or Rust.”

Bun creator Jared Sumner tells Infoworld.

Zig differs from most other languages in its small number of features. Zig’s developers took this goal so to heart that for a while Zig had no for loop, which was considered an unnecessary syntactic refinement of the already adequate while loop.

“The language is so small and consistent that after a few hours of learning I was able to load enough of it into my head to do my job.”

Writes Kevin Linag, coming from Rust background.

Nathan Craddock, developer of the C language, is also of this opinion. Programmers really seem to like the purposeful quality of Zig’s syntax.

Tags: , , , , , , , , , , , , , , , , , ,
Editor @ DevStyleR