Zig
Zig book notes, into 24 chapters.
487 notes
Zig book notes, into 24 chapters.
This chapter covered the builtins you will see most often as a beginner.
@embedFile reads a file at compile time and embeds its bytes into the final program.
Logging means recording what a program is doing.
@compileError stops compilation with a custom error message.
Networking means communicating with another program through a network.
@panic stops the program immediately with a message.
An HTTP client is code that sends a request to a web server and reads the response.
A keyword is a word that has special meaning in Zig.
Most memory in Zig is ordinary memory.
@floatCast converts one floating-point value to another floating-point type.
JSON is a text format for storing structured data.
You now know the core ideas behind Zig.
Sooner or later, every Zig beginner meets the compiler.
Names are part of the program.
A generic function is a function that works with many types instead of only one type.
Memory safety means using memory only while it is valid, only through the right type, and only inside the allowed range.
@truncate converts an integer to a smaller integer type by keeping only the low bits.
Compression means making data smaller.
Zig changes quickly before 1.0. That includes the build system.
Zig is still before 1.0, so the language and standard library can change between releases. Code written for one Zig version may not compile on another version without edits.
Zig has not reached 1.0 yet. The current release line discussed in this book is Zig 0.16, not Zig 1.16.
As of the current public Zig release line, the version is Zig 0.16, not Zig 1.16. Zig has not reached 1.0 yet. In this appendix, read “Zig 1.16” as “Zig 0.16” unless...
You can write Zig code in any text editor.
Comments are notes for humans who read the code.
A compile error means Zig refused to build your program.
An exported function is a function made visible outside the current Zig program.
Errors are for expected failures.
A dangling pointer is a pointer that refers to memory that is no longer valid.
Efficient text processing means working with text without doing unnecessary allocation, copying, or decoding.
Data-oriented design means you organize a program around the data it processes.
comptime is one of Zig’s strongest features, but it should not be used everywhere.
@intCast converts one integer value to another integer type.
An allocation-friendly API makes memory behavior clear to the caller.
Zig code should be explicit, simple, and easy to inspect. The goal is not cleverness. The goal is code that another programmer can read, verify, and maintain.
A data structure is never just a container.
A process is a running program.
Packaging means preparing your program so another person can download it, install it, and run it.
Benchmarking measures how fast code runs.
Wrapping a C library means building a Zig layer around it.
A shell is a program that reads commands and runs other programs.
High performance concurrent design means using several threads or tasks without making the program slower, more fragile, or harder to reason about.
Performance ideas become clearer when you see them inside real code.
Zig changes quickly because it is still moving toward 1.0.
IR means intermediate representation.
Git stores snapshots of files.
This appendix summarizes the core syntax of Zig 0.16. It is a compact reference, not a tutorial.
So far, we have used single-file programs.
A string is text.
Some parts of a program should never run.
A calling convention defines how functions communicate at the machine level.
Most Zig programs start with small error sets:
Zig programs use memory in different places. The two most important places are the stack and the heap.
A dynamic string is text whose length is not fixed ahead of time.
A state machine is a simple way to describe a program that moves between fixed states.
Type reflection means asking questions about a type while Zig is compiling the program.
Metaprogramming means writing code that helps create, inspect, or specialize other code.
@memcpy copies bytes from one memory region to another.
Memory lifetime means:
This appendix lists useful Zig projects to read after you know the basics.
Memory debugging means finding mistakes in how a program uses memory.
Contributing to Zig means helping the language, compiler, standard library, documentation, tests, or tooling improve.
A collection is a type that stores many values.
This chapter introduced the basic forms of values and declarations: names, constants, variables, integer types, floating-point types, booleans, bytes, inferred types, and...
An environment variable is a named value provided to a program by the operating system.
A build does not only compile files. It can also install the results into a predictable output directory.
C headers are the bridge between Zig and C.
A CLI tool is a command-line program.
An abstraction is a way to hide detail behind a simpler interface.
A self-hosted compiler is a compiler written in the language it compiles.
Packaging means preparing your program so other people can download it, install it, run it, and trust what they are running.
A data race happens when two threads access the same memory at the same time, at least one access writes, and there is no proper synchronization.
A game engine is a program structure for running interactive simulations.
This section collects the exercises for Chapter 14.
These exercises use the material from Chapters 15.1 through 15.8. Most are small. The goal is to practice reading and writing build.zig files until the structure becomes familiar.
This section combines the ideas from the previous sections into one program structure.
The programs in this chapter are small, but they have the shape of larger Zig programs.
When beginners hear the word “compiler,” they often think of one job:
Initialization means giving a value to something when it is created.
Many programs need to clean something up after using it.
An inline function is a function where the compiler may place the function’s code directly at the call site instead of performing a normal function call.
An error API is the part of your function signature that tells callers how failure works.
A sentinel-terminated array is an array with a special value at the end.
Zig string data is usually stored as UTF-8 bytes.
A union stores one active field at a time.
Type coercion means Zig converts a value from one type to another when the conversion is safe and well-defined.
Static dispatch means the compiler decides which code to call before the program runs.
@bitCast reinterprets the bits of one value as another type.
A memory leak happens when a program allocates memory and then loses the ability to free it.
Zig is designed to work closely with C. You can call C from Zig, call Zig from C, compile C code with Zig, and link Zig programs against existing C libraries.
A tree is a collection made of nodes.
GDB and LLDB are debuggers.
A programming language is never only its syntax.
Zig has built-in support for tests.
ABI means Application Binary Interface.
A TCP server is a program that waits for clients to connect.
Benchmarking means measuring how fast code runs.
A compiler translates one form of code into another form.
A cross-platform Zig program should not pretend that every operating system behaves the same way. Windows, Linux, macOS, WebAssembly, and embedded targets have different...
Zig does not perform most numeric conversions automatically.
Random numbers are used when a program needs variation.
This section collects the exercises for the chapter. They are meant to be small programs. Each one should compile and run.
1. Write a function increment that takes i32 and adds 1 to the pointed-to value.
A queue is a data structure for passing work from one part of a program to another.
A bytecode VM is a small machine inside your program.
These exercises close the chapter on structs, enums, and unions. They are meant to make the data model concrete.
1. Write a function parseUpper that accepts a byte and returns the uppercase letter value. Return error.InvalidUppercase if the byte is not between 'A' and 'Z'.
The exercises in this section are meant to make allocation habits precise. Each one should be written as a complete program unless stated otherwise.
This section collects the exercises for the chapter.
Zig has built-in support for tests.
Zig can build for a different target than the machine running the compiler.
Threads are a mechanism, not a design.
Exercise 19-1. Write a program that overflows a u8 using +=. Run it in Debug mode and observe the panic.
A program is finished only when another machine can build and run it reliably.
In the previous section, we used this command:
In Zig, undefined means “this value has not been initialized.”
Zig has normal loops that run when the program runs.
An anonymous function is a function without a permanent name.
Propagating an error means passing it to the caller instead of handling it immediately.
Alignment is a rule about where a value may be placed in memory.
Zig does not have a separate built-in mutable String type.
A tagged union is a type that can store one value from several possible shapes.
An error union is a value that can contain either:
A generic data structure is a data structure that works with more than one element type.
@ptrCast converts one pointer type into another pointer type.
Allocation can fail.
When Zig compiles a program, it can build the program in different modes.
A ring buffer is a fixed-size queue that reuses its storage.
An assertion is a check that must be true while the program runs.
LLVM is a compiler infrastructure project.
Zig can build the same program in different optimization modes.
Zig can call C, but C can also call Zig.
A network protocol is a rulebook for how programs talk over a network.
Branch prediction is a CPU optimization.
A virtual machine is a program that runs another program.
A portable API is an interface that works across more than one platform.
Programs often need to work with time.
An event loop is code that waits for events, then runs the right piece of work for each event.
A lexer is the first stage of many programming language tools.
A declaration may name its type explicitly.
defer runs a statement when control leaves the current block.
1. Write a function max3 that returns the largest of three integers.
A pointer is useful only while the value it points to still exists.
This section closes the chapter. The exercises are small programs. Write them by hand. Compile them. Change them. Run them again.
A struct is not only a list of fields. It also has a layout in memory.
Most functions should not decide what an error means.
1. Write a program that computes several Fibonacci numbers with comptime. Print the results at runtime.
Allocation creates a responsibility.
Zig 0.16 changes how I/O code is written in the standard library.
The standard library gives access to process information through std.process.
A Zig package may depend on another package.
Exercise 16-1. Write a C file containing this function:
This section collects the chapter exercises into one working set.
A semaphore is a counter used for synchronization.
FFI means foreign function interface. It is the boundary where Zig calls code written in another language, or where another language calls Zig.
A benchmark measures the cost of a program or operation. The result is useful only if the measurement is repeatable and the work being measured is clearly defined.
Now we will write and run a complete Zig program.
Type inference means Zig can figure out a type from the value you write.
Loops repeat code. But sometimes you do not want a loop to finish in the normal way.
Functions are values.
errdefer is a cleanup tool.
Pointer arithmetic means moving a pointer forward or backward through memory.
A string literal is text written directly in your source code.
An enum is a type whose value must be one item from a fixed list.
anytype means the function parameter can accept many different types.
Reflection means inspecting a type as data.
@typeInfo asks the compiler for structured information about a type.
A custom allocator is an allocator you design for a specific memory policy.
Zig gives you direct control over memory. That control is useful, but it also means you must follow clear rules.
A bit set is a compact collection of yes-or-no values.
A stack trace shows how your program reached a failure.
Code generation is the compiler stage that turns analyzed program meaning into target code.
Linking is the step where the compiler connects your program with the code it depends on.
A mixed Zig and C project contains source files from both languages.
Endianness means the order used to store the bytes of a multi-byte value.
Copying data is sometimes necessary, but unnecessary copying is one of the easiest ways to waste time and memory.
A parser reads text and turns it into structure.
Cross-target debugging means debugging a program built for a different machine, operating system, or CPU architecture than the one you are sitting at.
Parsing means turning text into data.
await means: wait until an asynchronous operation has finished, then continue with its result.
A database stores data so it can be saved, searched, updated, and loaded again later.
Zig does not have a separate character type for ordinary strings.
break leaves a loop.
A program grows gradually.
Memory has addresses. Types also have alignment.
Zig strings are bytes. UTF-8 is one way to interpret those bytes as text.
A normal struct is laid out for ordinary program use. The compiler may add padding between fields so that each field has a suitable address.
A program that opens a file must close it. A program that allocates memory must free it. A program that locks a mutex must unlock it.
Exercise 9-17. Declare an optional integer.
A Zig function can return a type.
Exercise 11-1. Write a generic min function for values that support <.
A fixed-buffer allocator uses memory that already exists.
Input and output can fail.
The standard library gives access to files and directories through std.fs.
Examples are small programs kept inside the project.
A C program and a Zig program can share data only when both sides agree on layout.
Zig can build the same source code in different optimization modes.
Creating a thread is expensive.
A normal struct is laid out for efficient access.
Tests should be close to the code they check. Zig makes this easy with test blocks.
Before writing larger Zig programs, you need to understand an important fact:
A boolean is a value that can be only one of two things:
Zig has blocks.
Recursion is a technique where a function calls itself.
catch handles an error at the place where it happens.
A slice is a view into memory.
An optional pointer is a pointer that may have no value.
An anonymous struct is a struct type without a name.
An opaque type is a type whose internal structure is hidden.
Generating code at compile time means using Zig code to create specialized program behavior before the final executable is built.
@Type builds a type from compile-time type information.
The page allocator asks the operating system for memory directly.
Queues and stacks are two simple ways to organize a collection of items.
Zig’s standard library is imported with:
A debug build is a build made for finding mistakes.
Semantic analysis is the compiler stage that checks what a program means.
Cross compilation means building a program for a different machine than the one you are using.
Importing a C header lets Zig understand a C API. Linking gives the final program the actual compiled code.
A binary file format stores data as bytes with a specific structure.
Allocations are one of the most common causes of slow programs.
A game engine core is the small central layer that runs the game.
ARM is a CPU architecture family used in phones, tablets, laptops, routers, Raspberry Pi boards, microcontrollers, servers, and many embedded devices. When you write Zig for...
Formatting means turning values into text.
Async code lets a program start an operation now and receive the result later.
A memory allocator is code that gives memory to the rest of a program.
A boolean value is either true or false.
A for loop visits the elements of an array, slice, or range.
Large programs are divided into smaller files. Zig uses @import to include declarations from another file.
Pointer arithmetic means forming a new pointer by moving from one element to another.
A Zig string is a sequence of bytes.
A union is a value that may hold one of several types.
catch handles an error union.
Optionals and errors both describe a value that may not be produced.
Reflection means inspecting a type from inside the program.
Generic functions in Zig are specialized at compile time.
An arena allocator is used when many allocations have the same lifetime.
A program usually has three standard streams:
Zig uses format strings to turn values into text.
Zig has tests in the language.
C can call Zig when the Zig function is exported with a C-compatible ABI.
A program is made from object code.
Zig once had async functions as a language feature.
Most memory in a program behaves normally.
A library is code meant to be used by another program. In Zig, a library can be built from the same kind of source files as an executable. The difference is in how the build...
Before we write more Zig code, we need the Zig compiler.
Floating point numbers are numbers with fractional parts.
A while loop repeats while a condition is true.
Many functions need to produce more than one piece of information.
try is the most common way to handle errors in Zig.
A slice is a view into a sequence of values.
A slice is a view into a sequence of values.
A normal Zig struct is designed for ordinary data modeling.
A vector is a fixed-size group of values of the same type.
Parsing is the part of the compiler that reads source code and turns it into structure.
A compile-time loop is a loop that runs while Zig is compiling your program.
@alignOf asks the Zig compiler for the required memory alignment of a type.
A fixed buffer allocator gives memory from a buffer you already own.
Fuzz testing means testing a program with many generated inputs.
A C struct groups several fields into one value.
A linked list is a collection where each item points to the next item.
One of Zig’s strengths is compiler diagnostics. Zig tries to explain problems precisely instead of silently accepting dangerous behavior.
Terminal programming means writing programs that interact with the command line as more than simple text output.
A build option is a value passed from the command line into build.zig.
Embedded development means writing software for small computers inside devices.
SIMD means Single Instruction, Multiple Data.
WebAssembly, often shortened to Wasm, is a portable binary instruction format. It lets you compile code once and run it inside different hosts, such as web browsers, servers,...
A file lives inside a directory.
A condition variable lets one thread sleep until another thread says that something has changed.
A thread pool is a group of worker threads that wait for jobs.
Zig has floating-point types for numbers with fractional parts.
A while loop repeats while a condition is true.
A Zig program may be split across many files. Declarations can be made visible outside a file with pub.
A slice is a pointer and a length.
Some arrays have a special value after the last ordinary element. This value is called a sentinel.
An enum is a type whose values come from a fixed set of names.
try is a shortcut for a common operation:
Pointers are often optional.
A normal loop runs while the program runs.
Zig has no built-in interface keyword.
The general-purpose allocator is used for ordinary heap allocation.
Reading or writing one byte at a time is expensive.
A hash map stores key-value pairs.
A build option is a value passed to build.zig from the command line.
Calling a C function is only half the job. The linker must also find the code for that function.
A Zig target may use a C library, or it may use none.
A mutex protects shared data.
An HTTP client opens a network connection, sends a request, receives a response, and writes the response body.
An integer type can store only a fixed range of values.
Zig exists because low-level programming is still important, but the old tools have painful tradeoffs.
Integers are whole numbers.
Programs often need to repeat work.
Functions often need to produce results.
An error union type means:
A many item pointer is a pointer that can move across several values of the same type.
A multidimensional array is an array whose elements are also arrays.
A struct field can have a default value.
When people talk about Zig compiler internals, they often mention stage2.
A pointer stores the address of a value in memory.
Inline branching means Zig chooses a branch during compilation, not during runtime.
@sizeOf asks the Zig compiler how many bytes a type needs in memory.
A table-driven test checks many input cases with one test loop.
A StringHashMap is a hash map where the key is a string.
An arena allocator is an allocator that frees many allocations at once.
Calling a C function from Zig has three parts.
const std = @import"std";
Systems programming means working directly with the operating system.
Modern CPUs are fast, but memory is much slower.
A plugin architecture lets a program be extended without rewriting the whole program.
An atomic operation is a small operation that can safely happen while several threads are running.
Writing a file means sending bytes from your program to the operating system so they can be stored on disk.
macOS is one of Zig’s main desktop targets. You can use Zig on macOS to write command-line tools, development utilities, servers, libraries, and cross-platform applications.
A Zig project can depend on other Zig packages.
A static file server is a program that reads files from a directory and sends them to a browser over HTTP.
Zig has signed and unsigned integer types.
A switch chooses one branch from several alternatives.
When a function is called, values are passed from the caller to the function parameters.
A many-item pointer points to the first item in a sequence.
A slice is a view into an array.
Zig has no class syntax.
A function returns an error the same way it returns a normal value: with return.
An optional value cannot be used as the payload type until it is unwrapped.
In Zig, a type is a value.
Zig does not have a formal trait or interface system.
The page allocator gets memory from the operating system.
Writing bytes is the opposite of reading them.
std.ArrayList is a growable array.
A build file describes steps.
@cImport does two jobs.
The architecture part of a target tells Zig what kind of processor the program will run on.
A mutex makes one thread wait while another thread uses shared data.
A pointer has a type.
A line filter reads text, changes or selects some lines, and writes the result. Many Unix programs have this shape.
Zig is a programming language for writing programs that are fast, clear, and close to the machine.
Every value in a Zig program has a type.
An if statement is good for general conditions:
Function parameters are the inputs of a function.
An error set is a group of possible error names.
A pointer is a value that stores the address of another value.
An array literal is the syntax you use to write array values directly in source code.
A struct method is a function that belongs to a struct.
Zig 0.16.0 was released on April 14, 2026. The release contains 8 months of work, with changes from 244 contributors across 1,183 commits. The largest themes are the new I/O...
Optional unwrapping means taking the value out of an optional.
In the previous section, you learned that Zig can execute code during compilation.
One of the first Zig builtins you will learn is @import.
The general purpose allocator is Zig’s standard allocator for ordinary heap allocation.
A HashMap is a data structure for storing values by key.
A Zig build is made from steps.
A unit test checks one small piece of code in isolation.
Reading a file means asking the operating system for bytes stored on disk.
@cImport is Zig’s built-in way to import C declarations from header files.
A mutex is a lock for shared data.
A system call is a request from your program to the operating system.
When a program feels slow, your first job is not optimization.
Reflection means a program can inspect information about types while the program is being compiled or running.
Linux is one of the most natural platforms for Zig. Many Zig programs are built, tested, and deployed on Linux because Linux is common in servers, containers, embedded...
When you first open the Zig source code repository, it can feel overwhelming.
A JSON parser reads JSON text and turns it into data your program can use.
Zig has two kinds of variable declarations:
In Zig, if is an expression. It can produce a value.
Functions communicate through parameters and return values.
A single-item pointer points to one value.
An array literal creates an array value.
Fields are selected with the dot operator.
An error union combines a normal value with an error set.
null is the value used when an optional has no payload.
A function parameter can be marked comptime.
A generic struct is a function that returns a type.
An allocator is a value that knows how to allocate and free memory.
A file is read as bytes.
The std.mem module contains operations on memory, slices, bytes, and basic data movement. Much of Zig programming eventually passes through std.mem.
The file build.zig is a Zig program.
Writing every C declaration by hand is tedious. Zig can read C headers directly.
The operating system part of a target tells Zig what kind of system the program will run on.
A mutex is a lock for shared data.
Zig inserts safety checks for operations that are valid only under certain conditions. These checks are present in safe build modes. They catch mistakes at the point where the...
A file copier is a useful small program. It opens one file for reading, opens another file for writing, then copies bytes from the first to the second.
Zig is a programming language for writing fast, small, reliable programs.
Zig is a programming language for writing fast, small, reliable programs.
A program stores values so it can use them later. In Zig, you store values with two main keywords:
Programs need to make choices.
Functions are reusable blocks of code.
Most programming languages need a way to handle failure.
Memory is where a program keeps its data while it runs.
An array is a group of values stored next to each other.
A struct is a type that groups several values together.
An optional type is a type that can hold either a value or no value.
comptime means “compile time.”
Zig has special built-in functions whose names start with @.
Memory is one of the most important ideas in Zig.
An ArrayList is one of the most important data structures in Zig.
std is Zig’s standard library.
Zig has a built-in build system.
Zig has a built-in test system. You do not need a separate testing library to start writing tests.
Zig works unusually well with C because it treats C as a first-class part of systems programming.
A thread is a separate path of execution inside one program.
A memory mapped file is a file that the operating system places into your program's address space.
Performance is one of the main reasons people choose Zig.
Zig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
Windows is one of Zig’s main supported platforms. You can write Zig programs on Windows, build Windows executables, call Windows system APIs, link with C libraries, and...
In this project, we will build a small command-line calculator.
The Zig compiler is not only a compiler for the Zig language. It is also the center of the Zig toolchain.
A Zig program is made from declarations.
A block is a sequence of statements inside braces.
A function groups statements into a single operation. Functions are the basic unit of organization in a Zig program.
A variable has a value. In Zig, a variable may also have an address.
An array is a sequence of values of the same type.
A struct is a type made from named fields.
Programs fail for many reasons. A file may not exist. Memory allocation may fail. Input may be malformed. A network connection may close unexpectedly.
Sometimes a value may or may not exist.
A Zig program runs in two stages.
A function in Zig can take types as parameters.
A program uses memory to store values.
Most programs spend their time moving bytes.
The std.debug module contains utilities for debugging programs. The most commonly used function is print, which writes formatted output to standard error.
Large programs are rarely built with a single compiler command.
One of Zig's design goals is direct interoperability with C.
One of Zig's main design goals is cross compilation.
A thread is an independent flow of execution.
Zig gives the programmer direct access to memory, integers, pointers, and machine operations. This makes many programs simple and efficient. It also makes some operations...
Many programs begin the same way: they read command-line arguments, decide what the user requested, then execute an operation.
Learn Zig book notes, organized into 20 chapters.
The first program in Zig is small.
Many programs begin the same way: they read command-line arguments, decide what the user requested, then execute an operation.
Zig gives the programmer direct access to memory, integers, pointers, and machine operations. This makes many programs simple and efficient. It also makes some operations...
A thread is an independent flow of execution.
One of Zig's main design goals is cross compilation.
One of Zig's design goals is direct interoperability with C.
Large programs are rarely built with a single compiler command.
The std.debug module contains utilities for debugging programs. The most commonly used function is print, which writes formatted output to standard error.
Most programs spend their time moving bytes.
This book describes the Zig programming language as of Zig 0.16.
A program uses memory to store values.
A
A function in Zig can take types as parameters.
These are short answers or sketches for selected exercises from the book. Many exercises have several reasonable solutions. The important part is clarity and correctness.
A Zig program runs in two stages.
This appendix records the kinds of changes that matter when moving older Zig code to Zig 0.16. It is a practical checklist, not a full release history.
Sometimes a value may or may not exist.
The programs in this chapter are small. They are meant to be changed, broken, rebuilt, and studied.
Zig tries to report errors at the point where the program becomes invalid. Many messages are direct: a value has the wrong type, a variable is unused, an error was ignored, or...
Programs fail for many reasons. A file may not exist. Memory allocation may fail. Input may be malformed. A network connection may close unexpectedly.
A useful program reads text and counts something.
One of Zig's central goals is direct interoperability with C. Zig can call C code, compile C code, link system libraries, export functions to C, and translate C headers.
A struct is a type made from named fields.
Programs often need input.
Zig builds programs with Zig code. The build script is named:
An array is a sequence of values of the same type.
A program can compute a value before it prints it.
The Zig standard library is imported as:
A variable has a value. In Zig, a variable may also have an address.
The function std.debug.print writes text.
Builtin functions are part of the language. Their names begin with @.
A function groups statements into a single operation. Functions are the basic unit of organization in a Zig program.
A program works with values. In Zig, values are usually stored in constants or variables.
This appendix lists the common operators by use. When an expression is not obvious, use parentheses.
A block is a sequence of statements inside braces.
There are two common ways to run a small Zig program.
This appendix is a quick map of Zig syntax. It is not a grammar. The full Zig grammar is part of the official language reference. Zig 0.16 also keeps the language small enough...
A Zig program is made from declarations.
The first program in Zig is small.
The first program in Zig is small.
The first program in Zig is small.
Zig is a programming language for writing fast, small, reliable programs.
The Zig compiler is not only a compiler for the Zig language. It is also the center of the Zig toolchain.
In this project, we will build a small command-line calculator.
Windows is one of Zig’s main supported platforms. You can write Zig programs on Windows, build Windows executables, call Windows system APIs, link with C libraries, and...
Zig has a formatting system built into the standard library. You have already used it many times through std.debug.print.
Performance is one of the main reasons people choose Zig.
A memory mapped file is a file that the operating system places into your program's address space.
A thread is a separate path of execution inside one program.
Zig works unusually well with C because it treats C as a first-class part of systems programming.
Zig has a built-in test system. You do not need a separate testing library to start writing tests.
Zig has a built-in build system.
std is Zig’s standard library.
An ArrayList is one of the most important data structures in Zig.
Memory is one of the most important ideas in Zig.
Zig has special built-in functions whose names start with @.
comptime means “compile time.”
Memory is where a program keeps its data while it runs.
An optional type is a type that can hold either a value or no value.
A struct is a type that groups several values together.
An array is a group of values stored next to each other.
Most programming languages need a way to handle failure.
Functions are reusable blocks of code.
Programs need to make choices.
A program stores values so it can use them later. In Zig, you store values with two main keywords:
Zig is a programming language for writing fast, small, reliable programs.