Questions tagged [zig]

Zig is an open-source programming language designed for robustness, optimality, and clarity.

Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Website:

Documentation:

Zig has many features for low-level programming, notably: packed structs (structs without padding between fields), arbitrary width integers and multiple pointer types. Zig has no hidden control flow, no hidden memory alocation, no macros (but therefor compile time code execution)

212 questions
-1
votes
3 answers

What's the simple way of mixing signed-ness calculation in zig?

Zig insists a strict checking on integer signedness mixing, which is great, and it enforces programmers to really see what's happening. But then what in C looks like uint64_t a = 100; int32_t b = 42; uint64_t c = a + b; has to be like this in…
Ralph Zhang
  • 5,015
  • 5
  • 30
  • 40
-8
votes
1 answer

Does zig have special syntax for single-expression functions?

So ChatGPT seems convinced that in Zig there is something called shorthand syntax for single-expression functions and it works like this: fn add(x: i32, y: i32) i32 => x + y; But when I try to use that I get: error: expected ';' or block after…
hkBst
  • 2,818
  • 10
  • 29
1 2 3
14
15