Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Zig Tutorial

Zig Tutorial

Zig is an imperative, general-purpose, statically typed, compiled systems programming language.

Zig was created by Andrew Kelley in 2015 and released in 2016.

Zig's design goals are to provide a high-performance, safe, concise, and portable programming experience.

Zig official website:https://ziglang.org/.


The first Zig program

Next, we use Zig to output "Hello World!"

Example

const

std

=

@import

(

"std"

)

;

pub fn main

(

)

void

{

    std.

debug

.

print

(

"Hello, World!\n"

, .

{

}

)

;

}

After running, it will display Hello, world! on the screen.


Design Purpose

Zig's design goal is to provide modern features while maintaining extremely low complexity.

Zig's design emphasizes safety, performance, and predictability, suitable for system-level programming tasks that require efficiency, reliability, and cross-platform support.


Zig Features


Zig Use Cases