1
0
Fork
You've already forked zig-thing
0
Small collection of data types/structures, utilities & open-learning with Zig https://thi.ng
  • Zig 100%
2026年05月27日 17:53:44 +02:00
.github/workflows ci: add GH actions 2025年06月21日 13:36:52 +02:00
doc docs: update vectors readme 2025年09月11日 22:59:47 +02:00
src build: switch to Zig 0.16.0, update @Type() syntax 2026年05月27日 17:53:44 +02:00
.gitattributes build: remove obsolete files, update gitignore/attribs 2022年12月18日 16:48:01 +01:00
.gitignore chore: update .gitignore 2024年10月23日 06:35:51 +02:00
.tool-versions build: switch to Zig 0.16.0, update @Type() syntax 2026年05月27日 17:53:44 +02:00
build.zig build: update build info & module name 2025年06月22日 00:23:22 +02:00
build.zig.zon feat: switch to zig 0.15.1, rewrite all vector impls 2025年09月11日 22:58:36 +02:00
LICENSE doc: add readme & license 2022年03月26日 14:37:59 +01:00
README.md docs: update main readme 2025年09月12日 13:40:26 +02:00

zig.thi.ng

About

Various, still somewhat unstructured, raw-around-the-edges utilities / open learning with Zig, at some point hopefully culminating into a useful toolkit.

All code in this repo is compatible with Zig v0.15.1.

Current modules (all WIP)

Name Description
thing.FixedBufferDualList Dual-headed linked list for resource IDs allocation (active/available)
thing.HashGrid2 2D hash grid spatial indexing & neighborhood query
thing.ndarray Generic nD-Array base implementation
thing.random Additional std.rand.Random-compatible PRNGs and related utilities.
thing.vectors SIMD-based generic vector type & operations (incl. type specific additions)

Usage with Zig's package manager

Tagged versions of this project are available and can be added as dependency to your project via zig fetch, like so:

zig fetch --save https://github.com/thi-ng/zig-thing/archive/refs/tags/v0.3.0.tar.gz

The --save option adds a new dependency called thing to your build.zig.zon project file.

You'll also need to update your main build.zig with these additions:

// <standard_boilerplate>consttarget=b.standardTargetOptions(.{});constoptimize=b.standardOptimizeOption(.{});// main build step...constexe=b.addExecutable(.{...});// </standard_boilerplate>// declare & configure dependency (via build.zig.zon)constthing=b.dependency("thing",.{.target=target,.optimize=optimize,}).module("thing");// declare module for importing via given idexe.root_module.addImport("thing",thing);

Important: If you're having a test build step configured (or any other build step requiring separate compilation), you'll also need to add the .root_module.addImport() call for that step too!

With these changes, you can then import the module in your source code like so:

constthing=@import("thing");

Building & Testing

The package is not meant to be build directly (yet), so currently the build file only declares a module.

To run all tests:

zig test src/main.zig

License

© 2021 - 2025 Karsten Schmidt // Apache Software License 2.0