Skip to content

Zig 0.17.0 documentation

Language reference and standard library, in Chinese and English.

Introduction

6
  1. Getting Started
  2. Overview
  3. Zig Build System
  4. Samples
  5. Why Zig When There is Already C++, D, and Rust?
  6. Grammar Rules

Language reference

53 chapters

From syntax, types, and memory semantics to compile-time execution and builtins.

  1. Introduction
  2. Zig Standard Library
  3. Hello World
  4. Comments
  5. Namespace
  6. Identifiers
  7. Values
  8. Zig Test
  9. Variables
  10. Integers
  11. Floats
  12. Operators
  13. Arrays
  14. Vectors
  15. Pointers
  16. Slices
  17. struct
  18. enum
  19. union
  20. opaque
  21. Blocks
  22. switch
  23. while
  24. for
  25. if
  26. defer
  27. unreachable
  28. noreturn
  29. Functions
  30. Errors
  31. Optionals
  32. Casting
  33. Zero Bit Types
  34. Result Location Semantics
  35. comptime
  36. Assembly
  37. Atomics
  38. Async Functions
  39. Builtin Functions
  40. Optimization Mode
  41. Single Threaded Builds
  42. Illegal Behavior
  43. Memory
  44. Compile Variables
  45. Compilation Model
  46. Zig Build System
  47. C
  48. WebAssembly
  49. Targets
  50. Style Guide
  51. Source Encoding
  52. Keyword Reference
  53. Appendix

Standard library

538 modules

Explore APIs, parameters, fields, errors, and source by module.