/zig-learning

A bunch of links to blog posts, articles, videos, etc for learning Zig

zig-learning Build Status

A bunch of links to blog posts, articles, videos, etc for learning Zig. Feel free to submit a pull request if you have some links/resources to add. Also, I try to verify that the articles below have some real content (i.e. they aren't 2 paragraph long blog posts with little information) to ensure I'm not listing "fluff" pieces. If you have an idea for a better way to organize these links, please let me know. Inspired by rust-learning.

Introduction

Do you want to be convinced that Zig is worth learning? Let us show you the Comparison).

The main documentation is always the best beginning, so if you haven't read it yet, start by reading the Zig learn). Online learning resources here and here.

Tag meanings

  • ⭐ Something made by repo owner member.
  • 🔚 Concepts are still useful but code could not compile.
  • 🔜 Work In Progress.

Table of Contents

Books

  • Zig Programming Language - An introductory book on Zig, covering the basics to advanced topics.
  • Zig by Example - A hands-on guide with examples to learn Zig.
  • zig-cookbook - Simple Zig programs that demonstrate good practices to accomplish common programming tasks.

Videos

Playlists

Presentations

Podcasts

Zig in practice

Best Practices/Style Guides

Cheat sheets

  • Syntax Index - Official documentation covering Zig's syntax and key concepts.
  • Zig Learn - A community-maintained guide for beginners, offering an introduction to Zig's core features with practical examples.
  • Zig by Example - A collection of simple and concise Zig code examples for learning and reference.
  • Zig Standard Library Overview - A detailed overview of Zig’s standard library, ideal for understanding built-in utilities and functions.
  • Zig Cheat Sheet - A handy reference guide with key Zig programming concepts and syntax patterns, created by a Zig community member.
  • Zig Language Patterns - Best practices and design patterns written by Andrew Kelley, the creator of Zig.
  • Zig Playground - An online environment for experimenting with Zig code snippets and testing ideas quickly.
  • Community Zig Tutorials - A portal for discovering new Zig tutorials and community-driven content.
  • Zig Memory Management Guide - Useful tips and tricks for managing memory safely and efficiently in Zig.

Zig internals

  • Zig Proposals - A collection of Zig’s proposed RFCs (Request for Comments) for proposals.
  • Zig Documentation - The official and comprehensive documentation for understanding Zig’s features and syntax.
  • Zig Community Forum - A discussion platform for Zig language design, development news, and technical questions.

Compilation

  • Zig Compilation Guide - Zig official documentation. This guide provides detailed information on how to set up compilation with Zig. It includes basic steps, toolchain setup, and target options.

  • Zig for Raspberry Pi - A community-driven project that shows how to cross-compile Zig programs for the Raspberry Pi, with a setup for cross-compiling Zig on Linux.

  • Zig Cross Compilation for macOS - This project allows you to cross-compile code on Linux that will be executed on macOS.

  • Zig: Cross-compiling for Systems - A blog post that explores how Zig can be used for multi-systems, Cross-compilation is especially great when you need to release an application that runs on multiple platforms: with Zig you can create all release artifacts from a single machine.

  • Compile Cargo project with zig - It is a tool that facilitates building Rust projects with the Zig toolchain, enabling cross-compilation and optimizations that are typically more straightforward than using Rust's native toolchain alone.

FFI

  • Using Zig with C: Interop Guide - The official Zig documentation for C interop. Zig provides seamless integration with C, allowing you to call C functions directly and link against C libraries without needing additional tooling.

  • Zig and Node.js: Writing Native Modules - A GitHub issue tracking the integration of Zig with Node.js for native modules. It discusses potential setups for creating fast, native Node.js modules using Zig.

  • Cross-compiling Zig for Mobile Platforms (Android/iOS) - A tutorial by Andrew Kelley on cross-compiling Zig for Android, including setup instructions and guidance on building shared libraries. Though there isn't a direct iOS equivalent yet, the process can be adapted similarly.

  • Zig and Dynamic Libraries: Working with .so and .dll - A blog post that explores how to build dynamic libraries (.so and .dll) using Zig. This is particularly useful when you need to create shared libraries for FFI purposes.

  • Integrating Zig with Rust for FFI - A tutorial on how to create a Rust-Zig integration, using Zig’s FFI to enhance performance or utilize Zig’s unique features.

  • Building and Linking C Libraries with Zig - This ZigLearn chapter shows how to use and link C libraries with Zig, which is helpful when creating bindings or using external C code in a Zig project.

