0PricingLogin
Zig Academy · Lesson

zig run vs zig build-exe

Run quickly or produce a real binary.

Two Ways to Run Code

Zig gives you two main paths from source to result: zig run for quick iteration, and zig build-exe when you want a standalone binary to keep.

zig run: Compile and Go

The command zig run compiles your file and immediately executes it, all in one step. Nothing is left behind on disk afterward.

zig run main.zig

All lessons in this course

  1. zig run vs zig build-exe
  2. Debug, ReleaseSafe, ReleaseFast
  3. Reading Compiler Errors
  4. zig fmt: Format Your Code
← Back to Zig Academy