Code Monkey home page Code Monkey logo

zig-thing's Introduction

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.12.0

Current modules (all WIP)

Name Description
thing.FixedBufferDualList Dual-headed linked list for resource IDs allocation (active/available)
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.0.3.tar.gz

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

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

// <standard_boilerplate>
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// main build step...
const exe = b.addExecutable(.{ ... });
// </standard_boilerplate>

// declare & configure dependency (via build.zig.zon)
const thing = b.dependency("thi.ng", .{
    .target = target,
    .optimize = optimize,
}).module("thi.ng");

// declare module for importing via given id
exe.root_module.addImport("thi.ng", 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:

const thing = @import("thi.ng");

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 - 2024 Karsten Schmidt // Apache Software License 2.0

zig-thing's People

Contributors

holdings-app avatar postspectacular avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

bermi

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.