Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Finds the maximum of two numbers and prints it.
# zig/demo/max.zig
const std = @import("std");
pub export fn max(a: i32, b: i32) void {
if (a > b) {
std.debug.print("Max: {d}\n", .{a});
} else {
std.debug.print("Max: {d}\n", .{b});
}
}Zig is a general-purpose programming language designed for robustness, optimality, and simplicity. With Zig-Wasm, developers can compile Zig code to WebAssembly, enabling high-performance, low-level applications in the browser or other Wasm runtimes.
Origin & Creator
Zig is created by Andrew Kelley, with the community contributing to language development, compiler improvements, and WebAssembly support.
Industrial Note
Zig-Wasm is particularly useful for developers who need predictable, high-performance WebAssembly modules, low-level memory control, or integration with C/C++ codebases for web execution.