CI / Testing

  • Setting up Zig with GitHub Actions - A detailed guide on using GitHub Actions for Zig projects. It covers basic configurations for running tests and building Zig code on different platforms.

  • Using Zig with Travis CI - While less common than GitHub Actions, some legacy projects still use Travis CI. Zig's documentation includes pointers on setting up Travis CI for Zig builds.

  • Fuzz Testing in Zig - Official announcement detailing Zig's built-in support for fuzz testing introduced in Zig 0.14. It includes how to use the fuzz testing features and examples of detecting bugs in Zig applications.

  • Test Coverage for Zig Projects - A GitHub issue discussing ideas and strategies for implementing test coverage in Zig. Though Zig doesn’t have built-in support for test coverage yet, there are community-driven approaches and tools you can try.

  • Beautiful Commits and Code Formatting with zig fmt - Zig comes with a built-in formatter, zig fmt, to ensure consistent code style. You can integrate this into your CI setup to enforce formatting rules automatically.

  • Performance Testing in Zig - This project exists to track various benchmarks related to the Zig project regarding execution speed, memory usage, throughput, and other resource utilization statistics.

  • Zig Test Documentation - Zig’s documentation on writing and running tests. It provides an overview of Zig's testing features, including test declarations, assertions, and running tests as part of your CI pipeline.

Debug / Profiling

  • Zig Debugging with vscode - A gist about using vscode for debugging Zig programs.

  • Zig on Compiler Explorer - Like Rust's Compiler Explorer, Zig is also supported on Compiler Explorer. You can use this to explore Zig code as assembly and view the generated machine code. Simply select Zig as the compiler on the site.

  • Zig Performance Tracking - This project exists to track various benchmarks related to the Zig project regarding execution speed, memory usage, throughput, and other resource.

  • Code Coverage for Zig - Despite the Zig compiler not having built-in support for generating code coverage information, it is still possible to generate it (on Linux at least). There might be other possibilities.

Are we ... yet?

  • Are We IDE Yet? - Zig - An overview of current IDE support for Zig. It lists plugins and extensions for popular editors like VSCode, Sublime Text, and Vim, tracking the maturity of the Zig developer experience.

  • Are We Game Yet? - Zig - It explores libraries, game engines, and Zig's capabilities for game-related projects.

  • Are We Async Yet? - Zig - Zig's official documentation on asynchronous programming. Zig is still developing its async features, but this section provides an in-depth look at the current state and future goals for asynchronous execution.

  • Awesome Zig - A comprehensive list of curated resources for Zig, covering libraries, tools, tutorials, and more. It's similar to "Not-Yet-Awesome Rust," helping developers find or contribute to Zig projects.

  • Zig GUI Libraries - Capy is a GUI library for Zig. It is mainly intended for creating applications using native controls from the operating system. It has been made with the goal to empower standalone UI applications, integration in games or any other rendering process is a non-goal.

Zig Comparison with Other Languages


Languages Links
C
C++
Go
Rust
Python
JavaScript
Java
Swift
Haskell
Ruby
Erlang
Nim

Applications / Libraries / Tools

See repos nrdmn/awesome-zig & zigcc/awesome-zig

Language stuff

Closures

Documentation

Enums

Errors

Iterators

Memory

Comptime

Strings

Syntax Extensions

Optional

Playground

Locale links

Connection

Are you searching for a Ziguanas ? Ziglang.org

Do you want to ask a question? Zig Users Forum, Reddit

Do you want to meet them IRL? Community

Go to Ziguanas events? Zig SHOWTIME, Zig conferences and events

Are you looking for a job? Zig Jobs on Indeed,

Are you fast, simple, and focused? Find something Ziggy to work on!

Do you want to stay up to date? The official blog, Zig NEWS, The official reddit

Do you want to find out why some historical decisions took place? Zig GitHub Discussions

Fearless Zig Bloggers

Tutorials & Workshop Materials

These are slides and materials from brick-and-mortar workshops about Zig. While they're unlikely to help a student learning independently, they may be of interest if you're running a workshop on Zig.