1 Zig’s big ideas

 

This chapter covers

  • Zig’s place in the established world of programming
  • The priorities of the Zig language and community
  • How Zig relates to other systems programming languages, especially C
  • What it’s like to program in Zig
  • Software projects where Zig excels

Zig is a language made for builders. It’s a new direction for systems programming that aims to combine the best ideas from the past with a sleek modern design. It will enable you to write reliable, maintainable code that relies on the bare minimum third-party dependencies and runs just about anywhere.

You might be a builder too, especially if you see yourself in figure 1.1.

Figure 1.1 Some of the kinds of developers that could benefit from Zig
CH01 F01 hinsonhasty

New software is constantly being written, and a lot of it is presented as a "better" replacement for something that we already know works, and works well. Zig might be new, but it’s not a fork in the road. If you ever plan to write a native library, a data processing tool, a performant backend, an embedded operating system, or any other kind of technology where performance and reliability are key, learning Zig will enable you to go from zero to robust code quickly and painlessly.

1.1 How are we going to learn Zig?

1.1.1 Zig AI

1.2 Zig is C’s collaborator, not C’s successor

1.2.1 Zig was born into a thriving ecosystem

1.2.2 Zig’s inheritance

1.2.3 Zig’s improvements on C and C++

1.3 Leveling up developer experience, for the users

1.3.1 Hey, did you forget something?

1.3.2 Do it at comptime

1.3.3 Memory is a resource

1.3.4 Building is not an afterthought

1.4 Learning Zig without frustration

1.5 Just Don’t Get Stuck! It’s That Easy

1.5.1 Read errors before you weep

1.5.2 Use a debugger

1.5.3 Use zig fmt

1.5.4 Explore, don’t copy

1.6 How does Zig feel?

1.6.1 All Your Codebase

1.7 Applying Zig