avatar_url stringlengths 47 116 ⌀ | name stringlengths 1 46 | full_name stringlengths 7 60 | created_at stringdate 2016-04-01 08:17:56 2025-05-20 11:38:17 | description stringlengths 0 387 ⌀ | default_branch stringclasses 44
values | open_issues int64 0 4.93k | stargazers_count int64 0 78.2k | forks_count int64 0 3.09k | watchers_count int64 0 78.2k | tags_url stringlengths 0 94 | license stringclasses 27
values | topics listlengths 1 20 | size int64 0 4.82M | fork bool 2
classes | updated_at stringdate 2018-11-13 14:41:18 2025-05-22 08:23:54 | has_build_zig bool 2
classes | has_build_zig_zon bool 2
classes | zig_minimum_version stringclasses 50
values | repo_from stringclasses 3
values | dependencies listlengths 0 38 | readme_content stringlengths 0 437k | dependents listlengths 0 21 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
https://avatars.githubusercontent.com/u/12397229?v=4 | zbackoff | flowerinthenight/zbackoff | 2024-07-24T06:55:11Z | Jittered backoff implementation in Zig. | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/flowerinthenight/zbackoff/tags | MIT | [
"backoff",
"jitter",
"retry",
"zig",
"ziglang"
] | 36 | false | 2025-03-18T17:59:47Z | true | true | unknown | github | [] | <a></a>
(This repo is mirrored to <a>https://codeberg.org/flowerinthenight/zbackoff</a>).
<strong>zbackoff</strong> implements jittered backoff. Useful when retrying operations that can potentially fail (i.e. network calls). The implementation is based on <a>this article</a> from the AWS Architecture Blog.
You can use it like so:
``` zig
const std = @import("std");
const zbackoff = @import("zbackoff");
fn funcThatCanFail() !u64 {
_ = try std.time.Instant.now();
std.debug.print("funcThatFails()\n", .{});
return error.UnwantedResult1;
}
pub fn main() void {
var bo = zbackoff.Backoff{};
for (0..3) |_| {
const result = funcThatCanFail() catch {
std.time.sleep(bo.pause());
continue;
};
_ = result;
break;
}
}
``` | [
"https://github.com/flowerinthenight/zgroup"
] |
https://avatars.githubusercontent.com/u/1671644?v=4 | zjxl | arrufat/zjxl | 2024-04-08T00:26:21Z | Load and save JPEG-XL images in Zig | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/arrufat/zjxl/tags | MIT | [
"image",
"jpeg-xl",
"jpegxl",
"jxl",
"zig"
] | 8 | false | 2024-10-30T21:38:20Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/28966224?v=4 | kewpie | weskoerber/kewpie | 2024-02-10T18:28:15Z | A simple query string parser for Zig. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/weskoerber/kewpie/tags | MIT | [
"zig",
"zig-package",
"ziglang"
] | 23 | false | 2025-04-04T22:37:54Z | true | true | 0.14.0 | github | [] | <a></a>
<a></a>
Kewpie
A simple query string parser for zig.
Getting Started
Prerequisites
<ul>
<li><a>Zig</a> (<code>0.14.0</code> or newer)<ul>
<li>If using Zig <code>0.12</code> and <code>0.13</code>, use the <a><code>zig-0.12</code></a> branch</li>
</ul>
</li>
</ul>
Installation
<ol>
<li>
Add kewpie as a dependency in your project using Zig's package manager
<code>console
zig fetch --save git+https://github.com/weskoerber/kewpie.git#0.1.1</code>
</li>
<li>
Add kewpie module to your <code>build.zig</code>
<code>zig
const kewpie = b.dependency("kewpie", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("kewpie", kewpie.module("kewpie"));</code>
</li>
</ol>
Usage
<ul>
<li>
Parse entire query string into a hash map
```zig
const std = @import("std");
const kewpie = @import("kewpie");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer if (gpa.deinit() != .ok) @panic("leak");
<code>const uri = try std.Uri.parse("https://example.com?hello=world");
const query_params = try kewpie.parse(gpa.allocator(), uri);
defer query_params.deinit();
if (query_params.get("hello")) |value| {
// `value` holds the value `world`
// ...
}
</code>
}
```
</li>
<li>
Parse the query string into an iterator
```zig
const std = @import("std");
const kewpie = @import("kewpie");
pub fn main() !void {
const uri = try std.Uri.parse("https://example.com?hello=world");
<code>var query_params = kewpie.iter(uri);
while (query_params.next()) |param| {
// `param` holds a QueryParam struct
// ...
}
</code>
}
```
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/79172854?v=4 | x-client | nickelca/x-client | 2024-08-06T07:34:58Z | X11 client library for Zig | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/nickelca/x-client/tags | MIT | [
"cross-platform",
"windowing",
"x11",
"zig",
"zig-package"
] | 78 | false | 2025-05-10T00:02:45Z | true | true | 0.13.0 | github | [] | Inspired by @marler8997's zigx at https://github.com/marler8997/zigx/ | [] |
https://avatars.githubusercontent.com/u/24578855?v=4 | zig-md4 | deatil/zig-md4 | 2024-05-18T04:51:42Z | A MD4 hash function library for Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/deatil/zig-md4/tags | Apache-2.0 | [
"md4",
"zig",
"zig-md4"
] | 14 | false | 2025-03-24T07:04:51Z | true | true | 0.14.0-dev.3451+d8d2aa9af | github | [] | Zig-MD4
zig-md4 is a MD4 hash function for Zig.
Env
<ul>
<li>Zig >= 0.14.0-dev.3451+d8d2aa9af</li>
</ul>
Adding zig-md4 as a dependency
Add the dependency to your project:
<code>sh
zig fetch --save=zig-md4 git+https://github.com/deatil/zig-md4#main</code>
or use local path to add dependency at <code>build.zig.zon</code> file
<code>zig
.{
.dependencies = .{
.@"zig-md4" = .{
.path = "./lib/zig-md4",
},
...
},
...
}</code>
And the following to your <code>build.zig</code> file:
<code>zig
const zig_md4_dep = b.dependency("zig-md4", .{});
exe.root_module.addImport("zig-md4", zig_md4_dep.module("zig-md4"));</code>
The <code>zig-md4</code> structure can be imported in your application with:
<code>zig
const zig_md4 = @import("zig-md4");</code>
Get Starting
~~~zig
const std = @import("std");
const MD4 = @import("zig-md4").MD4;
pub fn main() !void {
var out: [16]u8 = undefined;
<code>var h = MD4.init(.{});
h.update("abc");
h.final(out[0..]);
// output: a448017aaf21d8525fc10ae87aa6729d
std.debug.print("output: {x}\n", .{out});
</code>
}
~~~
LICENSE
<ul>
<li>The library LICENSE is <code>Apache2</code>, using the library need keep the LICENSE.</li>
</ul>
Copyright
<ul>
<li>Copyright deatil(https://github.com/deatil).</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/46355873?v=4 | zique | l3r8yJ/zique | 2024-07-20T18:14:23Z | Message broker library written in zig | master | 3 | 2 | 0 | 2 | https://api.github.com/repos/l3r8yJ/zique/tags | MIT | [
"messaging",
"zig"
] | 22 | false | 2025-05-08T04:32:36Z | true | true | 0.13.0 | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/15544577?v=4 | zig-tidy | jacobly0/zig-tidy | 2024-05-04T15:33:27Z | HTML Tidy packaged for Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/jacobly0/zig-tidy/tags | MIT | [
"zig"
] | 1 | false | 2024-12-29T04:07:05Z | true | true | unknown | github | [
{
"commit": "5.8.0",
"name": "tidy",
"tar_url": "https://github.com/htacg/tidy-html5/archive/5.8.0.tar.gz",
"type": "remote",
"url": "https://github.com/htacg/tidy-html5"
}
] | tidy
This is <a>tidy</a>, packaged for <a>Zig</a>. | [] |
https://avatars.githubusercontent.com/u/9300391?v=4 | learn-cs | fpsvogel/learn-cs | 2024-08-03T14:16:57Z | Learning resources for computer science, C, etc. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/fpsvogel/learn-cs/tags | - | [
"awesome-lists",
"books",
"c",
"computer-science",
"learning-resources",
"low-level-programming",
"systems-programming",
"zig"
] | 54 | false | 2025-03-05T11:13:05Z | false | false | unknown | github | [] | Learn Computer Science and Low-Level Programming
How computers work
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> 💲<a>Code: The Hidden Language of Computer Hardware and Software</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>NandGame</a> and solutions: <a>1</a>, <a>2</a>, <a>3</a>
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> From Nand to Tetris: <a>Part 1</a>, <a>Part 2</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Turing Complete</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Digital Design and Computer Architecture</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Build a computer in <a>CircuitVerse</a> or <a>Logisim Evolution</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Arithmazium</a>
Zig
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Introduction to Zig: a project-based book</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Zig - "Learn" page listing other resources</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Zig + raylib: <a>raylib-zig</a> (based on <a>RayZig</a>?), <a>examples</a>, <a>a template with raygui</a>
C
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>C Programming: A Modern Approach</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>CS50 problem sets (1-5)</a> and solutions: <a>1</a>, <a>2</a>, <a>3</a>, <a>4</a>, <a>5</a>, <a>6</a>, <a>7</a>, <a>8</a>, <a>9</a>, <a>10</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Tutorial on pointers and arrays in C</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Exercism - C</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Advent of Code: <a>CLI/runner written in C</a>; I can't find any repos with solutions for all years, but probably there are repos with solutions for a specific year.
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Look into other "better C" languages besides Zig: <a>Odin</a>, <a>Beef</a>, <a>V</a>, <a>Jai</a>, <a>C3</a>, <a>MiniLang</a>, and <a>others</a> (minus the C++ replacements like Rust, which are too complex for my purposes)
C game programming
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Handmade Hero videos</a> plus <a>Handmade Penguin</a> to follow along in Linux
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Handmade Quake videos</a> and <a>source code</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Kohi Game Engine videos</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Make a game, taking inspiration from <a>high_impact</a>, <a>raylib</a>, <a>Box2D 3.x</a> (or see <a>box2d-raylib</a>)
- Or make a text-based game: see <a>How to program a text adventure in C</a> and <a>Knuth's C port of Colossal Cave Adventure</a> (which, incidentally, is an example of <em>literate programming</em>, now reincarnated in <a>Entangled</a>)
- <a>Handmade Network</a>
Data Structures and Algorithms
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> 💲<a>Data Structures and Algorithms in Java</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>The Algorithm Design Manual</a> plus <a>lecture videos</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Algorithm Design</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Algorithms</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Introduction to Algorithms</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Practice on LeetCode using a familiar high-level language (for me Ruby).
- Ruby solutions: <a>1</a>, <a>2</a>, <a>3</a>, <a>4</a>, <a>5</a>
- <a>Algorithms Ruby gem</a> that is <a>included in the LeetCode environment</a>.
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Practice on LeetCode using a low-level language such as C.
Operating systems, etc.
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> 💲<a>Operating Systems: Three Easy Pieces</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Dive into Systems</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 💲<a>Computer Systems: A Programmer's Perspective</a>
Compilers
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Crafting Interpreters</a>
Ruby C extensions
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>A Rubyist's Walk Along the C-side</a> | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | toolbox | tiawl/toolbox | 2024-03-14T18:50:56Z | A toolkit to package & maintain C APIs for @ziglang | trunk | 0 | 2 | 3 | 2 | https://api.github.com/repos/tiawl/toolbox/tags | Unlicense | [
"spaceporn",
"zig",
"zig-package",
"ziglang"
] | 172 | false | 2025-05-09T12:07:24Z | true | true | 0.14.0 | github | [] | Toolbox
A toolkit to package & maintain C APIs for <a>Zig</a>
Important note
This package was originally thought for the <a>tiawl/spaceporn</a> dependencies chain. It is actively used in it. BUT it is also possible to use it in other projects. However maybe some features are always binded to its original conception guideline. For this reason, this repository is open to breaking proposals. So if you are using it for your own needs, expect breaking (but also documented) changes for each release.
If you want to see how to use it you can check repositories list into the <a>CICD reminder section</a>.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/vulkan.zig</a>
* <a>tiawl/wayland.zig</a>
* <a>tiawl/X11.zig</a>
* <a>tiawl/glfw.zig</a>
* <a>tiawl/cimgui.zig</a>
* <a>tiawl/spirv.zig</a>
* <a>tiawl/glslang.zig</a>
* <a>tiawl/shaderc.zig</a>
License
This repository is dedicated to the public domain. See the LICENSE file for more details. | [
"https://github.com/tiawl/X11.zig",
"https://github.com/tiawl/cimgui.zig",
"https://github.com/tiawl/glfw.zig",
"https://github.com/tiawl/glslang.zig",
"https://github.com/tiawl/libjq.zig",
"https://github.com/tiawl/oniguruma.zig",
"https://github.com/tiawl/shaderc.zig",
"https://github.com/tiawl/spir... |
https://avatars.githubusercontent.com/u/85748765?v=4 | gc.zig | johan0A/gc.zig | 2024-07-01T00:16:03Z | a Zig garbage collector interface for the bdwgc garbage collector. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/johan0A/gc.zig/tags | MIT | [
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 1,296 | false | 2025-02-26T00:50:12Z | true | true | unknown | github | [] | <blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
Dont use this for anything serious
</blockquote>
gc.zig
a <a>Zig</a> garbage collector package that provides a garbage collector interface as well as the <a>bdwgc Boehm GC</a> garbage collector and more.
Usage
```zig
const zig_gc = @import("zig_gc");
pub fn main() !void {
// create a new garbage collector interface
const gc = zig_gc.BdwGarbageCollector.gc();
<code>// coerce the gc interface to the standard allocator interface before passing it to ArrayList
var list = std.ArrayList(u8).init(gc.allocator());
try list.appendSlice("Hello");
try list.appendSlice(" World");
std.debug.print("{s}\n", .{list.items});
// the program will exit without memory leaks :D
</code>
}
<code>``
Why use a specialized garbage collector interface? (</code>Gc`)
1. It signals to the caller that the function was made with the intention of using a garbage collector.
2. (not yet implemented) The garbage collector can benefit from more information being passsed in about the allocation for better performance. For example, if the allocationg contains pointers or not. And that is not possible with the standard allocator interface.
otherwise, the BdwGarbageCollector acts similarely to a standard allocator and can be used with the standard allocator interface by using <code>Gc.allocator(self: Gc)</code> or <code>BdwGarbageCollector.allocator()</code>.
install
<ol>
<li>Add <code>zig_gc</code> to the depency list in <code>build.zig.zon</code>: </li>
</ol>
<code>sh
zig fetch --save https://github.com/johan0A/gc.zig/archive/refs/tags/0.2.0.tar.gz</code>
<ol>
<li>Config <code>build.zig</code>:</li>
</ol>
```zig
...
const zig_gc = b.dependency("zig_gc", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("zig_gc", zig_gc.module("zig_gc"));
...
```
License
Licensed under the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/60897190?v=4 | zig-result | Remy2701/zig-result | 2024-06-16T17:15:21Z | A zig library to add payload to errors. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/Remy2701/zig-result/tags | - | [
"error-handling",
"zig"
] | 1,496 | false | 2025-02-01T13:25:49Z | true | true | 0.13.0 | github | [] | Zig Result
This is a library for creating and using results (similar to the ones in Rust). Those results allows you
to give more information about an error such as a description.
<strong>Zig Version:</strong> 0.13.0
Installation
You can either manually install the library, or automatically.
Manual
You can install the library by adding it to the build.zig.zon file, either manually like so:
<code>zig
.{
...
.dependencies = .{
.@"zig-result" = .{
.url = "https://github.com/Remy2701/zig-result/archive/main.tar.gz",
.hash = "...",
}
}
...
}</code>
The hash can be found using the builtin command:
<code>sh
zig fetch https://github.com/Remy2701/zig-result/archive/main.tar.gz</code>
Automatic
Or you can also add it automatically like so:
<code>sh
zig fetch --save https://github.com/Remy2701/zig-result/archive/main.tar.gz</code>
Adding the module to your project
Then in the <code>build.zig</code>, you can add the following:
```zig
const zig_result = b.dependency("zig-result", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("result", zig_result.module("zig-result"));
```
The name of the module (<code>result</code>) can be changed to whatever you want.
Finally in your code you can import the module using the following:
<code>zig
const result = @import("result");</code>
Example
```zig
const std = @import("std");
const Result = @import("result").Result;
pub fn main() !void {
const ErrorPayload = union(enum) {
InvalidCharacter: u8,
Unknown: struct {
message: []const u8,
},
};
<code>const ResultType = Result(i32, ErrorPayload);
const result = ResultType.ok(42);
const value = try result.unwrap();
std.debug.print("value: {d}\n", .{value});
unwrapCaptureExample: {
var payload: ErrorPayload = undefined;
_ = result2.unwrapCapture(&payload) catch |err| {
std.debug.print("Error: {s} / {}\n", .{ @errorName(err), payload });
break :unwrapCaptureExample;
};
}
</code>
}
```
More examples can be found in the tests, by navigating to the location of <a><code>Result</code></a>. | [] |
https://avatars.githubusercontent.com/u/20795890?v=4 | flymake-ziglint | flymake/flymake-ziglint | 2024-02-29T09:52:28Z | Flymake for ziglint | master | 0 | 2 | 2 | 2 | https://api.github.com/repos/flymake/flymake-ziglint/tags | GPL-3.0 | [
"elisp",
"emacs",
"zig",
"ziglint"
] | 32 | false | 2025-04-22T23:16:36Z | false | false | unknown | github | [] | <a></a>
<a></a>
flymake-ziglint
<blockquote>
Flymake for ziglint
</blockquote>
<a></a>
💾 Installation
In your <code>init.el</code>:
<code>elisp
(require 'flymake-ziglint)
(add-hook 'zig-mode-hook 'flymake-ziglint-load)</code>
🛠️ Contribute
<a></a>
<a></a>
<a></a>
<a></a>
If you would like to contribute to this project, you may either
clone and make pull requests to this repository. Or you can
clone the project and establish your own branch of this tool.
Any methods are welcome!
🔬 Development
To run the test locally, you will need the following tools:
<ul>
<li><a>Eask</a></li>
<li><a>Make</a> (optional)</li>
</ul>
Install all dependencies and development dependencies:
<code>sh
eask install-deps --dev</code>
To test the package's installation:
<code>sh
eask package
eask install</code>
To test compilation:
<code>sh
eask compile</code>
<strong>🪧 The following steps are optional, but we recommend you follow these lint results!</strong>
The built-in <code>checkdoc</code> linter:
<code>sh
eask lint checkdoc</code>
The standard <code>package</code> linter:
<code>sh
eask lint package</code>
<em>📝 P.S. For more information, find the Eask manual at https://emacs-eask.github.io/.</em>
⚜️ License
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <a>https://www.gnu.org/licenses/</a>.
See <a><code>LICENSE</code></a> for details. | [] |
https://avatars.githubusercontent.com/u/85748765?v=4 | zig-linear-algebra | johan0A/zig-linear-algebra | 2024-07-17T15:01:46Z | This package is a simple linear algebra library writen entirely in Zig. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/johan0A/zig-linear-algebra/tags | MIT | [
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 79 | false | 2025-04-28T19:13:56Z | true | true | unknown | github | [] | This library is a simple linear algebra library.
This library was written for my own use, and will be extended and optimized as I need it. | [] |
https://avatars.githubusercontent.com/u/364548?v=4 | ptail | siadat/ptail | 2024-03-21T01:33:19Z | view stdout/stderr of a process | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/siadat/ptail/tags | - | [
"cat",
"linux",
"ptrace",
"strace",
"zig"
] | 39 | false | 2024-12-23T09:07:35Z | true | false | unknown | github | [] | ptail
ptail (process tail) is a simple tool for viewing the stdout and stderr of a process.
Think of it as tail -f for the output of other processes.
Usage
There are two ways to use ptail (similar to strace): ptail a new process (with a given program), or ptail an exiting process (with PID).
```bash
new process
./zig-out/bin/ptail PROGRAM [ARGS...]
```
```bash
exiting process
sudo ./zig-out/bin/ptail -p PID
```
When would it be useful?
<ol>
<li>
There are situations in which the stdout and stderr of a process are captured and not shown. For example, <code>zig build test</code> with <a>.test_server_mode</a> captures stdout and stderr of processes and does not show them until the end of tests.
If a test is blocked, nothing is shown and you cannot do printf debugging. You can use the following command to see the output of the tests as they are running:
<code>./zig-out/bin/ptail /usr/bin/bash -c 'zig build test'</code>
</li>
<li>
The process is running in the background and its stdout is either not written to disk, or you don't know where it is. For example, you can inspect what your language server (eg zls) is printing with the following command:
<code>sudo ./zig-out/bin/ptail -p $(ps -C "zls" -o pid= | head -1)</code>
</li>
</ol>
Example
Monitor new process
<code>bash
./zig-out/bin/ptail /usr/bin/bash -c 'ping localhost > /dev/null'</code>
Monitor existing process
```bash
terminal 1
ping localhost > /dev/null
```
```bash
terminal 2
sudo ./zig-out/bin/ptail -p $(ps -C "ping" -o pid= | head -1)
64 bytes from localhost (::1): icmp_seq=1 ttl=64 time=0.058 ms
64 bytes from localhost (::1): icmp_seq=2 ttl=64 time=0.067 ms
...
```
Asciinema
<a></a>
Build
<code>zig build</code>
<ul>
<li>Requires Linux kernel 5.3 or later, but let me know if you need support for older kernels. We just need to bring back the code removed in <a>commit/ceedab19</a> for systems where PTRACE_SYSCALL_INFO_EXIT is not available.</li>
<li>Tested with Zig version 0.12.0-dev.3496+a2df84d0f</li>
</ul>
Test
<code>zig build test</code> | [] |
https://avatars.githubusercontent.com/u/52354694?v=4 | eigen.zig | d-mironov/eigen.zig | 2024-02-20T16:28:26Z | Matrix library written in Zig | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/d-mironov/eigen.zig/tags | MIT | [
"math",
"mathematics",
"matrix",
"matrix-library",
"memory",
"zig",
"ziglang"
] | 16 | false | 2024-11-02T03:24:51Z | true | false | unknown | github | [] | eigen.zig
Matrix/Tensor/etc. library for Zig.
Usage
Creating a Matrix
```zig
// Creating a 0 initialized 2x3 matrix
var zero = try Matrix.init(2, 3, allocator);
// Or if you want a 3x3 square matrix
var zero_square = try Matrix.init_square(3, allocator);
// Creating a Matrix from an array
var m1 = try Matrix.from_array([2][2]f64{
.{1, 2},
.{3, 4},
}, allocator);
``` | [] |
https://avatars.githubusercontent.com/u/24578855?v=4 | zig-md2 | deatil/zig-md2 | 2024-05-17T09:25:02Z | A MD2 hash function library for Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/deatil/zig-md2/tags | Apache-2.0 | [
"md2",
"zig",
"zig-md2"
] | 14 | false | 2025-03-07T11:12:29Z | true | true | 0.14.0-dev.3451+d8d2aa9af | github | [] | Zig-MD2
zig-md2 is a MD2 hash function for Zig.
Env
<ul>
<li>Zig >= 0.14.0-dev.3451+d8d2aa9af</li>
</ul>
Adding zig-md2 as a dependency
Add the dependency to your project:
<code>sh
zig fetch --save=zig-md2 git+https://github.com/deatil/zig-md2#main</code>
or use local path to add dependency at <code>build.zig.zon</code> file
<code>zig
.{
.dependencies = .{
.@"zig-md2" = .{
.path = "./lib/zig-md2",
},
...
},
...
}</code>
And the following to your <code>build.zig</code> file:
<code>zig
const zig_md2_dep = b.dependency("zig-md2", .{});
exe.root_module.addImport("zig-md2", zig_md2_dep.module("zig-md2"));</code>
The <code>zig-md2</code> structure can be imported in your application with:
<code>zig
const zig_md2 = @import("zig-md2");</code>
Get Starting
~~~zig
const std = @import("std");
const MD2 = @import("zig-md2").MD2;
pub fn main() !void {
var out: [16]u8 = undefined;
<code>var h = MD2.init(.{});
h.update("abc");
h.final(out[0..]);
// output: da853b0d3f88d99b30283a69e6ded6bb
std.debug.print("output: {x}\n", .{out});
</code>
}
~~~
LICENSE
<ul>
<li>The library LICENSE is <code>Apache2</code>, using the library need keep the LICENSE.</li>
</ul>
Copyright
<ul>
<li>Copyright deatil(https://github.com/deatil).</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/38167139?v=4 | zernel2 | Jacquwes/zernel2 | 2024-05-19T15:19:23Z | null | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/Jacquwes/zernel2/tags | MIT | [
"kernel",
"limine",
"x86-64",
"zig"
] | 24 | false | 2024-07-24T09:50:04Z | true | true | unknown | github | [
{
"commit": "c94d35f1f116e9e8a7943f30712901760c3d7d96.tar.gz",
"name": "limine-zig",
"tar_url": "https://github.com/limine-bootloader/limine-zig/archive/c94d35f1f116e9e8a7943f30712901760c3d7d96.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/limine-bootloader/limine-zig"
}
] | 404 | [] |
https://avatars.githubusercontent.com/u/47410557?v=4 | eth-experiments | tr1sm0s1n/eth-experiments | 2024-06-15T04:50:35Z | Reference repository for experimenting with Ethereum. | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/tr1sm0s1n/eth-experiments/tags | MIT | [
"alloy",
"ethereum",
"fe",
"geth",
"go",
"go-ethereum",
"golang",
"python",
"reth",
"rust",
"solidity",
"tokio",
"uv",
"vyper",
"web3py",
"zig"
] | 547 | false | 2025-05-13T11:13:14Z | false | false | unknown | github | [] | ETH-Experiments
Reference repository for experimenting with Ethereum. | [] |
https://avatars.githubusercontent.com/u/69104965?v=4 | monkey-zig | doccaico/monkey-zig | 2024-03-16T07:41:09Z | Monkey programming language written in Zig/Ziglang | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/doccaico/monkey-zig/tags | - | [
"zig"
] | 126 | false | 2024-04-02T16:33:29Z | true | false | unknown | github | [] | Monkey (Tested on Windows only)
A Zig/Ziglang version <a>monkey</a> language interpreter. From <a>Write An Interpreter In Go</a>.
Zig version
<code>// 2024/04/01
0.12.0-dev.3496+a2df84d0f</code>
Usage
<code>$ zig run src\main.zig</code>
TODOs
<ul>
<li>[x] Add buildin functions (len, first, last, rest, push, puts).</li>
<li>[x] Add string support.</li>
<li>[x] Add array support.</li>
<li>[x] Add hash support.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/175892156?v=4 | Zig-LLVM | Zag-Research/Zig-LLVM | 2024-04-30T15:51:21Z | Quick guide to compiling LLVM & Zig source files | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/Zag-Research/Zig-LLVM/tags | - | [
"compilation",
"llvm",
"zig"
] | 50,544 | false | 2025-02-15T05:28:47Z | false | false | unknown | github | [] | Compiling
The <code>builder_test</code> folder contains simple functions to test the LLVM IR builder from within Zig.
To execute, you'll need to download LLVM from source and provide the necessary compiler flags
Example of how to execute is shown below (might need to change path to LLVM headers and library files):
```bash
Run from WSL
zig build-exe main.zig -lc++ -I/usr/lib/llvm-14/include -L /usr/lib/llvm-14/lib -lLLVM-14
```
The <code>link_test</code> folder contains simple functions to test linking LLVM IR with a zig file.
To execute:
<code>bash
clang -c add.ll -o add.o
zig build-exe main.zig add.o -femit-bin=main
./main.o</code>
The <code>ll_output_test</code> folder contains a simple .c and .zig file. In
order to link the two together, see the README in that folder | [] |
https://avatars.githubusercontent.com/u/73724137?v=4 | fuckwm | pra1rie/fuckwm | 2024-06-06T22:24:22Z | lil tiling window manager written in Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/pra1rie/fuckwm/tags | - | [
"tiling-window-manager",
"window-manager",
"zig"
] | 34 | false | 2025-05-13T17:58:39Z | true | false | unknown | github | [] | fuckwm
pronounced (fuckum)
i got frustrated that my wm wasn't working properly so i rewrote it in zig (bar not included)
Building
dependencies: zig 0.12.x, Xorg and libc
compile with:
<code>sh
$ make</code>
Installing
<strong>make sure to edit src/config.zig before building</strong>
<code>sh
$ make install</code>
add this to /usr/share/xsessions/fuckwm.desktop:
<code>config
[Desktop Entry]
Encoding=UTF-8
Name=fuckwm
Exec=fuckwm
Type=Application
X-LightDM-DesktopName=fuckwm
X-GNOME_WMName=fuckwm
DesktopNames=fuckwm</code>
Images
because of course i need to show it off
| [] |
https://avatars.githubusercontent.com/u/80766200?v=4 | capy-stl-viewer | Catniped/capy-stl-viewer | 2024-07-19T13:09:27Z | zig/capy app for rendering wireframes of stl files on a capy canvas | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Catniped/capy-stl-viewer/tags | Unlicense | [
"zig"
] | 150 | true | 2024-07-19T13:11:47Z | true | true | unknown | github | [
{
"commit": "35d76a422f84c92a3051595e8b75c1df61e40d50.tar.gz",
"name": "capy",
"tar_url": "https://github.com/capy-ui/capy/archive/35d76a422f84c92a3051595e8b75c1df61e40d50.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/capy-ui/capy"
},
{
"commit": null,
"name": "zmath",... | capy-stl-viewer
little precursor project for my 3d printing slicer written in zig, this is a zig/capy app for rendering wireframes of stl files on a capy canvas.
Usage
<code>zig build run</code>, enter path for stl file (relative to your cwd), press "Set model", use left mouse button + drag to move the camera in x,y, use right mouse button + drag to change the angle of the camera.
Notes
<ul>
<li>thanks to https://gamedev.stackexchange.com/a/25588 for the base projection code</li>
<li>the renderer is not very optimized, and may struggle with large meshes. that is however not its usecase so for now im keeping it simple</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/112776527?v=4 | udp-zig | TheUnderName/udp-zig | 2024-05-08T07:44:35Z | zig-udp-socket | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/TheUnderName/udp-zig/tags | - | [
"socket",
"udp",
"udp-zig",
"udpzig",
"zig",
"zig-udp",
"ziglang",
"zigudp"
] | 0 | false | 2024-05-08T07:56:26Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/45920892?v=4 | AutoEnglish | joeypas/AutoEnglish | 2024-03-05T20:56:06Z | Autocompletion for the English language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/joeypas/AutoEnglish/tags | MIT | [
"autocomplete",
"trie",
"zig"
] | 1,097 | false | 2024-06-22T18:31:31Z | true | false | unknown | github | [] | AutoEnglish
Build a trie using english words and then attempt to autocomplete slices
Usage
``` bash
zig build -Doptimize=ReleaseFast
./zig-out/bin/autoenglish | [] |
https://avatars.githubusercontent.com/u/22280250?v=4 | zigStructPrint | Durobot/zigStructPrint | 2024-03-01T09:52:26Z | Small library to pretty-print Zig structs (and arrays) | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Durobot/zigStructPrint/tags | MIT | [
"zig",
"zig-package",
"ziglang"
] | 14 | false | 2024-10-10T07:01:19Z | true | true | 0.12.0-dev.3097+5c0766b6c | github | [] | zigStructPrint
Small library to pretty-print Zig structs (and arrays)
<strong>zigStructPrint</strong> is licensed under under <a>the MIT License</a> and available from https://github.com/Durobot/zigStructPrint
Please note that only Zig <strong>0.14.0-dev.1421+f87dd43c1</strong> (give or take) and up is supported because of <a>this breaking change</a> in the Zig standard library. If you need zigStructPrint for an earlier version of Zig, get <a>this version</a> instead.
To use, either drop <a>zsp.zig</a> into your project, or, if you prefer Zig package manager:
<ol>
<li>In <code>build.zig.zon</code>, in <code>.dependencies</code>, add</li>
</ol>
<code>zig
.zigStructPrint =
.{
.url = "https://github.com/Durobot/zigStructPrint/archive/<COMMIT HASH, 40 HEX DIGITS>.tar.gz",
.hash = "<ZIG PACKAGE HASH, 68 HEX DIGITS>" // Use arbitrary hash, get correct hash from the error
}</code>
<ol>
<li>In <code>build.zig</code>, in <code>pub fn build</code>, before <code>b.installArtifact(exe);</code>, add</li>
</ol>
<code>zig
const zsp = b.dependency("zigStructPrint",
.{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("zigStructPrint", zsp.module("zigStructPrint"));</code>
Build with <code>zig build</code>, as you normally do.
Actually printing out your struct:
```zig
const zsp = @import("zigStructPrint");
. . .
const MyStruct = struct
{
a: i8 = -10,
b: u32 = 10,
c: [3]u8 = [_]u8 { 1, 2, 3 },
d: [2]Nested = .{ .{ .f = 10.0, .g = "Hello" }, .{ .f = -20.0, .g = "Bye" }, },
e: [3]Color = .{ .red, .green, .yellow },
<code>const Nested = struct { f: f32, g: []const u8 };
const Color = enum { red, yellow, green };
</code>
};
const ms = MyStruct {};
zsp.printStruct(ms, true, 0); // try <code>false</code> to get full type names
```
And the output is:
<code>zig
{
a: i8 = -10
b: u32 = 10
c: [3]u8 = [ 1, 2, 3, ]
d: [2]Nested = [ { f: f32 = 10, g: []const u8 = "Hello", }, { f: f32 = -20, g: []const u8 = "Bye", }, ]
e: [3]Color = [ red, green, yellow, ]
}</code> | [] |
https://avatars.githubusercontent.com/u/6397061?v=4 | zdo | c-phillips/zdo | 2024-06-28T04:01:59Z | CLI Task Manager with Markdown | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/c-phillips/zdo/tags | MIT | [
"cli",
"task-manager",
"todo",
"zig"
] | 172 | false | 2024-10-05T16:31:16Z | true | false | unknown | github | [] |
Cross-platform CLI Task Manager using Markdown
No lock-in, no worries
<blockquote>
⚠ Currently in pre-alpha stage, don't expect this not to crash or break something!
</blockquote>
Install
This project uses Zig 0.13.0 for now. You can get it from <a>here</a>.
To build the executable for use, run
<code>bash
zig build -Drelase=true</code>
Then add it to your system path or <code>bin</code> directory.
In the future, this repository may host prebuilt binaries for easier installation.
How to use it
See all the commands with <code>zdo help</code> or you can get started right away by adding your first task:
<code>bash
zdo add Get better at programming +ci --priority 3</code>
You'll see that a new markdown file was created in a local <code>.tasks</code> directory. It contains a few yaml front-matter items that are useful for tracking with zdo, obsidian, or whatever else you'd like.
```md
priority: 3
status: pending
tags: [ci,]
Get better at programming
```
<blockquote>
✏ Note: The first <code># Heading Level 1</code> line will be used for the task name
</blockquote>
You can edit this file and add whatever you'd like to it. Here's an example task for this very project:
```md
status: done
tags: [todo,]
priority: 0
complete mark command
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Task index registry
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Index specific to each <code>task</code> directory
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Task selection via index registry
Task Index:
The index should assign a unique id number to a filepath.
Indices should NEVER be shuffled: the same path should retain the same index^[0].
Each <code>task</code> directory should retain its own index registry.
Combining registries will prefix the id, e.g. <code>2 -> a2</code>.
Global tasks have a reserved prefix: <code>_2</code>.
[0] Within a relative index registry
```
The <code>.tasks</code> directory is also where all of your task files will live together in anarchy! No wait, you can actually establish a hierarchy and your tasks will be grouped accordingly.
To see all of your tasks just use:
```
~$ zdo list
? ! Task
0 [-] . This is an example task Due 14d ago
1 [x] . complete mark command Anytime
2 [z] . waiting task Starts in 35d
3 [ ] # consider making a cli table system Anytime
4 [ ] # take out the trash Anytime
5 [ ] o Task sorting options Anytime
.- - - - - - - - - - - - - - - - ( another dir )- - - - - - - - - - - - - - - -.
a0 [-] o TitleTitleTitleTitleTitleTitleTitleTitleTitleTi... 16d remaining
a1 [ ] . test note Due 16d ago
{ another dir > deeper }
ad0 [ ] . consider making a cli table system Anytime
ad1 [-] . Task in deeper Due 14d ago
ad2 [z] . waiting task Starts in 35d
{ .. > deeper > deepest }
add0 [z] . waiting task Starts in 35d
{ another dir > dongus }
ado0 [-] . Deengus Task! Due 14d ago
.- - - - - - - - - - - - - - - -( subdirectory )- - - - - - - - - - - - - - - -.
s0 [z] . Another Task Starts in 27d
s1 [x] . handle task creation with start in the future Anytime
s2 [ ] . separate the YAML parsing for task files Anytime
<code>You can also add filters to focus on what's important.</code>
~$ zdo -fd list +:home --sort priority
? ! Task
4 [ ] # take out the trash Anytime
ad1 [-] . Task in deeper Due 14d ago
ado0 [-] . Deengus Task! Due 14d ago
a1 [ ] . test note Due 16d ago
<code>And if you'd like to see a more detailed view of a given task, just use the `view` command. Lets revisit the expanded task file from earlier, which you might have noticed has index 1:</code>
~$ zdo view 1
[x] . complete mark command
Anytime
Tags: {todo}
Note:
# complete mark command
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Task index registry
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Index specific to each <code>task</code> directory
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Task selection via index registry
<code> ## Task Index:
The index should assign a unique id number to a filepath.
If a file is removed, the index number should be freed and available for
reassignment.
Indices should NEVER be shuffled: the same path should retain the same
index^[0].
Each `task` directory should retain its own index registry.
Combining registries will prefix the id, e.g. `2 -> a2`.
Global tasks have a reserved prefix: `_2`.
[0] Within a relative index registry
</code>
``` | [] |
https://avatars.githubusercontent.com/u/163546630?v=4 | docker-zig | zon-dev/docker-zig | 2024-03-10T06:18:26Z | Docker for zig programming language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/zon-dev/docker-zig/tags | MIT | [
"dockerfile",
"dockerlized",
"zig",
"ziglang"
] | 38 | false | 2024-10-13T15:37:27Z | false | false | unknown | github | [] | How To Build and Deploy a Zig application with Docker
Usage
<code>bash
docker build -t ziglang .</code>
<code>bash
docker run -it --rm ziglang</code>
Go to the application directory and use zig in docker to build and run your application. For example. Create a <a>hello-world</a> program and run it with docker.
```bash
echo '
const std = @import("std");
pub fn main() void {
std.debug.print("Hello, world!\n", .{});
}
' > hello.zig
<code>Now, run your `hello-world` program.</code>bash
docker run -it --rm -v $PWD:/opt/app ziglang zig run hello.zig
``` | [] |
https://avatars.githubusercontent.com/u/13009812?v=4 | arkanoid | sytranvn/arkanoid | 2024-03-20T07:58:45Z | Arkanoid game written in zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/sytranvn/arkanoid/tags | GPL-3.0 | [
"raylib",
"zig"
] | 37 | false | 2025-02-20T10:16:34Z | true | true | unknown | github | [
{
"commit": "e0f6faa151589a185a04c2c723c01daff1b0a78f.tar.gz",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/e0f6faa151589a185a04c2c723c01daff1b0a78f.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
},
{
"commit": "refs",
"name": ... | Arkanoid Zig
A Arkanoid game in zig
References
<ul>
<li><a>Raylib Arkanoid C version</a></li>
<li><a>Raylib build for zig</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/86686307?v=4 | TAGe4 | zewenn/TAGe4 | 2024-08-08T07:10:18Z | The Text Adventure Game (Engine) v4 is a real time, cross-platform, console game engine written in zig. | main | 1 | 1 | 0 | 1 | https://api.github.com/repos/zewenn/TAGe4/tags | - | [
"game-engine",
"macos",
"terminal",
"windows",
"zig"
] | 12,162 | false | 2024-08-28T22:31:09Z | true | true | unknown | github | [
{
"commit": null,
"name": "zstbi",
"tar_url": null,
"type": "relative",
"url": "./libs/zstbi"
}
] | <blockquote>
<span class="bg-yellow-100 text-yellow-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-yellow-900 dark:text-yellow-300">WARNING</span>
This project is currently on pause, but I will continue developing it into a full framework when I get to it.
</blockquote>
Text Adventure Game (Engine) v4
This repo contains all the assets for my current Text Adventure Game project. These assets include real-time cross-platform input handling and rendering.
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
This project is - very much - still a work in progress. It currently only supports <strong>Windows</strong> and <strong>MacOS</strong>, altought support for linux based is in the plans.
</blockquote> | [] |
https://avatars.githubusercontent.com/u/86695181?v=4 | pdir | nronzel/pdir | 2024-06-29T19:54:45Z | Pretty print directory structure. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/nronzel/pdir/tags | MIT | [
"directory-listing",
"directory-tree",
"tree",
"zig"
] | 37 | false | 2025-03-13T19:53:49Z | true | true | 0.14.0 | github | [] | pdir
pdir ("pretty directory" or "print directory") is a lightweight, Zig-based
implementation of the Linux tree command. It provides a visual representation
of directory structures, using 📁 icons for directories and 📄 icons for files.
<blockquote>
[!Note]
This is not a 1:1 re-implementation of the <code>tree</code> utilities functionalies.
</blockquote>
Features
<ul>
<li>Customizable directory path and depth</li>
<li>Intuitive visual representation of file system structures</li>
<li>Provides count of directories, files, sym-links, and others</li>
<li>Simple and efficient command-line interface</li>
</ul>
Requirements
Made with <a>Zig</a> v0.14
<blockquote>
<span class="bg-red-100 text-red-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-red-900 dark:text-red-300">CAUTION</span>
This was only tested on Linux. Please open issues if you use the Mac version.
Windows users, you will need to clone the repo and build this yourself.
</blockquote>
Installation
<ol>
<li>Clone the repository:</li>
</ol>
<code>sh
git clone https://github.com/nronzel/pdir
cd pdir</code>
<ol>
<li>Build the binary:</li>
</ol>
<code>sh
zig build -Doptimize=ReleaseSafe</code>
OR
<a>Download the latest release binary</a>
Be sure to add the binary to a directory that is on your <code>$PATH</code>. See <a>quick setup</a>
Usage
<code>sh
pdir [directory] [depth]</code>
<ul>
<li>directory: Optional. Path to the directory you want to visualize. Defaults to
the current working directory.</li>
<li>depth: Optional. Maximum depth of directory traversal. Defaults to 2.</li>
</ul>
With the default depth of 2, it will show the current directory and 1 level of nested directories.
Examples
<code>sh
pdir ~/Documents 3</code>
This command will display the directory structure of ~/Documents up to a depth
of 3 levels.
<code>sh
pdir</code>
This command will display the directory structure of the current working
directory up to a depth of 2 levels.
Quick Setup
To use pdir from anywhere in your terminal:
<ol>
<li>Copy the binary to a directory that is in your PATH:</li>
</ol>
<code>sh
cp ./zig-out/bin/pdir ~/.local/bin/</code>
On Linux, you can view the directories in your path by running:
<code>sh
echo $PATH</code>
Now you can run pdir from any location in your terminal.
Testing
Run the included tests:
<code>sh
zig test src/main.zig</code>
About
This was written for educational reasons get more familiar with Zig. It is not a 1:1 of the Linux
<code>tree</code> command. | [] |
https://avatars.githubusercontent.com/u/25912761?v=4 | zigenity | r4gus/zigenity | 2024-03-03T15:07:13Z | Like zenity but in Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/r4gus/zigenity/tags | MIT | [
"gtk",
"gtk3",
"gui",
"zig",
"zig-package"
] | 39 | false | 2025-05-11T21:44:52Z | true | true | 0.14.0 | github | [
{
"commit": "a1717e0d0758417cc59de63ab0d65592d08a03ff",
"name": "dvui",
"tar_url": "https://github.com/david-vanderson/dvui/archive/a1717e0d0758417cc59de63ab0d65592d08a03ff.tar.gz",
"type": "remote",
"url": "https://github.com/david-vanderson/dvui"
}
] | zigenity
Like <a>zenity</a> but in <a>Zig</a> and only for Linux.
Dialog Types
| Type | Supported |
|:----:|:---------:|
| calendar | |
| entry | |
| error | |
| info | |
| file-selection | |
| list | |
| notification | |
| progress | |
| question | ✅ |
| warning | |
| scale | |
| text-info | |
| color-selection | |
| password | ✅ |
| forms | |
Getting started
Run <code>zigenity --help</code> for a list of options.
This application uses the same return codes and options as <a>zenity</a>, including:
* <code>0</code> - Ok button was pressed
* <code>1</code> - Cancel button was pressed
* <code>5</code> - Timeout (this is only returned when using the <code>--timeout</code> option)
* <code>255</code> - Some other error (e.g., no dialog type has been selected) | [] |
https://avatars.githubusercontent.com/u/112776527?v=4 | zig-binarystream | TheUnderName/zig-binarystream | 2024-04-28T18:14:07Z | zig binarystream | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/TheUnderName/zig-binarystream/tags | - | [
"zig",
"zig-binarystream",
"ziglang"
] | 4 | false | 2024-04-28T18:35:18Z | true | false | unknown | github | [] | # zig-binarystream
This project is not complete but usable | [] |
https://avatars.githubusercontent.com/u/83368141?v=4 | slee | tovedetered/slee | 2024-05-07T13:07:54Z | This is a simple text editor written entirely in Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/tovedetered/slee/tags | MIT | [
"text-editor",
"zig",
"ziglang"
] | 92,397 | false | 2024-10-11T08:34:23Z | true | true | unknown | github | [] | SLEE
A Systems Level Easy Editor
Adapted from https://viewsourcecode.org/snaptoken/kilo into Ziglang
Installation
Download the binary on the releases page then run it
Args specify the file
From Source
Dependencies
<ul>
<li>Ziglang - master branch</li>
</ul>
Steps
<ol>
<li>Download the source code</li>
<li>Run zig build</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/48999343?v=4 | sysexits-zig | sorairolake/sysexits-zig | 2024-05-04T11:55:57Z | The system exit codes as defined by <sysexits.h> for Zig | develop | 0 | 1 | 1 | 1 | https://api.github.com/repos/sorairolake/sysexits-zig/tags | Apache-2.0 | [
"exitcode",
"sysexits",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 99 | false | 2025-05-12T22:03:00Z | true | true | 0.14.0 | github | [] |
sysexits-zig
<a></a>
<strong>sysexits-zig</strong> is a library that provides the system exit code constants as
defined by [<code><sysexits.h></code>].
This library is a port of <a>sysexits-rs</a>.
Usage
Add this package to your <code>build.zig.zon</code>:
<code>sh
zig fetch --save git+https://github.com/sorairolake/sysexits-zig.git</code>
Add the following to your <code>build.zig</code>:
<code>zig
const sysexits = b.dependency("sysexits", .{});
exe.root_module.addImport("sysexits", sysexits.module("sysexits"));</code>
Documentation
To build the documentation:
<code>sh
zig build doc</code>
The result is generated in <code>zig-out/doc/sysexits</code>.
If you want to preview this, run a HTTP server locally. For example:
<code>sh
python -m http.server -d zig-out/doc/sysexits</code>
Then open <code>http://localhost:8000/</code> in your browser.
Zig version
This library is compatible with Zig version 0.14.0.
Source code
The upstream repository is available at
<a>https://github.com/sorairolake/sysexits-zig.git</a>.
The source code is also available at:
<ul>
<li><a>https://gitlab.com/sorairolake/sysexits-zig.git</a></li>
<li><a>https://codeberg.org/sorairolake/sysexits-zig.git</a></li>
</ul>
Changelog
Please see <a>CHANGELOG.adoc</a>.
Contributing
Please see <a>CONTRIBUTING.adoc</a>.
Similar projects
<ul>
<li><a>https://github.com/sorairolake/Sysexits.jl</a> (Julia)</li>
<li><a>https://github.com/sorairolake/sysexits-rs</a> (Rust)</li>
</ul>
You can discover more projects at
<a>https://github.com/sorairolake/awesome-sysexits</a>.
License
Copyright (C) 2023 Shun Sakai (see <a>AUTHORS.adoc</a>)
This library is distributed under the terms of either the <em>Apache License 2.0</em>
or the <em>MIT License</em>.
This project is compliant with version 3.3 of the <a><em>REUSE Specification</em></a>. See
copyright notices of individual files for more details on copyright and
licensing information. | [] |
https://avatars.githubusercontent.com/u/89421445?v=4 | passback | alvaro17f/passback | 2024-07-24T09:14:35Z | A tool to backup your keepass database | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/alvaro17f/passback/tags | MIT | [
"zig"
] | 128 | false | 2025-05-18T09:50:59Z | true | true | 0.14.0 | github | [] | passback
passback is a command line tool for managing NixOS configuration.
<blockquote>
:warning: <strong>Work in Progress</strong>: This project is currently under development. Some features may not be complete and may change in the future.
</blockquote>
Installation
To install passback, you can clone the repository and compile the source code:
<code>sh
git clone https://github.com/alvaro17f/passback.git
cd passback
zig build run</code>
then move the binary to a directory in your PATH:
<code>sh
sudo mv zig-out/bin/passback <PATH></code>
NixOS
Run
To run passback, you can use the following command:
<code>sh
nix run github:alvaro17f/passback#target.x86_64-linux-musl</code>
Flake
Add passback to your flake.nix file:
<code>nix
{
inputs = {
passback.url = "github:alvaro17f/passback";
};
}</code>
then include it in your system configuration:
<code>nix
{ inputs, pkgs, ... }:
{
home.packages = [
inputs.passback.packages.${pkgs.system}.default
];
}</code>
Usage
```sh
PASSBACK - A tool to backup your keepass database
-d : USB devices to backup to
-p : Path to keepass db (default is ~/keepass)
-h, help : Display this help message
-v, version : Display the current version
```
License
passback is distributed under the MIT license. See the LICENSE file for more information. | [] |
https://avatars.githubusercontent.com/u/156404?v=4 | raylib-zig-template | Angluca/raylib-zig-template | 2024-02-15T15:02:13Z | a fairly minimal raylib zig example codebase using the zig package manager | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Angluca/raylib-zig-template/tags | - | [
"raygui",
"raylib",
"zig"
] | 62 | false | 2024-05-10T20:05:05Z | true | true | unknown | github | [
{
"commit": null,
"name": "raylib",
"tar_url": null,
"type": "relative",
"url": "../raylib"
}
] | raylib + raygui ...
```zsh
git clone https://github.com/raysan5/raylib.git
git clone https://github.com/Angluca/raylib-zig-template.git
zig build run
``` | [] |
https://avatars.githubusercontent.com/u/164784529?v=4 | ja3-spoof | bstrdlord/ja3-spoof | 2024-03-28T15:09:29Z | http client for zig that spoofs tls/ssl ja3 | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/bstrdlord/ja3-spoof/tags | - | [
"curl",
"ja3",
"spoof",
"ssl",
"tls",
"zig",
"zig-package"
] | 22 | false | 2024-03-30T01:25:30Z | true | true | unknown | github | [] | TTL/SSL JA3 Spoof
<strong>A curl-based zig http client that can spoof <a>tls/ssl ja3</a></strong>
📦 Installing
1. Install ja3_spoof
<code>zig fetch --save https://github.com/blockkwork/ja3-spoof/archive/refs/tags/[LATEST TAG].tar.gz</code>
Example
<code>zig fetch --save https://github.com/blockkwork/ja3-spoof/archive/refs/tags/0.0.1.tar.gz</code>
2. Add ja3_spoof to build.zig
Add to build.zig
<code>zig
const ja3_spoof = b.dependency("ja3_spoof", .{}).module("ja3_spoof");
exe.root_module.addImport("ja3_spoof", ja3_spoof);</code>
🚀 Examples
Example in ./examples folder
Run with command:
<code>make EXAMPLE</code>
```zig
const client = ja3_spoof.init(.{
.allocator = allocator,
.custom_cookies = "Cookie",
.custom_user_agent = "ja3 spoof",
.custom_ciphers = "AES256-SHA",
}) catch |err| {
std.debug.print("error: {}\n", .{err});
return;
};
const response = client.send("https://tools.scrapfly.io/api/tls") catch |err| {
std.debug.print("error: {}\n", .{err});
return;
};
std.debug.print("status_code: {}\nresponse: {s}\n", .{ response.status_code, response.response });
```
🛡️ Spoofing
To spoof ja3 you need to change .custom_ciphers to any other in Client Options | [] |
https://avatars.githubusercontent.com/u/5955225?v=4 | tasiadb | JamesErrington/tasiadb | 2024-03-05T00:55:12Z | A SQLite-inspired database engine based on a Log-Structed Merge-Tree, written in Zig. | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/JamesErrington/tasiadb/tags | Unlicense | [
"database",
"lsm-tree",
"sql",
"zig"
] | 16 | false | 2024-10-25T08:40:13Z | true | false | unknown | github | [] | A SQLite-inspired database engine written in Zig. | [] |
https://avatars.githubusercontent.com/u/113077588?v=4 | data-structures | avanishd-3/data-structures | 2024-08-01T16:33:14Z | Implementations of various data structures | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/avanishd-3/data-structures/tags | MIT | [
"cplusplus",
"data-structures",
"zig"
] | 67 | false | 2025-03-12T00:54:03Z | false | false | unknown | github | [] | data-structures
Implementations of data structures in various languages.
Currently, all the provided data structures are implemented in C++ and some are implemented in Zig and Rust.
To do
<ol>
<li>Add Catch2 testing to C++ code</li>
<li>Finish implementing all data structures in Zig</li>
<li>Finish implementing all data structures in Rust</li>
</ol>
References
Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2022). Introduction to algorithms. The MIT Press. | [] |
https://avatars.githubusercontent.com/u/64708703?v=4 | cli-game-greed | poypoyan/cli-game-greed | 2024-04-17T17:23:04Z | My comparable implementations of "Greed" CLI game in Python and Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/poypoyan/cli-game-greed/tags | GPL-3.0 | [
"cli",
"cli-game",
"python",
"zig"
] | 39 | false | 2025-03-14T03:38:07Z | false | false | unknown | github | [] | Greed CLI Game
This is an implementation of <a>Greed</a> in Python and Zig. Controls are as follows:
<code>q w e
\|/
a-+-d
/|\
z x c</code>
However, this is editable through <code>CONTROL</code> variable. Also, press <space> to quit, but this is also editable through <code>QUITKEY</code> variable.
Python
At least Python 3.6 is required because of <strong>f-strings</strong>. Required third-party library is <strong>readchar</strong> (for getch/get a keypress). Note that as of writing, readchar only works for Linux and Windows. To install:
<code>console
pip install readchar</code>
Zig
Zig 0.14 is required. Works for Linux and Windows. To compile:
<code>console
zig build-exe -lc greed.zig</code>
License
GPLv3 FTW! | [] |
https://avatars.githubusercontent.com/u/178842306?v=4 | bunny | bunny-ts/bunny | 2024-08-06T15:50:12Z | Blazingly fast framework for Bun | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/bunny-ts/bunny/tags | - | [
"bun",
"express-alternative",
"fast",
"framework",
"oop",
"typescript",
"zig"
] | 243 | false | 2025-05-16T23:35:28Z | false | false | unknown | github | [] | Bunny-ts - blazingly fast framework for <a>Bun</a>.
This is not production ready. I finished development of this project. | [] |
https://avatars.githubusercontent.com/u/163546630?v=4 | zinc-docs | zon-dev/zinc-docs | 2024-03-19T12:44:30Z | Zinc is a high-performance HTTP web framework written in Zig(Ziglang). https://zinc.zon.dev | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/zon-dev/zinc-docs/tags | MIT | [
"documentation",
"zig",
"ziglang"
] | 121 | false | 2025-04-10T07:30:49Z | false | false | unknown | github | [] | zinc-docs
Zinc is a high-performance HTTP web framework written in Zig(Ziglang).
Run the website.
<code>sh
cp example.env .env && docker compose up -d</code> | [] |
https://avatars.githubusercontent.com/u/1906851?v=4 | lizard-midi | jhark/lizard-midi | 2024-05-07T09:39:32Z | A MIDI library for Zig. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/jhark/lizard-midi/tags | ISC | [
"midi",
"zig"
] | 26 | false | 2024-10-06T06:57:12Z | true | true | 0.12.0 | github | [] | lizard-midi
<ul>
<li><code>lizard-midi</code> is a MIDI (1.0) library for Zig.</li>
<li>It has no dependencies other than the underlying platform API.</li>
<li>It currently only supports Windows, wrapping the Windows Multimedia APIs.<ul>
<li>See: https://learn.microsoft.com/en-gb/windows/win32/multimedia/midi-reference</li>
</ul>
</li>
<li>It doesn't support every feature provided by the OS.</li>
<li>It <em>does</em> support sending and receiving MIDI note and CC messages.</li>
<li>It doesn't support SysEx messages.</li>
<li>The API is not stable and will likely change if I add support for other OSs.</li>
</ul>
CLI application
<code>lizard-midi</code> comes with a basic CLI application, which also serves as a usage sample.
```
<blockquote>
lizard-midi-tool help
</blockquote>
Usage:
lizard-midi-tool COMMAND ARGS...
Available commands:
devices
List connected MIDI devices.
connect SOURCE_DEVICE DESTINATION_DEVICE
Connect one MIDI device to another.
monitor DEVICE
Print received MIDI messages to stdout.
arp DEVICE NOTE_LENGTH NOTE_DELAY NOTES...
Play a looping sequence of notes.
help COMMAND
Print help for a command.
Notes:
DEVICE arguments may be a device name or number, see the output of
the <code>devices</code> command.
Times are given in milliseconds (and are not fully reliable since
the current implementation simply sleeps the thread to achieve this).
NOTES are MIDI note numbers in the range [0-127]. Middle C (C4) is 60.
```
Usage
Build system
<code>build.zig.zon</code>:
<code>.dependencies = .{
.@"lizard-midi" = .{
.url = "https://github.com/jhark/lizard-midi/archive/refs/tags/v0.0.0.tar.gz",
.hash = "12206ecbd994ce94bd2758996ab9d065b1ffa299660cd3ddc96b6f2a3ee93d6dbf34",
},
},</code>
..or..
<code>.dependencies = .{
.@"lizard-midi" = .{
.path = "path/to/lizard-midi",
},
},</code>
You can also use <code>zig fetch --save</code> from within your project to add the
dependency to your <code>build.zig.zon</code> file, calculating the hash for you upon
download:
<code>zig fetch --save https://github.com/jhark/lizard-midi/archive/COMMIT_HASH.tar.gz</code>
<code>build.zig</code>:
```
const lizard_midi_dep = b.dependency("lizard-midi", .{
.target = target,
.optimize = optimize,
});
const lizard_midi_module = lizard_midi_dep.module("lizard-midi");
// ...
your_exe.root_module.addImport("lizard-midi", lizard_midi_module);
```
Receiving messages
The most flexible way of handling incoming data is to define an event handler
with a <code>handleEvent</code> method, this will be used as a callback that is called by
another thread whenever data is received or other events occur.
```zig
const lizard_midi = @import("lizard-midi");
const EventHandler = struct {
pub fn handleEvent(
self: *@This(),
device_handle: Handle,
event: Event,
) void {
_ = self;
_ = device_handle;
switch (event) {
.data => |e| {
std.log.info("{}", .{e.msg});
},
else => {},
}
}
};
var input_device = lizard_midi.InputDevice{};
var event_handler = EventHandler{};
try input_device.open(0, &event_handler);
try input_device.start();
```
If you do not wish to deal with a callback and synchronisation, the library
provides some of its own event handlers: <code>InputDevice.StateEventHandler</code> and
<code>InputDevice.QueueEventHandler</code>. If you are writing an application that is
frame-based, one of these may be convenient.
StateEventHandler
This handler exposes a snapshot of MIDI device state (<code>DeviceState</code>) that can be
sampled by your application as needed. For example, you could sample it once per
frame and render it. Using this event handler you will only observe the latest
state of the device when you sample it, and may lose intermediate states that
occur in between samples.
<code>zig
var event_handler = InputDevice.StateEventHandler{};
try input_device.open(0, &event_handler);
try input_device.start();</code>
..later..
<code>zig
event_handler.mutex.lock();
defer event_handler.mutex.unlock();
const channel = &event_handler.state.channels[0];
const pitch_bend = channel.normalisedPitchBend();
const aftertouch = channel.normalisedPressure();
// ...</code>
QueueEventHandler
This handler simply puts events into a fixed-sized queue when they are received.
The queue can be read by the application when convenient (e.g. at the start of a
frame).
As long as the application processes events fast enough, and the queue is large
enough to accommodate any spikes, no events will be missed.
<code>zig
var event_handler = InputDevice.QueueEventHandler{};
try event_handler.init(allocator, 5);
defer event_handler.deinit(allocator);
try input_device.open(0, &event_handler);
try input_device.start();</code>
..later..
<code>zig
while (event_handler.pop()) |msg| {
std.log.info("{}", .{msg});
}</code>
Note that there is some inefficiency here as a mutex is locked for each call
to <code>pop()</code>.
Sending messages
Simply create a <code>Message</code> and pass it to <code>OutputDevice.send</code>.
<code>zig
var device = OutputDevice{};
try device.open(device_index);
try device.send(lizard_midi.Message{
.note_on = .{
.channel = 0,
.key = 60,
.velocity = 100,
},
});</code>
There is currently no way to queue multiple messages and send them with reliable
timing intervals. | [] |
https://avatars.githubusercontent.com/u/434125?v=4 | libadb | ssttevee/libadb | 2024-06-11T21:52:35Z | An embeddable reimplementation of the ADB CLI | trunk | 0 | 1 | 0 | 1 | https://api.github.com/repos/ssttevee/libadb/tags | - | [
"adb",
"android",
"cli",
"screencap",
"screencapture",
"zig"
] | 19 | false | 2024-10-15T16:46:31Z | true | true | 0.13.0 | github | [
{
"commit": "refs",
"name": "libusb",
"tar_url": "https://github.com/ssttevee/zig-libusb/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/ssttevee/zig-libusb"
}
] | libadb
This is an attempt to reimplement the host (and maybe client) side of the <a>Android Debug Bridge</a> such that it may embedded into other programs and be used independently of the official ADB binary. Please see <a>protocol.md</a> for more information about the protocol.
There is currently no actual library or header emitted while the implementation is confirmed to work on a wide range of devices, but it can be imported from other zig programs.
Building
<code>sh
zig build --release=safe</code>
Importing from another zig project
Run this command from your project folder
<code>sh
zig fetch --save https://github.com/ssttevee/libadb/archive/refs/heads/trunk.tar.gz</code>
Then add this snippet to your build.zig file
```zig
const adb = b.dependency("adb", .{
.optimize = optimize,
.target = target,
});
exe.root_module.addImport("adb", adb.module("adb"));
```
Examples
There is currently only one example that simulates running <code>adb exec-out screencap -p</code>.
<code>sh
./zig-out/bin/example_screencap > screencap.png</code>
Additional notes
<ul>
<li>
Openssl is currently required. This dependency will likely be removed as soon as the necessary RSA and TLS operations are shipped in the zig std library.
</li>
<li>
The TCP transport implementation is not currently working due to what seems to be an issue with the zig std library tls client.
</li>
<li>
This library currently only supports single-threaded and single-socket operation. This will most likely only be addressed after ziglang/zig#6025 is fixed.
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/67147685?v=4 | ziframe | Adwaith-Rajesh/ziframe | 2024-06-15T11:18:27Z | A minimal DataFrame library in zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Adwaith-Rajesh/ziframe/tags | MIT | [
"dataframe",
"zig",
"ziglang"
] | 16 | false | 2024-06-18T09:25:43Z | true | true | unknown | github | [
{
"commit": "main.tar.gz",
"name": "bcsv",
"tar_url": "https://codeberg.org/Adwaith-Rajesh/beho-zig-csv/archive/main.tar.gz.tar.gz",
"type": "remote",
"url": "https://codeberg.org/Adwaith-Rajesh/beho-zig-csv"
}
] | Ziframe
A minimal 'DataFrame' library in zig.
In it's current form it can only perform basic operations such as
<ul>
<li>add rows</li>
<li>add columns</li>
<li>read from CSV file</li>
<li>removing rows/cols (using fromDF())</li>
<li>apply a function over the DataFrame</li>
<li>get shape</li>
</ul>
Why
<ul>
<li>It's part of something big.</li>
<li>I wanted a way to read CSV files in zig in a proper way</li>
</ul>
Usage
Building
<ul>
<li><code>build.zig.zon</code></li>
</ul>
<code>zig
.{
...
.dependencies = .{
.ziframe = .{
.url = "https://github.com/Adwaith-Rajesh/ziframe/archive/refs/tags/v0.1.0.tar.gz",
.hash = "you know how to get this :)",
}
}
...
}</code>
<ul>
<li><code>build.zig</code></li>
</ul>
```zig
pub fn build(b: *std.Build) void {
...
<code>const ziframe = b.dependency("ziframe", .{
.optimize = optimize,
.target = target,
});
const your_exe = b.addExecutable(.{
.name = "you_exe",
.root_source_file = b.path("path/to/source_file.zig"),
.target = target,
.optimize = optimize,
});
// add ziframe import
your_exe.root_module.addImport("ziframe", ziframe.module("ziframe"));
...
</code>
}
```
Using Ziframe
<ul>
<li><code>test.csv</code></li>
</ul>
<code>csv
id,marks1,marks2
1,10.23,20.45
2,12.90,33.45
3,46,50</code>
<ul>
<li><code>main.zig</code></li>
</ul>
```zig
const std = @import("std");
const debug = std.debug;
const zf = @import("ziframe");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer gpa.deinit()
<code>const alloc = gpa.allocator();
// The columns of the DataFrame
const DFColumns = struct {
id: u32,
marks1: f64,
marks2: f64,
};
// Create an empty DataFrame
// var df = zf.DataFrame(Columns).init(alloc);
// defer df.deinit();
// read test.csv a create a new DataFrame
var df = try zf.DataFrame(DFColumns).fromCSV(alloc, "./test.csv", .{});
defer df.deinit();
debug.print("CSV file contents\n", .{});
debug.print("{}\n", .{df});
// adding a new row
try df.append(.{ .id = 4, .marks1 = 10, .marks2 = 20 });
debug.print("Add new row\n", .{});
debug.print("{}\n", .{df});
// Create a new DF with id and total marks from 'df'
const TotalDFCols = struct {
id: u32,
total: f64,
};
// function on how to create the new df
const total = struct {
fn in(row: DFColumns) ?TotalDFCols {
return .{
.id = row.id,
.total = row.marks1 + row.marks2,
};
}
}.in;
var total_df = try zf.DataFrame(TotalDFCols).fromDF(alloc, DFColumns, df, total);
defer total_df.deinit();
debug.print("New DataFrame with the total columns\n", .{});
debug.print("{}\n", .{total_df});
// filtering
// filter DataFrame, display only even ids
const filterEven = struct {
fn in(row: TotalDFCols) ?TotalDFCols {
if (row.id % 2 != 0) return null;
return row;
}
}.in;
var even_df = try zf.DataFrame(TotalDFCols).fromDF(alloc, TotalDFCols, total_df, filterEven);
defer even_df.deinit();
debug.print("DataFrame with only even ids\n", .{});
debug.print("{}\n", .{even_df});
// printing the shape and size
debug.print("shape of df: {} size of df: {}\n", .{ df.shape(), df.shape().size() });
debug.print("shape of total_df: {} size of df: {}\n", .{ total_df.shape(), total_df.shape().size() });
debug.print("shape of even_df: {} size of df: {}\n", .{ even_df.shape(), even_df.shape().size() });
// Map Function
// set total = 50 where id = 2
const update = struct {
// pointer to the row
pub fn in(row: *TotalDFCols) !void {
if (row.*.id == 2) {
row.*.total = 50;
}
}
}.in;
try even_df.map(update);
debug.print("\nset total = 50 where id = 2\n", .{});
debug.print("{}\n", .{even_df});
</code>
}
```
<ul>
<li>output</li>
</ul>
<b>Output</b>
```commandline
CSV file contents
index id marks1 marks2
0 1 10.2300000 20.4500000
1 2 12.9000000 33.4500000
2 3 46.0000000 50.0000000
Add new row
index id marks1 marks2
0 1 10.2300000 20.4500000
1 2 12.9000000 33.4500000
2 3 46.0000000 50.0000000
3 4 10.0000000 20.0000000
New DataFrame with the total columns
index id total
0 1 30.6800000
1 2 46.3500000
2 3 96.0000000
3 4 30.0000000
DataFrame with only even ids
index id total
0 2 46.3500000
1 4 30.0000000
shape of df: 4x3 size of df: 12
shape of total_df: 4x2 size of df: 8
shape of even_df: 2x2 size of df: 4
set total = 50 where id = 2
index id total
0 2 50.0000000
1 4 30.0000000
```
More docs in the future - maybe :)
Bye.. | [] |
https://avatars.githubusercontent.com/u/95164144?v=4 | zshogi | usumerican/zshogi | 2024-06-15T04:49:10Z | A simple USI shogi engine implemented in Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/usumerican/zshogi/tags | GPL-3.0 | [
"chess",
"javascript",
"shogi",
"webassembly",
"zig"
] | 588 | false | 2024-08-05T11:52:41Z | true | false | unknown | github | [] | Z Shogi
A simple USI shogi engine implemented in Zig
概要
Z Shogi は、<a>Zig</a> で実装されたシンプルな将棋エンジンです。
USI 対応の将棋 GUI ソフトで利用できる実行可能ファイル、
JavaScript から利用できる WebAssembly 版ライブラリ、
動作確認用の Web アプリを提供しています。
将棋プログラミングについては、<a>やねうら王</a>を参考にしました。
評価関数については、やねうら王の<a>NNUE-K-P-256-32-32用評価関数バイナリその2</a>を使っています。
ライブラリの使い方
<code>npm install zshogi</code>
```js
import { Engine } from 'zshogi';
(async () => {
const engine = await Engine.init();
for (const request of [
'usi',
'setoption name DepthLimit value 5',
'getoption',
'isready',
'usinewgame',
'd',
'go',
'position startpos moves 1g1f',
'd',
'go',
'matsuri',
'd',
'moves',
'checks',
]) {
console.log('> ' + request);
console.log(engine.run(request));
}
})();
```
開発
実行可能ファイルのビルドには、Zig が必要です。
<code>zig build test</code>
<code>zig build --release=fast</code>
<code>./zig-out/bin/zshogi <<EOF
usi
isready
usinewgame
d
moves
go
EOF</code>
合法手生成の性能を計測します。
<code>echo "usi\nisready\nmatsuri\nperft 4" | zig build run --release=fast</code>
WebAssembly 版ライブラリと Web アプリのビルドには、Node.js も必要です。
<code>npm ci</code>
<code>npm run zig:test</code>
<code>npm run zig:wasm</code>
<code>npm run lib</code>
<code>npm run test</code>
<code>npm run build</code>
<code>npm run preview</code> | [] |
https://avatars.githubusercontent.com/u/55388270?v=4 | Zig-FFMPEG | zadockmaloba/Zig-FFMPEG | 2024-06-02T13:26:10Z | A practice repo: rewriting FFMPEG examples in zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/zadockmaloba/Zig-FFMPEG/tags | GPL-3.0 | [
"c",
"ffmpeg",
"zig",
"zig-lang",
"zig-language",
"ziglang"
] | 30 | false | 2024-06-07T17:06:44Z | true | true | unknown | github | [] | EXAMPLES OF CALLING FFMPEG APIs FROM ZIG
NOTE: Requires FFMPEG 7 | [] |
https://avatars.githubusercontent.com/u/146390816?v=4 | cfitsio | allyourcodebase/cfitsio | 2024-07-16T10:22:37Z | Zig build of CFITSIO library. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/allyourcodebase/cfitsio/tags | MIT | [
"cfitsio",
"fits",
"fits-files",
"fits-image",
"fitsio",
"zig",
"zig-lang",
"zig-language",
"zig-library",
"zig-package",
"ziglang"
] | 12 | false | 2024-07-24T11:00:42Z | true | true | 0.13.0 | github | [
{
"commit": "cfitsio4_4_1_20240617.tar.gz",
"name": "cfitsio",
"tar_url": "https://github.com/HEASARC/cfitsio/archive/cfitsio4_4_1_20240617.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/HEASARC/cfitsio"
}
] | cfitsio
<a></a>
<a></a>
Zig build of <a>cfitsio library</a>.
:rocket: Usage
<ul>
<li>Add <code>cfitsio</code> dependency to <code>build.zig.zon</code>.</li>
</ul>
<code>sh
zig fetch --save https://github.com/allyourcodebase/cfitsio/archive/<git_tag_or_commit_hash>.tar.gz</code>
<ul>
<li>Use <code>cfitsio</code> dependency in <code>build.zig</code>.</li>
</ul>
<code>zig
const cfitsio_dep = b.dependency("cfitsio", .{
.target = target,
.optimize = optimize,
});
const cfitsio_mod = cfitsio_dep.module("cfitsio");
<compile>.root_module.addImport("cfitsio", cfitsio_mod);</code>
| [
"https://github.com/allyourcodebase/cfitsio"
] |
https://avatars.githubusercontent.com/u/141743392?v=4 | zinit-xv6-riscv | aryalaadi/zinit-xv6-riscv | 2024-03-09T13:10:33Z | init system for xv6-riscv in zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/aryalaadi/zinit-xv6-riscv/tags | NOASSERTION | [
"init",
"init-system",
"low-level-programming",
"risc-v",
"riscv",
"system-programming",
"unix",
"xv6",
"xv6-extensions",
"xv6-riscv",
"zig"
] | 2 | false | 2024-03-09T14:34:53Z | false | false | unknown | github | [] | zinit: init system for xv6-riscv in zig
to build:
% git clone https://github.com/mit-pdos/xv6-riscv
% mkdir xv6-riscv/zig
% git clone https://aryalaadi/zinit xv6-riscv/zinit
% cd xv6-riscv/zinit
% zig build-obj zinit.zig -target riscv64-linux-gnu -O ReleaseSmall
% riscv64-linux-gnu-ld -o init zinit.o ../user/initcode.o ../user/printf.o ../user/ulib.o ../user/usys.o -T ../user/user.ld
to install and run:
% cd ../
% ./mkfs/mkfs fs.img README init user/_sh user/_cat user/_ls ...
% qemu-system-riscv64 --machine virt -bios none -kernel kernel/kernel -m 128 \
-nographic -global virtio-mmio.force-legacy=false -drive \
file=fs.img,if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | md4zig | fjebaker/md4zig | 2024-05-06T18:46:27Z | Zig wrapper around md4c for parsing Markdown. | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/fjebaker/md4zig/tags | MIT | [
"markdown",
"md4c",
"parser",
"zig"
] | 19 | false | 2025-05-12T21:37:03Z | true | true | unknown | github | [
{
"commit": "master.tar.gz",
"name": "md4c",
"tar_url": "https://github.com/fjebaker/md4c-zig/archive/master.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/fjebaker/md4c-zig"
}
] | md4zig
A Zig wrapper around <a>md4c</a> for parsing Markdown.
Exposes a single function that puts a parser type together from comptime-known Zig functions. The parses itself also exposes only a single <code>parse</code> function. The generalisation to using vtables is left as an exercise to the user.
Usage
```zig
const std = @import("std");
const md4zig = @import("md4zig");
const MD4CParser = md4zig.MD4CParser;
const BlockInfo = md4zig.BlockInfo;
const SpanInfo = md4zig.SpanInfo;
const Text = md4zig.Text;
const Impl = struct {
pub fn enterBlock(<em>: <em>Impl, block: BlockInfo) !void {
std.debug.print(">> {any}\n", .{block});
}
pub fn leaveBlock(_: </em>Impl, block: BlockInfo) !void {
std.debug.print("<< {any}\n", .{block});
}
pub fn enterSpan(</em>: <em>Impl, span: SpanInfo) !void {
std.debug.print(">> {any}\n", .{span});
}
pub fn leaveSpan(_: </em>Impl, span: SpanInfo) !void {
std.debug.print("<< {any}\n", .{span});
}
pub fn textCallback(_: *Impl, text: Text) !void {
std.debug.print(" {any}\n", .{text});
}
};
pub fn main() !void {
var impl: TestImpl = .{};
var parser = MD4CParser(TestImpl).init(.{});
try parser.parse(&impl, "# Hello World\nHow are <em>you</em>!");
}
```
This will then output something like:
```
<blockquote>
<blockquote>
main.BlockInfo{ .doc = void }
main.BlockInfo{ .h = main.BlockInfo.BlockInfo__struct_7319{ .level = 1 } }
main.Text{ .text = { 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100 }, .text_type = main.TextType.normal }
<< main.BlockInfo{ .h = main.BlockInfo.BlockInfo__struct_7319{ .level = 1 } }
main.BlockInfo{ .p = void }
main.Text{ .text = { 72, 111, 119, 32, 97, 114, 101, 32 }, .text_type = main.TextType.normal }
main.SpanInfo{ .em = void }
main.Text{ .text = { 121, 111, 117 }, .text_type = main.TextType.normal }
<< main.SpanInfo{ .em = void }
main.Text{ .text = { 33 }, .text_type = main.TextType.normal }
<< main.BlockInfo{ .p = void }
<< main.BlockInfo{ .doc = void }
```
</blockquote>
</blockquote>
Including in a project
Use the Zig package manager
<code>bash
zig fetch --save=md4zig https://github.com/fjebaker/md4zig/archive/master.tar.gz</code>
Then include the module in your <code>build.zig</code> for your target:
```zig
const md4zig = b.dependency(
"md4zig",
.{ .optimize = optimize, .target = target },
).module("md4zig");
// ...
exe.root_module.addImport("md4zig", md4zig);
``` | [] |
https://avatars.githubusercontent.com/u/15256430?v=4 | zig_learning | OSX-RSPlug-a/zig_learning | 2024-04-08T12:05:37Z | Repository to centralize all my zig path of learning | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/OSX-RSPlug-a/zig_learning/tags | - | [
"zig",
"ziglang"
] | 1 | false | 2024-04-09T00:54:51Z | false | false | unknown | github | [] | Running zig codes
<code> zig run main.zig
</code>
If you are running testing codes:
<code> zig test test.zig
</code> | [] |
https://avatars.githubusercontent.com/u/166935164?v=4 | firefly-zig | firefly-zero/firefly-zig | 2024-07-22T09:07:20Z | ⚡️ Zig SDK for making Firefly Zero games | main | 1 | 1 | 1 | 1 | https://api.github.com/repos/firefly-zero/firefly-zig/tags | NOASSERTION | [
"firefly-zero",
"framework",
"gamedev",
"graphics",
"rendering",
"sdk",
"wasm",
"webassembly",
"zig"
] | 62 | false | 2025-05-19T19:27:30Z | true | true | unknown | github | [] | ⚡️ firefly-zig
<a>Zig</a> SDK for making <a>Firefly Zero</a> games.
<ul>
<li><a>▶️ getting started</a></li>
<li><a>🐙 github</a></li>
</ul>
License
MIT License. You can do whatever you want with the SDK, modify it, embed into any apps and games. Have fun! | [] |
https://avatars.githubusercontent.com/u/18282288?v=4 | wdnas-exporter | Strum355/wdnas-exporter | 2024-06-01T15:18:39Z | Prometheus exporter for Western Digital DL2100/DL4100/PR2100/PR4100 NAS's PMC/BBC chips. Based on Michael Roland's documentation https://github.com/michaelroland/wdnas-hwdaemon/blob/master/doc/pmc-protocol.md | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Strum355/wdnas-exporter/tags | - | [
"prometheus-exporter",
"serial",
"zig"
] | 4 | false | 2024-06-02T19:36:12Z | true | true | 0.12.0 | github | [
{
"commit": "ee92e0a6feca8b831fea9657dcf69a79af35a07c.tar.gz",
"name": "httpz",
"tar_url": "https://github.com/karlseguin/http.zig/archive/ee92e0a6feca8b831fea9657dcf69a79af35a07c.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/karlseguin/http.zig"
},
{
"commit": "9c22c7c07b... | 404 | [] |
https://avatars.githubusercontent.com/u/59705845?v=4 | zig-notes | ok-ryoko/zig-notes | 2024-04-01T23:55:50Z | Ryoko's digital garden for Zig | main | 2 | 1 | 0 | 1 | https://api.github.com/repos/ok-ryoko/zig-notes/tags | CC0-1.0 | [
"notes",
"zig"
] | 39 | false | 2024-11-14T01:56:19Z | false | false | unknown | github | [] | Ryoko’s Zig Notes
This is <a>Ryoko</a>’s <a>digital garden</a> for v0.12.0 of the <a>Zig programming language</a>.
The <a>notes</a> aspire to Andy Matuschak’s concept of <a>evergreen notes</a> and are synthesized primarily from:
<ul>
<li>the <a>language reference</a>;</li>
<li>the <a>language source code</a> (mostly <em>Sema.zig</em> and test cases);</li>
<li>discussion surrounding <a>language issues</a>, and</li>
<li>first-hand experience writing Zig.</li>
</ul>
The notes are a work in progress and may contain inconsistencies and errors.
Scope
Ryoko hopes to cover all aspects of the Zig programming language in time. So far, she has written about <a>pointers</a>.
Contributions
Because these are Ryoko’s personal notes that represent her evolving mental model of Zig, she’s not accepting pull requests. (She can’t learn effectively from notes she didn’t write on her own.) However, she welcomes <a>issues</a> describing suggestions and pointing out errors.
Licenses
All original written work is marked with <a>CC0 1.0 Universal</a> and all Zig source code is provided under the <a>MIT license</a>. | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | wayland.zig | tiawl/wayland.zig | 2024-02-28T20:54:45Z | wayland headers packaged for @ziglang | trunk | 0 | 1 | 1 | 1 | https://api.github.com/repos/tiawl/wayland.zig/tags | Unlicense | [
"binding",
"spaceporn",
"wayland",
"wayland-protocol",
"zig",
"zig-package",
"ziglang"
] | 397 | false | 2025-05-09T12:11:20Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
}
] | wayland.zig
This is a fork of <a>hexops/wayland-headers</a> which itself gather various <a>Wayland</a> headers <a>GLFW</a> needs.
Why this forkception ?
The intention under this fork is the same as <a>hexops</a> had when they opened their repository: gather <a>Wayland</a> headers and package them to compile <a>GLFW</a> with <a>Zig</a>.
However this repository has subtle differences for maintainability tasks:
* No shell scripting,
* A cron runs every day to check <a>Wayland</a> repositories. Then it updates this repository if a new release is available.
How to use it
The current usage of this repository is centered around <a>tiawl/glfw.zig</a> compilation. But you could use it for your own projects. Headers are here and there are no planned evolution to modify them. See <a>tiawl/glfw.zig</a> to see how you can use it. Maybe for your own need, some headers are missing. If it happens, open an issue: this repository is open to potential usage evolution.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>wayland/wayland</a>
* <a>wayland/wayland-protocols</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/glfw.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>wayland/wayland</a>
* <a>wayland/wayland-protocols</a>
* <a>tiawl/toolbox</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/5676771?v=4 | dockerfiles | tangowithfoxtrot/dockerfiles | 2024-02-26T10:46:43Z | Assorted dockerfiles that I use. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/tangowithfoxtrot/dockerfiles/tags | GPL-3.0 | [
"cli",
"docker",
"helix",
"zig"
] | 77 | false | 2025-03-05T16:25:42Z | false | false | unknown | github | [] | dockerfiles | [] |
https://avatars.githubusercontent.com/u/34946442?v=4 | llvm-jit-zig | cryptocode/llvm-jit-zig | 2024-07-13T17:13:16Z | LLVM ORCv2 jit example in Zig (without using any Zig bindings) | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/cryptocode/llvm-jit-zig/tags | MIT | [
"jit",
"llvm",
"zig"
] | 3 | false | 2024-12-28T00:54:59Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/119697612?v=4 | zdt | pierrelgol/zdt | 2024-03-10T17:09:59Z | Various implementation of Data structures in Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/pierrelgol/zdt/tags | MIT | [
"data-structures",
"zig",
"zig-library"
] | 40 | false | 2025-04-26T14:07:42Z | true | true | 0.14.0 | github | [] | Zig Data Structure :
This repository is made to implement and explore various data structure implementation in the Zig programmin language | [] |
https://avatars.githubusercontent.com/u/75485188?v=4 | zig-slurm | tazend/zig-slurm | 2024-02-16T21:12:49Z | Zig bindings for Slurm | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/tazend/zig-slurm/tags | GPL-3.0 | [
"cluster",
"hpc",
"hpc-cluster",
"slurm",
"slurm-job-scheduler",
"slurm-workload-manager",
"zig",
"ziglang"
] | 168 | false | 2025-05-16T22:20:43Z | true | true | unknown | github | [] | zig-slurm
Ziggified bindings for <a>Slurm</a>.
This is still very work-in-progress. | [] |
https://avatars.githubusercontent.com/u/85372264?v=4 | zstd.zig | Syndica/zstd.zig | 2024-03-21T16:09:03Z | Zig binding of Z Standard | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Syndica/zstd.zig/tags | MIT | [
"zig",
"zig-package"
] | 513 | true | 2024-11-08T12:27:37Z | true | true | unknown | github | [
{
"commit": "794ea1b0afca0f020f4e57b6732332231fb23c70.tar.gz",
"name": "zstd",
"tar_url": "https://github.com/facebook/zstd/archive/794ea1b0afca0f020f4e57b6732332231fb23c70.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/facebook/zstd"
}
] | zstd.zig
Zig binding of Z Standard based on <em><code>v1.5.2</code></em>
how to import
in your <code>build.zig</code>:
```zig
pub fn build(b: *std.Build) void {
// ...
<code>const zstd_dep = b.dependency("zstd", opts);
const zstd_mod = zstd_dep.module("zstd");
const zstd_c_lib = zstd_dep.artifact("zstd");
const exec = ...
// link it
exec.addModule("zstd", zstd_mod);
exec.linkLibrary(zstd_c_lib);
// ...
</code>
}
```
usage
```zig
const ZstdReader = @import("zstd").Reader;
...
pub fn main() {
const path = ...
<code>const file = try std.fs.cwd().openFile(path, .{});
defer file.close();
const file_stat = try file.stat();
const file_size: u64 = @intCast(file_stat.size);
var memory = try std.os.mmap(
null,
file_size,
std.os.PROT.READ,
std.os.MAP.PRIVATE,
file.handle,
0,
);
var decompressed_stream = try ZstdReader.init(memory);
var reader = decompressed_stream.reader();
...
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | tempora | bcrist/tempora | 2024-03-09T02:04:51Z | Simple Zig Dates/Times/Timezones | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/bcrist/tempora/tags | MIT | [
"calendar",
"date",
"datetime",
"time",
"tz",
"tzdata",
"tzinfo",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 358 | false | 2025-02-14T02:25:44Z | true | true | 0.14.0-dev.3217+5b9b5e45c | github | [] | Tempora
Simple Zig Dates/Times/Timezones
Features
<ul>
<li>Efficient storage (32b <code>Time</code>, 32b <code>Date</code>, 64b <code>Date_Time</code>)</li>
<li>Composition and decomposition (year, ordinal day/week, month, day, weekday, hour, minute, second, ms)</li>
<li>Add/subtract days/hours/minutes/seconds/ms</li>
<li>Advance to the next weekday/day/ordinal day</li>
<li>Convert to/from unix timestamps</li>
<li>Embedded IANA timezone database and modified version of <a>zig-tzif</a> (adds about 200k to binary size when used)</li>
<li>Query current timezone on both unix and Windows systems</li>
<li>Moment.js style formatting and parsing (through <code>std.fmt</code>)</li>
</ul>
Limitations
<ul>
<li>It's not possible to store most "out of bounds" dates/times (e.g. Jan 32).</li>
<li>Localized month and weekday names are not supported; only English.</li>
<li>Non-Gregorian calendars are not supported.</li>
<li>Date/time values directly correspond to timestamps, so accurate durations that take leap seconds into account are not possible (but leap seconds are being abolished in 2035 anyway).</li>
<li>I am certain that there are more optimized algorithms for timestamp <--> calendar conversions (but performance should be fine for all but the most demanding use cases).</li>
</ul> | [
"https://github.com/bcrist/shittip"
] |
https://avatars.githubusercontent.com/u/16764864?v=4 | zigpokerhands | andy5995/zigpokerhands | 2024-03-12T07:04:23Z | A program that uses zigdeck to evaluate five cards to determine if it matches a poker hand | trunk | 1 | 1 | 0 | 1 | https://api.github.com/repos/andy5995/zigpokerhands/tags | MIT | [
"cards",
"mit-license",
"poker",
"simulations",
"zig",
"zig-package"
] | 36 | false | 2025-03-18T11:36:45Z | true | true | unknown | github | [
{
"commit": "master",
"name": "zigdeck",
"tar_url": "https://github.com/andy5995/zigdeck/releases/download/v0.1.0/zigdeck-0.1.0.tar.gz/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/andy5995/zigdeck/releases/download/v0.1.0/zigdeck-0.1.0.tar.gz"
}
] | <a></a>
zigpokerhands
A program that uses <a>zigdeck</a> to evaluate
five cards to determine if it matches a poker hand
Output examples
```
Evaluating 1000000 hands...
<code> Pair: 421692
TwoPair: 47047
ThreeOfAKind: 20578
Straight: 4090
Flush: 2514
FullHouse: 1450
FourOfAKind: 244
StraightFlush: 18
RoyalFlush: 1
</code>
```
```
Evaluating 1000000 hands...
<code> Pair: 421887
TwoPair: 47001
ThreeOfAKind: 20558
Straight: 4168
Flush: 2511
FullHouse: 1378
FourOfAKind: 225
StraightFlush: 21
RoyalFlush: 0
</code>
```
```
Evaluating 1000000 hands...
<code> Pair: 420623
TwoPair: 47240
ThreeOfAKind: 20832
Straight: 4136
Flush: 2587
FullHouse: 1391
FourOfAKind: 252
StraightFlush: 19
RoyalFlush: 2
</code>
``` | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | zig-imgui-implot-template | fjebaker/zig-imgui-implot-template | 2024-05-28T11:36:01Z | A template for a Zig Mach with ImGui and ImPlot. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/fjebaker/zig-imgui-implot-template/tags | - | [
"gui",
"imgui",
"implot",
"mach",
"zig"
] | 4 | false | 2024-11-19T00:36:40Z | true | true | unknown | github | [
{
"commit": null,
"name": "mach",
"tar_url": null,
"type": "remote",
"url": "https://pkg.machengine.org/mach/279290bbf2f1adab0af00323280a07d6bfff47a5.tar.gz"
},
{
"commit": "0e06e09cf3f80882e2967a6f22e2484c3c651310.tar.gz",
"name": "zig_imgui",
"tar_url": "https://github.com/fjeb... | Zig ImGui with ImPlot and Mach Template
Uses <a>fjebaker/zig-imgui-implot</a>.
<strong>Requires 0.12.0-dev.3180+83e578a18</strong>
Build and run
<code>bash
zig build run</code> | [] |
https://avatars.githubusercontent.com/u/717754?v=4 | zhip8 | HRuivo/zhip8 | 2024-07-30T22:10:13Z | Chip-8 Emulator in Zig and SDL2. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/HRuivo/zhip8/tags | MIT | [
"chip8",
"emulation",
"low-level-programming",
"sdl2",
"zig"
] | 51 | false | 2024-09-22T23:07:54Z | true | true | unknown | github | [] | zhip8
Chip-8 Emulator in Zig and SDL2.
Status
Installation
From Source
Building Zhip8 from source is done with zig build.
<code>bash
git clone https://github.com/HRuivo/zhip8
cd zhip8
zig build</code>
Running
Run with a ROM to be loading into memory.
<code>bash
zig build run -- <ROM_NAME>
zig build run -- TETRIS</code>
TODO
<ul>
<li>Error handling</li>
<li>Stack Overflow handling</li>
<li>Graphics Abstraction Layer</li>
<li>Input handling</li>
<li>Testing</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/62223917?v=4 | zig-build-utils | burlindw/zig-build-utils | 2024-08-06T03:48:19Z | A collection of common utilities for Zig build scripts inspired by the build scripts used by Zig and ZLS. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/burlindw/zig-build-utils/tags | MIT | [
"zig",
"zig-package",
"zig-tools"
] | 22 | false | 2025-01-20T01:43:07Z | true | true | unknown | github | [] | zig-build-utils
A collection of common utilities for Zig build scripts inspired by the build
scripts used by <a>Zig</a> and <a>ZLS</a>.
How to use
Run the following command from a project's root to add <code>zig-build-utils</code> as
as dependency:
<code>sh
zig fetch --save git+https://github.com/burlindw/zig-build-utils.git</code>
Import <code>build-utils</code> in <code>build.zig</code>. It is not necessary to call <code>std.Build.dependency()</code>
as there are no exported modules or artifacts.
```zig
const std = @import("std");
const utils = @import("build-utils");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
<code>// Get the project version using a combination of the 'build.zig.zon'
// manifest file, the git history, and git tags.
const version = utils.getBuildVersion(b);
const exe = b.addExecutable(.{
.name = "example",
.target = target,
.optimize = optimize,
.version = version,
.root_source_file = b.path("src/main.zig"),
});
b.installArtifact(exe);
// Compress the binary (and any associated pdb, h, or lib files) into
// a zip file or tarball (depending on the target) and install it in the
// prefix directory. The subdirectory within the prefix directory and
// the layout within the archive are both configurable.
utils.installArchivedArtifact(exe, .{});
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/24578855?v=4 | zig-sm3 | deatil/zig-sm3 | 2024-07-25T03:20:24Z | A SM3 hash function for Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/deatil/zig-sm3/tags | Apache-2.0 | [
"sm3",
"zig",
"zig-sm3"
] | 14 | false | 2025-03-07T11:13:55Z | true | true | 0.14.0-dev.3451+d8d2aa9af | github | [] | Zig-SM3
zig-sm3 is a SM3 hash function for Zig.
Env
<ul>
<li>Zig >= 0.14.0-dev.3451+d8d2aa9af</li>
</ul>
Adding zig-sm3 as a dependency
Add the dependency to your project:
<code>sh
zig fetch --save=zig-sm3 git+https://github.com/deatil/zig-sm3#main</code>
or use local path to add dependency at <code>build.zig.zon</code> file
<code>zig
.{
.dependencies = .{
.@"zig-sm3" = .{
.path = "./lib/zig-sm3",
},
...
},
...
}</code>
And the following to your <code>build.zig</code> file:
<code>zig
const zig_sm3_dep = b.dependency("zig-sm3", .{});
exe.root_module.addImport("zig-sm3", zig_sm3_dep.module("zig-sm3"));</code>
The <code>zig-sm3</code> structure can be imported in your application with:
<code>zig
const zig_sm3 = @import("zig-sm3");</code>
Get Starting
~~~zig
const std = @import("std");
const SM3 = @import("zig-sm3").SM3;
pub fn main() !void {
var out: [32]u8 = undefined;
<code>var h = SM3.init(.{});
h.update("abc");
h.final(out[0..]);
// output: 66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0
std.debug.print("output: {x}\n", .{out});
</code>
}
~~~
LICENSE
<ul>
<li>The library LICENSE is <code>Apache2</code>, using the library need keep the LICENSE.</li>
</ul>
Copyright
<ul>
<li>Copyright deatil(https://github.com/deatil).</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/24541288?v=4 | infinite-program | Sekky61/infinite-program | 2024-03-25T13:28:41Z | A FUSE based file system | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Sekky61/infinite-program/tags | MIT | [
"fs",
"fuse",
"zig"
] | 117 | false | 2024-09-04T19:36:48Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/8228965?v=4 | zgsl | tatjam/zgsl | 2024-07-30T13:13:13Z | GNU Scientific Library (GSL) multi-platform build and wrapper for Zig | master | 1 | 1 | 0 | 1 | https://api.github.com/repos/tatjam/zgsl/tags | NOASSERTION | [
"gsl",
"mathematics",
"zig"
] | 235 | false | 2024-09-03T12:36:53Z | true | true | unknown | github | [
{
"commit": null,
"name": "gsl",
"tar_url": null,
"type": "remote",
"url": "https://ftp.gnu.org/gnu/gsl/gsl-2.8.tar.gz"
}
] | State of the wrapper
I will slowly build the wrapper as I need different functions in my use cases. If you want to contribute
a wrapper, feel free to do so by creating a Pull Request! On the same way, if you want to request a
wrapper feel free to create an Issue.
Check below for the list of stuff that has been wrapped!
Usage
With Zig
Usage with Zig is as simple as adding a dependency to your <code>build.zig.zon</code>:
<code>Zig
.dependencies = .{
.zgsl = .{
.url = "TO BE SPECIFIED",
.hash = "TO BE SPECIFIED",
}
},</code>
and including the dependency as needed in your <code>build.zig</code>:
```Zig
const zgsl = b.dependency("zgsl", .{
.target = target,
.optimize = optimize
});
// ... for example, if you generate an executable ...
const gsl_lib = zgsl.artifact("gsl");
exe.linkLibrary(gsl_lib);
exe.linkLibC();
exe.step.dependOn(&zgsl.namedWriteFiles("gsl_include").step);
```
Afterwards, depending on whether you want to use the wrapper or the raw functions (or both):
Using the wrapper
To use the Zig wrapper, you will use the module:
<code>Zig
exe.root_module.addImport("zgsl", zgsl.module("wrapper"));
exe.step.dependOn(&zgsl.builder.top_level_steps.get("wrap").?.step);</code>
The second line guarantees wrappers are generated, as otherwise you would have to manually run
<code>zig build wrap</code> on the downloaded dependency.
Now you have access to the wrapper under the name <code>zgsl</code>. For example, to compute a Bessel function:
```Zig
const sf = @import("zgsl").sf;
...
const result = try sf.bessel.J0_e(5.0);
std.debug.print("Bessel J0(5.0) = {}, error = {}\n", .{result.val, result.err});
```
To learn more about the wrapper, check the tests contained in <code>src/test</code>, usage should be intuitive
coming from using the GSL library in C or other languages.
<strong>It's heavily recommended</strong> that you disable the default GSL error handler, as otherwise Zig errors
will almost never be useful (GSL will panic before you can handle the errors). To do so use the
function:
<code>Zig
const gsl = @import("zgsl")
//...
gsl.set_error_handler_off();</code>
Using the "raw" C library
In this case you also have to include the GSL header files and link with the
library, which can be done as follows:
<code>Zig
exe.addIncludePath(zgsl.namedWriteFiles("gsl_include").getDirectory().path(b, "include"));</code>
Now you can directly call the GSL. The same example as before would be implemented as follows:
```Zig
const gsl = @cImport({
@cInclude("gsl/gsl_sf_bessel.h");
@cInclude("gsl/gsl_errno.h");
});
...
var result_raw: gsl.gsl_sf_result = undefined;
const err = gsl.gsl_sf_bessel_J0_e(5.0, @ptrCast(&result_raw));
if(err != gsl.GSL_SUCCESS) {
return error.GSL;
}
std.debug.print("Raw Bessel J0(5.0) = {}, error bound = {}\n", .{result_raw.val, result_raw.err});
```
The convenience of the wrapper, which exploits Zig's errors, should have become evident.
With C / other languages
The wrapper cannot be used on C, but the building of the GSL is straightforward (and
multiplatform). Simply run <code>zig build</code> and use the files generated in <code>zig-out</code> (static library
and header files) as you typically would.
Wrapper status
(Unwrapped functions may be used directly from the C library, without the comfort of Zig of course!)
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Mathematical functions
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Polynomials
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Special functions
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Vectors and Matrices
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Permutations
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Combinations
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Multisets
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Sorting
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> BLAS Support
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Linear Algebra
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Eigensystems
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> FFTs
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Numerical Integration
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> RNG
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Statistics
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Running Statistics
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Moving Window Statistics
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Digital Filtering
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Histograms
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> N-tuples
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Monte Carlo Integration
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Simulated Annealing
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> ODEs
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Interpolation
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Numerical differentiation
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Chebyshev approximations
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Series acceleration
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Wavelet transforms
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Discrete hankel transforms
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 1D root finding
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> 1D minimization
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> nD root finding
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> nD minimization
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Linear least squares
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Nonlinear least squares
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Basis splines
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Sparse matrices
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Sparse BLAS
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Sparse Linear Algebra
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Physical constants
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> IEEE floating point arithmetic | [] |
https://avatars.githubusercontent.com/u/80427016?v=4 | zigada | alperencantez/zigada | 2024-04-16T19:26:26Z | 🔗 Unofficial Zig bindings for Ada URL Parser | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/alperencantez/zigada/tags | - | [
"url-parser",
"whatwg",
"zig"
] | 202 | false | 2024-12-01T01:26:44Z | true | false | unknown | github | [] | Zigada - Zig bindings for Ada URL Parser
This repository contains bindings to the <code>Ada</code> library, implemented in the Zig programming language. The primary purpose of this project was to learn and explore Zig, so please be aware that the parser may contain bugs or unhandled edge cases.
Purpose
While this parser offers basic functionality, it is not intended for production use. It serves as an educational tool and a stepping stone for further exploration of Zig.
Features
<ul>
<li><strong>Bindings to AdaURL</strong>: The parser interfaces with the <code>Ada</code> library to handle URL parsing.</li>
<li><strong>Learning-Oriented</strong>: This project was developed to understand Zig's syntax, semantics, and performance characteristics.</li>
</ul>
Usage
To use the parser, simply clone the repository and build it using Zig. Keep in mind that this is an experimental project, so the implementation may not cover all possible URL scenarios.
<code>bash
cd zigada
zig build</code>
Notes
<ul>
<li>Bugs and Issues: Due to the educational nature of this project, there may be bugs or incomplete features. Contributions and suggestions are welcome but be aware that this project is primarily for learning purposes.</li>
<li>Further Exploration: Feel free to fork this repository and extend its functionality as you dive deeper into Zig.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/38167139?v=4 | Zip-8 | Jacquwes/Zip-8 | 2024-04-10T20:08:57Z | Implementing the CHIP-8 using Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Jacquwes/Zip-8/tags | MIT | [
"chip8",
"emulator",
"zig"
] | 105 | false | 2025-01-27T14:19:54Z | true | true | 0.13.0 | github | [
{
"commit": "master",
"name": "raylib-zig",
"tar_url": "https://github.com/Not-Nik/raylib-zig/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/Not-Nik/raylib-zig"
}
] | Zip-8
Quick Chip-8 emulator written in Zig 0.13.0
To build, use <code>zig build</code> and run with <code>./zig-out/bin/zip-8 relative/path/to/rom</code> or <code>zig build run -- relative/path/to/rom</code>
Keys are mapped 1:1 to the Chip-8 keypad (eg: a=a, b=b, 1=1, 2=2, etc)
Left to implement:
- Sound | [] |
https://avatars.githubusercontent.com/u/24779436?v=4 | zig-fsrs | egegungordu/zig-fsrs | 2024-07-07T18:23:37Z | Zig implementation of FSRS | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/egegungordu/zig-fsrs/tags | MIT | [
"fsrs",
"spaced-repetition-algorithm",
"zig",
"zig-library",
"zig-package"
] | 32 | false | 2024-07-15T18:28:52Z | true | true | 0.13.0 | github | [
{
"commit": "dff7681c30c655b7b30a4af08abf6a7f98de975f",
"name": "vaxis",
"tar_url": "https://github.com/rockorager/libvaxis/archive/dff7681c30c655b7b30a4af08abf6a7f98de975f.tar.gz",
"type": "remote",
"url": "https://github.com/rockorager/libvaxis"
}
] | zig-fsrs
This is an implementation of <a>FSRS-4.5</a> in Zig.
This project is on zig 0.13.0
```zig
const std = @import("std");
const fsrs = @import("zig-fsrs");
const Card = fsrs.Card;
pub fn main() !void {
var f = fsrs.FSRS.init(.{});
const initial_card = fsrs.Card.init();
var now = std.time.timestamp();
<code>// schedule the initial card
var s = f.schedule(initial_card, now);
// good was selected on new card
const updated_card = s.select(.Good).card;
std.debug.print("initial card:\n{}\n\n", .{initial_card});
std.debug.print("after first rep (good):\n{}\n\n", .{updated_card});
</code>
}
```
Getting Started
1. Add zig-fsrs to your own zig project:
Fetch zig-fsrs:
<code>shell
zig fetch --save git+https://github.com/egegungordu/zig-fsrs</code>
2. Add zig-fsrs to your <code>build.zig</code> file:
<code>zig
const zig_fsrs = b.dependency("zig-fsrs", .{});
exe.root_module.addImport("zig-fsrs", zig_fsrs.module("zig-fsrs"));</code>
Now you can import zig-fsrs in your code:
<code>zig
const fsrs = @import("zig-fsrs");</code>
Basic Usage
1. Create a new FSRS instance
<code>zig
var f = fsrs.FSRS.init(.{});</code>
The parameters are optional. The parameters are:
| Parameter | Type | Default Value |
| ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| request_retention | f32 | 0.9 |
| maximum_interval | i32 | 36500 |
| w | [17]f32 | { 0.4872, 1.4003, 3.7145, 13.8206, 5.1618, 1.2298, 0.8975, 0.031, 1.6474, 0.1367, 1.0461, 2.1072, 0.0793, 0.3246, 1.587, 0.2272, 2.8755 } |
2. Create a new card
<code>zig
const initial_card = fsrs.Card.init();</code>
3. Schedule the card
<code>zig
const review_time = std.time.timestamp();
var scheduled_cards = f.schedule(initial_card, review_time);</code>
<code>schedule()</code> will return a <code>ScheduledCards</code> struct which contains the possible
cards given the rating. To select a card, use the <code>select</code> method, which
will return a <code>ReviewedCard</code> struct.
<code>zig
const good = scheduled_cards.select(.Good);
const new_card = good.card;</code>
Card fields
| Field | Type | Description |
| -------------- | ----- | --------------------------------------------------------------------------- |
| state | State | The state of the card. Can be <code>New</code>, <code>Learning</code>, <code>Review</code>, or <code>Relearning</code>. |
| reps | i32 | The number of repetitions of the card. |
| lapses | i32 | The number of times the card was remembered incorrectly. |
| stability | f32 | A measure of how well the card is remembered. |
| difficulty | f32 | The inherent difficulty of the card content. |
| elapsed_days | i64 | The number of elapsed days since the card was last reviewed. |
| scheduled_days | i64 | The next scheduled days for the card. |
| due | i64 | The due date for the next review. |
| last_review | i64 | The last review date of the card. |
Examples
To run the examples:
<code>shell
zig build example -Dexample=example_name</code>
Check out the <a>examples</a> directory for more examples.
Development
<code>shell
git clone https://github.com/egegungordu/zig-fsrs.git
cd zig-fsrs</code>
To run the tests:
<code>shell
zig build test --summary all</code> | [] |
https://avatars.githubusercontent.com/u/14366446?v=4 | zig-epoch | cfal/zig-epoch | 2024-07-17T16:29:09Z | Yet another date and time library for Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/cfal/zig-epoch/tags | MIT | [
"zig",
"ziglang"
] | 24 | false | 2024-07-18T14:47:29Z | true | true | unknown | github | [] | zig-epoch
Yet another date and time library for Zig.
Docs
Docs can be generated using <code>zig build docs</code>. It'll be hosted on Github Pages at some point.
Example
```zig
const std = @import("std");
const epoch = @import("epoch");
const Date = epoch.Date;
const Timezone = epoch.Timezone;
pub fn main() !void {
const allocator = std.heap.page_allocator;
<code>// Fetch the timezone on Linux using the `date` CLI.
const timezone = try Timezone.fetch(allocator);
defer timezone.deinit();
const offset_str = try timezone.allocPrint(allocator);
std.debug.print("The timezone is: {s} {s}\n", .{ timezone.name, offset_str });
// The timezone is: SGT +08:00
// Create a date in a specific timezone (or Date.now(null) to default to UTC)
const now = Date.now(timezone);
// Render in various formats
const locale_str = try now.allocPrintLocale(allocator);
std.debug.print("allocPrintLocale: {s}\n", .{locale_str});
// allocPrintLocale: 7/18/2024, 8:48:23 PM
const java_str = try now.allocPrintJava(allocator);
std.debug.print("allocPrintJava: {s}\n", .{java_str});
// allocPrintJava: Thu Jul 18 08:48:23 PM SGT 2024
const iso8601_str = try now.allocPrintISO8601(allocator);
std.debug.print("allocPrintISO8601: {s}\n", .{iso8601_str});
// allocPrintISO8601: 2024-07-18T20:48:23.828+08:00
// Convert into a UNIX timestamp
std.debug.print("The UNIX timestamp is: {d}\n", .{now.toTimestamp()});
// The UNIX timestamp is: 1721306903828
// Convert from a UNIX timestamp, optionally with a target timezone.
const epoch = Date.fromTimestamp(0, Timezone.GMT);
// Print using the buffer or writer API
var epoch_buffer: [80]u8 = undefined;
std.debug.print("The epoch date is: {s}\n", .{try epoch.bufPrintISO8601(&epoch_buffer)});
// The epoch date is: 1970-01-01T00:00:00.000Z
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/58421041?v=4 | essential_cp | abhaysp95/essential_cp | 2024-06-21T15:35:29Z | The repository contains solutions to the CP & DSA problems from various platforms | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/abhaysp95/essential_cp/tags | - | [
"algorithms",
"codechef-solutions",
"codeforces-solutions",
"competitive-programming",
"cpp",
"cpp14",
"dsa",
"leetcode-solutions",
"python",
"zig",
"ziglang"
] | 304 | false | 2025-05-12T11:19:14Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/157634247?v=4 | moeban | loulangxyz/moeban | 2024-05-01T16:41:28Z | Moeban JSON Data Base | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/loulangxyz/moeban/tags | MIT | [
"database",
"json",
"nosql",
"zig"
] | 30 | false | 2024-06-07T05:43:18Z | true | true | unknown | github | [] | Moeban
Documentation for the Moeban Project
Project Structure
The Moeban project is a JSON database system designed to store and manipulate data in JSON format.
Main Functions
<code>Moeban</code>
Defines a structure representing the JSON database. Includes methods to initialize the database, check if it exists, create it, read its content, and perform write and deletion operations.
Parameters
<ul>
<li><code>S</code>: Schema of the database, representing the structure of the stored data.</li>
<li><code>T</code>: Type of individual elements in the database.</li>
</ul>
Methods
<ul>
<li><code>init</code>: Initializes the database with a name, default data, and an allocator.</li>
<li><code>existsDataBase</code>: Checks if the database already exists.</li>
<li><code>createDataBase</code>: Creates the database with default data.</li>
<li><code>readDataBase</code>: Reads the content of the database.</li>
<li><code>parser</code>: Parses the database content and converts it into an easy-to-use structure.</li>
<li><code>compareById</code>: Compares two elements by their ID.</li>
<li><code>findById</code>: Finds an element by its ID in a specific field.</li>
<li><code>write</code>: Writes an element in a specific field.</li>
<li><code>writeMany</code>: Writes multiple elements in a specific field.</li>
<li><code>deleteOne</code>: Deletes an element by its ID in a specific field.</li>
<li><code>deleteMany</code>: Deletes elements based on a specified condition.</li>
</ul>
<code>main</code>
The main function that runs the program. Performs various test operations on the database, including writing, finding, deleting, and writing multiple users.
Operations Performed
<ul>
<li>Initializes the database with a schema and default data.</li>
<li>Writes a user in the "items" field.</li>
<li>Finds and displays information about the written user.</li>
<li>Deletes the written user.</li>
<li>Writes multiple users in the "others" field.</li>
<li>Deletes users based on a specific property ("age").</li>
</ul>
Usage Example
This file contains an example of how to use the Moeban database, showing how basic CRUD (Create, Read, Update, Delete) operations can be performed.
Considerations
<ul>
<li>Make sure Zig is installed and your development environment is correctly set up.</li>
<li>This project uses the general-purpose memory manager <code>GeneralPurposeAllocator</code> to handle dynamic memory allocations.</li>
</ul>
```zig
const User = struct { id: u64, name: []const u8, age: u64 };
const Schema = struct { items: []User }; // Define your schema
const default_data = { "items": [] }\; // Default data in JSON format
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
const moeban = try Moeban(Schema, User).init("test.json", default_data, allocator);
```
Writing Data
<code>zig
try moeban.write("items", .{ .id = 1, .name = "John Doe", .age = 30 });</code>
Finding Data
<code>zig
const user = try moeban.findById("items", 1);
defer allocator.free(user.data);
std.debug.print("{}\n", .{user.item});</code>
Deleting Data
<code>zig
try moeban.deleteOne("items", 1);</code>
Writing Multiple Users
```zig
var users = std.ArrayList(User).init(allocator);
defer users.deinit();
// Add users to the array...
try moeban.writeMany("others", users.items);
```
Deleting Users Based on a Condition
<code>zig
try moeban.deleteMany("others", "age", .{ .Number = 22 }); // or String = "22"</code>
Considerations
<ul>
<li>Make sure Zig is installed and your development environment is correctly set up.</li>
<li>
This project uses the general-purpose memory manager <code>GeneralPurposeAllocator</code> to handle dynamic memory allocations.
</li>
<li>
you can also use other memory allocators such as, <code>areana_allocator</code>, <code>page_allocator</code>, etc....
</li>
</ul>
Don't forget to free the memory. | [] |
https://avatars.githubusercontent.com/u/42516932?v=4 | file-browser | Wojberni/file-browser | 2024-07-12T16:19:37Z | Terminal UI browser for files written in Zig. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Wojberni/file-browser/tags | - | [
"file-browser",
"file-browsing",
"file-tree",
"learning",
"tree-structure",
"tui-app",
"zig",
"zig-lang"
] | 896 | false | 2025-04-02T19:48:25Z | true | true | 0.14.0 | github | [
{
"commit": "c49abb48241e11682b7b8b05c79d20773f1ded98",
"name": "vaxis",
"tar_url": "https://github.com/rockorager/libvaxis/archive/c49abb48241e11682b7b8b05c79d20773f1ded98.tar.gz",
"type": "remote",
"url": "https://github.com/rockorager/libvaxis"
}
] | File-browser
File-browser is a project for educational purposes written in Zig.
I was trying to remind myself, how trees work and file structure was a natural choice.
<blockquote>
Code was tested on Linux, it is NOT Windows compatible.
TUI was developed using Kitty, due to <a>libvaxis</a> compatibility. Some functionalities might not work as they should on other terminals.
</blockquote>
Basic commands
Build gui, demo or tests for file-browser using following commands.
<code>zig build gui</code>
<code>zig build demo</code>
<code>zig build test</code>
Project structure
<ul>
<li>build.zig, build.zig.zon - zig build system config</li>
<li>src/ - file-browser module, all core file tree functionalities</li>
<li>gui/ - gui using file-browser module and <a>libvaxis</a></li>
<li>tests/ - tests for file-browser module</li>
<li>examples/ - demo of all functions for file-browser module</li>
</ul>
<code>file-browser
│ README.md
│ build.zig
│ build.zig.zon
└───src
│ │ main.zig
│ │ ...
└───gui
│ │ main.zig
│ │ ...
└───tests
│ │ tests.zig
│ │ ...
└───examples
│ │ demo.zig
│ │ ...</code>
Basic flow and functionality
<ul>
<li>tree init/deinit - file tree struct, root node from selected directory</li>
<li>tree loading - loading files and directories as nodes to initialized tree structure</li>
<li>tree traversal - traverse loaded tree, basically <code>tree</code> command functionality</li>
<li>find node - find node and return path to it based on given name</li>
<li>insert node - insert node to given path (creates files on disk as well!)</li>
<li>delete node - deletes node of given path (deletes files on disk as well!)</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/70011507?v=4 | locreader | circlescodes/locreader | 2024-06-08T19:14:36Z | A program to read lines in each file of a directory. | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/circlescodes/locreader/tags | MIT | [
"loc",
"zig"
] | 5 | false | 2024-06-10T21:27:38Z | true | false | unknown | github | [] | LoC Reader
A program to read lines in each file of a directory.
Usage:
<code>./locreader some_project</code>
^^^ <code>some_project</code> is a <strong>directory.</strong>
You can also use dots, like:
<code>../locreader .</code>
or
<code>../locreader ../another_project</code> | [] |
https://avatars.githubusercontent.com/u/94111959?v=4 | zfetch | pop-ecx/zfetch | 2024-07-23T13:23:00Z | System information fetching tool implemented in pure zig. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/pop-ecx/zfetch/tags | Apache-2.0 | [
"linux",
"system-information",
"zig"
] | 1,014 | false | 2025-04-16T11:58:19Z | true | false | unknown | github | [] | <a></a>
Zfetch
A small neofetch clone in zig 0.13
Background
Zfetch is a blazingly fast system information fetching tool written in zig.
How it looks
Behold
Installation
This is not in any repo, so to install
<ul>
<li>Git clone the repo</li>
<li>cd into the repo</li>
<li>run <code>zig build</code></li>
</ul>
You can also download pre-built binaries from the releases page
Tested on
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Parrot os
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Kali linux
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Arch
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Ubuntu (remnux)
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Fedora 41
Kali
Arch
Ubuntu
Fedora
<blockquote>
This is still in beta, alot to still do, so feel free to contribute to it by checking out the <a>contribution guide</a>
The builds are done in debug mode as the project hasn't reached v1.0.0 yet.
</blockquote> | [] |
https://avatars.githubusercontent.com/u/41784264?v=4 | zTroy | jinzhongjia/zTroy | 2024-06-25T13:34:56Z | a zig library | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/jinzhongjia/zTroy/tags | - | [
"zig",
"zig-package"
] | 26 | false | 2025-05-03T19:19:22Z | true | true | 0.12.0 | github | [] | zTroy
A versatile libary.
The goal of this library is to create a general library of basic functional functions
<blockquote>
Now, this library is developing!
</blockquote>
Feature
<code>.ini</code> parse
Install
zig version: <code>0.12.0</code> or higher!
<ol>
<li>Add to <code>build.zig.zon</code></li>
</ol>
```sh
It is recommended to replace the following branch with commit id
zig fetch --save https://github.com/jinzhongjia/zTroy/archive/main.tar.gz
Of course, you can also use git+https to fetch this package!
```
<ol>
<li>Config <code>build.zig</code></li>
</ol>
Add this:
<code>``zig
// To standardize development, maybe you should use</code>lazyDependency()<code>instead of</code>dependency()`
// more info to see: https://ziglang.org/download/0.12.0/release-notes.html#toc-Lazy-Dependencies
const zTroy = b.dependency("zTroy", .{
.target = target,
.optimize = optimize,
});
// add module
exe.root_module.addImport("tory", zTroy.module("troy"));
```
Document
Waiting to be added! | [] |
https://avatars.githubusercontent.com/u/1970306?v=4 | zig-from-basics-to-advanced | rustkas/zig-from-basics-to-advanced | 2024-07-06T13:45:26Z | Книга о языке Zig от простого к сложному | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/rustkas/zig-from-basics-to-advanced/tags | MIT | [
"book",
"zig",
"ziglang"
] | 36 | false | 2024-12-11T17:01:46Z | false | false | unknown | github | [] | Программирование на Zig:
От Основ до Продвинутых Тем
Книга о языке Zig от простого к сложному
1. <a>Введение в Zig</a>
<ul>
<li>История и философия Zig</li>
<li>Основные особенности языка</li>
<li>Установка и настройка окружения</li>
</ul>
2. <a>Основы языка</a>
<ul>
<li>Синтаксис и структура программы</li>
<li>Основные типы данных</li>
<li>Операторы и выражения</li>
</ul>
3. <a>Управление памятью</a>
<ul>
<li>Понимание управления памятью в Zig</li>
<li>Выделение и освобождение памяти</li>
<li>Работа с указателями</li>
</ul>
4. <a>Управление ошибками</a>
<ul>
<li>Механизмы обработки ошибок в Zig</li>
<li>Возвращаемые ошибки и их обработка</li>
<li>Дизайн API с учетом ошибок</li>
</ul>
5. <a>Функции и процедуры</a>
<ul>
<li>Объявление и вызов функций</li>
<li>Параметры и возвращаемые значения</li>
<li>Рекурсия и хвостовая рекурсия</li>
</ul>
6. <a>Структуры и объединения</a>
<ul>
<li>Определение и использование структур</li>
<li>Методы и функции внутри структур</li>
<li>Объединения и их применение</li>
</ul>
7. <a>Модули и пакеты</a>
<ul>
<li>Организация кода в модули</li>
<li>Импорт и экспорт модулей</li>
<li>Использование пакетов и менеджер пакетов Zigmod</li>
</ul>
8. <a>Работа с файлами и потоками</a>
<ul>
<li>Чтение и запись файлов</li>
<li>Работа с потоками ввода/вывода</li>
<li>Сетевое программирование</li>
</ul>
9. <a>Многопоточность и параллелизм</a>
<ul>
<li>Основы многопоточности в Zig</li>
<li>Использование async/await</li>
<li>Работа с задачами и каналами</li>
</ul>
10. <a>Кросс-компиляция и сборка проектов</a>
<ul>
<li>Основы кросс-компиляции</li>
<li>Настройка build.zig</li>
<li>Примеры кросс-компиляции для различных платформ</li>
</ul>
11. <a>Интеграция с другими языками</a>
<ul>
<li>Взаимодействие с кодом на C/C++</li>
<li>Использование Zig в качестве компилятора C</li>
<li>Создание и использование библиотек Zig</li>
</ul>
12. <a>Производительность и оптимизация</a>
<ul>
<li>Советы по оптимизации кода на Zig</li>
<li>Профилирование и анализ производительности</li>
<li>Использование низкоуровневых возможностей Zig</li>
</ul>
13. <a>Безопасность и надежность</a>
<ul>
<li>Практики безопасного программирования на Zig</li>
<li>Работа с системами типов для повышения надежности</li>
<li>Проверка и тестирование кода</li>
</ul>
14. <a>Примеры и практические проекты</a>
<ul>
<li>Разработка простого веб-сервера</li>
<li>Создание игровой логики</li>
<li>Работа с базами данных и API</li>
</ul>
15. <a>Продвинутые темы</a>
<ul>
<li>Макросы и метапрограммирование</li>
<li>Написание собственных компиляторов и интерпретаторов</li>
<li>Исследование внутренних механизмов Zig</li>
</ul>
16. <a>Ресурсы и сообщество</a>
<ul>
<li>Полезные ресурсы и документация</li>
<li>Сообщество Zig и участие в развитии языка</li>
<li>Будущее Zig и новые возможности</li>
</ul>
Приложения
<ul>
<li>Справочник по стандартной библиотеке Zig</li>
<li>Часто задаваемые вопросы (FAQ)</li>
<li>Решения распространенных задач и примеры кода</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/69104965?v=4 | libxml2-zig-windows | doccaico/libxml2-zig-windows | 2024-04-28T15:02:46Z | libxml2 built using Zig build system for Windows | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/doccaico/libxml2-zig-windows/tags | MIT | [
"libxml2",
"zig"
] | 47 | false | 2024-05-20T15:16:38Z | true | true | unknown | github | [
{
"commit": "a42c161c7eac37a40884e794beb20b563f27ec1a.tar.gz",
"name": "libxml2",
"tar_url": "https://github.com/doccaico/libxml2/archive/a42c161c7eac37a40884e794beb20b563f27ec1a.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/doccaico/libxml2"
}
] | libxml2-zig-windows
This binding tested on <a>libxml2</a> 2.12.6 and Zig master version. It's Windows only.
Fetch
<code>sh
$ zig fetch --save=libxml2 https://github.com/doccaico/libxml2-zig-windows/archive/<git-commit-hash>.tar.gz</code>
Usage
```zig
// build.zig
const libxml2 = b.dependency("libxml2", .{ .target = target, .optimize = optimize });
exe.linkLibrary(libxml2.artifact("libxml2"));
// src/main.zig
const std = @import("std");
const c = @cImport({
@cInclude("libxml/xmlreader.h");
});
[your code ...]
```
See more <a>examples</a>
Tests
```sh
$ git clone https://github.com/doccaico/libxml2-zig-windows.git
$ cd libxml2-zig-windows
Builds all the examples
$ zig build examples
To list available examples
$ zig build --help
```
Based on <a>mitchellh/zig-build-libxml2</a> and <a>ianprime0509/zig-libxml2</a> | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | Zig-fmtHelper | bcrist/Zig-fmtHelper | 2024-05-13T22:42:38Z | Some std.fmt helpers for Zig programs | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/bcrist/Zig-fmtHelper/tags | MIT | [
"formatting",
"gigabytes",
"kilobytes",
"megabytes",
"units",
"utilities",
"utility-library",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 20 | false | 2025-05-20T03:59:08Z | true | true | 0.14.0 | github | [] | Zig-fmtHelper
Includes several std.fmt helpers, including:
<ul>
<li><code>bytes</code>: automatically format large byte values in KB, MB, GB, TB, etc.</li>
<li><code>si</code>: automatically format large or small values using SI unit prefixes.</li>
</ul>
Installation
Add to your <code>build.zig.zon</code>:
<code>$ zig fetch --save git+https://github.com/bcrist/Zig-fmtHelper</code>
Add to your <code>build.zig</code>:
```zig
pub fn build(b: *std.Build) void {
const fmt_module = b.dependency("fmt_helper", .{}).module("fmt");
<code>//...
const exe = b.addExecutable(.{
//...
});
exe.root_module.addImport("fmt", fmt_module);
//...
</code>
}
```
Example Usage
```zig
pub fn print_stats(some_number_of_bytes: usize, some_number_of_nanoseconds: usize) !void {
std.io.getStdOut().writer().print(
\ some number of bytes: {}
\ some duration: {}
\
, .{
fmt.bytes(some_number_of_bytes),
fmt.si.ns(some_number_of_nanoseconds),
});
}
const fmt = @import("fmt");
const std = @import("std");
<code>Possible output:</code>
some number of bytes: 3 KB
some duration: 47 ms
``` | [] |
https://avatars.githubusercontent.com/u/103538771?v=4 | cryptlibc | kenf1/cryptlibc | 2024-07-04T13:47:13Z | C library for basic string encryption/decryption + Rust & Zig bindings | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/kenf1/cryptlibc/tags | GPL-3.0 | [
"c",
"c-library",
"ffi-bindings",
"rust",
"zig"
] | 35 | false | 2025-02-21T13:45:57Z | false | false | unknown | github | [] | cryptlibc
A C library for basic string encryption. Based on ROT13 algorithm. C main binary compiled with <a>Zig</a>. Includes bindings to other languages (see <a>Bindings</a> for full list).
Usage
<ul>
<li>For learning purpose only</li>
<li>"virtually no cryptographic security" = not intended for production</li>
</ul>
Bindings
<ul>
<li>Rust</li>
<li>Zig (v0.13.0)</li>
</ul>
Instructions
See <code>Makefile</code> or run <code>make help</code> for list of available commands.
Cleanup:
<code>{bash}
make alltidy</code> | [] |
https://avatars.githubusercontent.com/u/76531574?v=4 | zig_sdl2_boilerplate | malespiaut/zig_sdl2_boilerplate | 2024-04-29T19:02:02Z | Boilerplate code for using SDL2 with Zig. | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/malespiaut/zig_sdl2_boilerplate/tags | - | [
"boilerplate",
"gamedev",
"sdl2",
"zig"
] | 4 | false | 2025-03-16T07:38:25Z | true | false | unknown | github | [] | Zig SDL2 boilerplate
Just a simple boilerplate that I use for all my SDL2 code with Zig.
There's no copyright, feel free to copy anything without restrictions. | [] |
https://avatars.githubusercontent.com/u/156574563?v=4 | zfix | finautica/zfix | 2024-03-27T18:16:07Z | ZFIX is a Zig based FIX Engine for consuming market data feeds. | main | 1 | 1 | 0 | 1 | https://api.github.com/repos/finautica/zfix/tags | MIT | [
"financial-markets",
"fixprotocol",
"zig"
] | 10 | false | 2025-04-15T16:00:01Z | true | false | unknown | github | [] |
<a name="readme-top"></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
ZFIX
An attempt to create foundation for a FIX engine in Zig.
Table of Contents
<ol>
<li>
<a>About The Project</a>
<ul>
<li><a>Features</a></li>
</ul>
</li>
<li>
<a>Getting Started</a>
<ul>
<li><a>Prerequisites</a></li>
<li><a>Installation</a></li>
</ul>
</li>
<li><a>Usage</a></li>
<li><a>Roadmap</a></li>
<li><a>Contributing</a></li>
<li><a>License</a></li>
<li><a>Contact</a></li>
<li><a>Acknowledgments</a></li>
</ol>
About The Project
Features:
(<a>Back to top</a>)
Getting Started
Prerequisites
Installation
(<a>Back to top</a>)
Usage
(<a>Back to top</a>)
Roadmap
See the <a>open issues</a> for a full list of proposed features (and known issues).
(<a>Back to top</a>)
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are <strong>greatly appreciated</strong>.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!
<ol>
<li>Fork the Project</li>
<li>Create your Feature Branch (<code>git checkout -b feature/AmazingFeature</code>)</li>
<li>Commit your Changes (<code>git commit -m 'Add some AmazingFeature'</code>)</li>
<li>Push to the Branch (<code>git push origin feature/AmazingFeature</code>)</li>
<li>Open a Pull Request</li>
</ol>
(<a>back to top</a>)
License
Distributed under the MIT License. See <code>LICENSE.txt</code> for more information.
(<a>back to top</a>)
Contact
Samuel Yute - <a>LinkedIn</a> - samuel.yute@gmail.com
ZFIX : <a>Repository URL</a>
(<a>Back to top</a>)
Acknowledgments
(<a>Back to top</a>)
| [] |
https://avatars.githubusercontent.com/u/98696261?v=4 | sap | Reokodoku/sap | 2024-08-02T10:35:31Z | A simple argument parser library for zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Reokodoku/sap/tags | MIT | [
"argument-parser",
"zig",
"zig-package"
] | 28 | false | 2024-09-05T19:27:20Z | true | true | 0.14.0-dev.1421+f87dd43c1 | github | [] | sap
sap is a simple argument parser library for zig that uses a tuple of flags to create a struct containing the value of the arguments.
How to add the library
<ol>
<li>Run in the terminal:
<code>sh
zig fetch --save git+https://github.com/Reokodoku/sap</code></li>
<li>Add in your <code>build.zig</code>:
<code>zig
const sap = b.dependency("sap", .{});
exe.root_module.addImport("sap", sap.module("sap"));</code></li>
</ol>
Examples
Minimal example:
```zig
const sap = @import("sap");
var arg_parser = sap.Parser(.{
sap.flag([]const u8, "hello", 'h', "world"),
}).init(allocator);
defer arg_parser.deinit();
const args = try arg_parser.parseArgs();
std.debug.print("Executable name: {s}\n", .{args.executable_name});
var positionals_iter = args.positionals.iterator();
std.debug.print("Positionals:\n", .{});
while (positionals_iter.next()) |str|
std.debug.print(" {s}\n", .{str});
std.debug.print("<code>hello</code>|<code>h</code> flag value: {s}\n", .{args.hello});
```
You can find more examples in the <code>examples/</code> folder.
For more information, see the source code or documentation (<code>zig build docs</code>).
Features
<ul>
<li>short arguments</li>
<li>long arguments</li>
<li>pass values after an equal (<code>--foo=bar</code>) or a space (<code>--foo bar</code>)</li>
<li>flags can be specified multiple times</li>
<li>flags that call a function</li>
<li>supported types:<ul>
<li>booleans</li>
<li>strings</li>
<li>ints (signed and unsigned)</li>
<li>floats</li>
<li>enums</li>
<li>and all optional variants of the above (<code>?bool</code>, <code>?[]const u8</code>, ...)</li>
</ul>
</li>
</ul>
Zig version
sap targets the master branch of zig.
In the <code>build.zig.zon</code> file, there is the <code>minimum_zig_version</code> field which specifies the latest version of zig in which sap compiles.
When the zig master branch breaks the compilation, a commit will be merged to:
<ul>
<li>fix the compilation errors</li>
<li>update the <code>minimum_zig_version</code> field with the new zig version</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/1970306?v=4 | Zig-Notepad-plus-plus-syntax-highlighting | rustkas/Zig-Notepad-plus-plus-syntax-highlighting | 2024-07-09T08:46:32Z | Notepad++ xml file for Zig syntax highlighting | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/rustkas/Zig-Notepad-plus-plus-syntax-highlighting/tags | - | [
"notepad-plus-plus",
"zig",
"ziglang"
] | 3 | false | 2025-01-02T16:24:26Z | false | false | unknown | github | [] | Zig Notepad++ syntax highlighting
Notepad++ xml file for Zig syntax highlighting | [] |
https://avatars.githubusercontent.com/u/12876210?v=4 | raylib-game-template-zig | recombinant/raylib-game-template-zig | 2024-02-27T20:22:24Z | Translation of raysan5/raylib-game-template to zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/recombinant/raylib-game-template-zig/tags | Zlib | [
"raylib",
"zig",
"ziglang"
] | 18,766 | false | 2025-05-13T09:48:20Z | true | true | 0.14.0 | github | [
{
"commit": "63b988ade906adc7264a8bec8fccec5f47befb55",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/63b988ade906adc7264a8bec8fccec5f47befb55.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
}
] | raylib-game-template-zig
The code in this repository is a translation and refactoring of C source code found at:
https://github.com/raysan5/raylib-game-template
The original code is <em>Copyright (c) 2014-2025 Ramon Santamaria</em>
For documentation refer to the repository above.
translation
The original code is written in C. This code was manually translated to <a>zig</a> and then refactored to be more "zig like" using established zigisms.
<ul>
<li><a>zig naming conventions</a> - except for all capitals constants names that were originally <code>#define</code></li>
<li>no global (ie. file scope) <code>var</code> variables</li>
<li>each screen in the original is represented in zig by its own <code>struct</code> with consistent methods</li>
<li>init()</li>
<li>deinit() <em>where applicable</em></li>
<li>update()</li>
<li>draw()</li>
<li>the screen instances are held in a <a>tagged union</a></li>
<li>there are no zig tests</li>
<li>developed and run on Microsoft Windows 11 only</li>
</ul>
zig and raylib versions
<ul>
<li><code>zig-0.15.0-dev.515</code> (May 2025)</li>
<li>raylib dev (May 2025)</li>
</ul>
Please don't be surprised if the project does not compile without tweaking - this is not set up for the unwary.
to run
<code>zig build run</code> | [] |
https://avatars.githubusercontent.com/u/565124?v=4 | w4-1bit-paint | peterhellberg/w4-1bit-paint | 2024-07-06T16:17:09Z | null | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/peterhellberg/w4-1bit-paint/tags | - | [
"fantasy-console",
"wasm4",
"zig"
] | 5 | false | 2025-03-04T13:42:48Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "w4",
"tar_url": "https://github.com/peterhellberg/w4/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/peterhellberg/w4"
}
] | w4-1bit-paint :paintbrush:
A pretty minimal paint program written in <a>Zig</a>,
compiled into a <code>.wasm</code> cart for use in the
fantasy console <a>WASM-4</a>.
:video_game: <a>Play</a> or :package: <a>Download</a>
Usage
| Key | |
|-----------:|---------------------------------------------|
| <strong>Z</strong> | Clear white
| <strong>X</strong> | Clear black
| <strong>M1</strong> | Color
| <strong>M2</strong> | Toggle
| <strong>M3</strong> | Toggle all
| <strong>Arrows</strong> | Switch “color” that is drawn with M1
Development
File watcher can be started by calling:
<code>sh
zig build spy</code>
Running the cart in WASM-4:
<code>sh
zig build run</code>
Deploy:
<code>make deploy</code> | [] |
https://avatars.githubusercontent.com/u/434125?v=4 | zig-libusb | ssttevee/zig-libusb | 2024-06-10T16:33:23Z | zig builder and wrapper for libusb | trunk | 0 | 1 | 2 | 1 | https://api.github.com/repos/ssttevee/zig-libusb/tags | MIT | [
"libusb",
"usb",
"zig"
] | 34 | false | 2024-10-26T16:45:05Z | true | true | 0.13.0 | github | [
{
"commit": "refs",
"name": "libusb",
"tar_url": "https://github.com/libusb/libusb/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/libusb/libusb"
}
] | zig-libusb
This module takes full advantage of the zig build system to download and build libusb. There is also a thin zig layer for more natural integration in other zig code.
Tested with the following configurations:
- self-hosted zig 0.12.0 on aarch64-macos
- self-hosted zig 0.13.0 on x86_64-linux
Some effort was spent porting other build configurations as well. Please submit a pull request to verify or fix builds on your system if possible.
Building
<code>sh
zig build --release=safe</code>
Options
Run <code>zig build --help</code> for the full list of options offered by zig.
<code>-Dtarget=[string] The CPU architecture, OS, and ABI to build for
-Dcpu=[string] Target CPU features to add or subtract
-Ddynamic-linker=[string] Path to interpreter on the target system
-Doptimize=[enum] Prioritize performance, safety, or binary size
Supported Values:
Debug
ReleaseSafe
ReleaseFast
ReleaseSmall
-Dstatic=[bool] Build static lib (default: true)
-Dshared=[bool] Build shared lib (default: true)</code>
Zig Layer
The zig layer tries OO-ify the library and remove manual bit-wise operations where possible.
Installing into your own project
Run this command from your project folder
<code>sh
zig fetch --save https://github.com/ssttevee/zig-libusb/archive/refs/tags/1.0.27.tar.gz</code>
Then add this snippet to your <code>build.zig</code> file
```zig
const libusb = b.dependency("libusb", .{
.optimize = optimize,
.target = target,
});
exe.root_module.addImport("libusb", libusb.module("libusb"));
```
Example
```zig
const std = @import("std");
const libusb = @import("libusb");
pub fn main() !void {
try libusb.init(.{ .log_level = .info });
defer libusb.deinit();
<code>const my_device = blk: {
const devices = try libusb.getDeviceList();
defer libusb.freeDeviceList(devices);
for (devices) |device| {
if (isMyDevice(device)) {
break :blk device.ref();
}
}
};
defer my_device.unref();
var config_desc = try my_device.getActiveConfigDescriptor();
defer config_desc.deinit();
const interface_desc = config_desc.interfacesSlice()[0].toSlice()[0];
const write_endpoint = interface_desc.endpointsSlice()[0];
std.debug.assert(write_endpoint.bmAttributes.transfer_type == .bulk);
std.debug.assert(write_endpoint.bEndpointAddress.direction == .output);
const device_handle = try my_device.open();
defer device_handle.close();
defer device_handle.reset() catch {};
const my_interface = try device_handle.claimInterface(interface_desc.bInterfaceNumber);
defer my_interface.release();
const w = my_interface.writable(write_endpoint.bEndpointAddress, 0);
try std.fmt.format(w.writer(), "Hello World\n", .{});
</code>
}
```
The raw c functions are also all accessible
```zig
const std = @import("std");
const libusb = @import("libusb");
pub fn main() !void {
try libusb.c.libusb_init_context(null, null, 0).result();
defer libusb.c.libusb_exit(null);
}
``` | [] |
https://avatars.githubusercontent.com/u/79244055?v=4 | music-player | andiputraw/music-player | 2024-06-19T13:09:12Z | My own music player written in zig with raylib | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/andiputraw/music-player/tags | MIT | [
"music-player",
"raylib",
"zig"
] | 4,468 | false | 2025-04-30T09:18:23Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/46655455?v=4 | zfs | 4zv4l/zfs | 2024-08-05T13:53:48Z | Zig File Server (very basic file server) | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/4zv4l/zfs/tags | GPL-3.0 | [
"zig"
] | 42 | false | 2024-09-26T01:39:37Z | true | true | unknown | github | [
{
"commit": "master",
"name": "args",
"tar_url": "https://github.com/ikskuh/zig-args/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/ikskuh/zig-args"
},
{
"commit": "c9327827352354da246733e97535754ced64def8",
"name": "chameleon",
"tar_url": "https://github.co... | zfs
Zig File Server (very basic file server)
How it works
<ul>
<li>A client connects and requests a file</li>
<li>The server replies with the md5sum (raw, not in hex (16 bytes)) and the file size in bytes (u64)</li>
<li>If the md5sum is all 0, means an error occured and data following will be the error len (u64) and message</li>
<li>Otherwise (no error) the server send the file data</li>
</ul>
Example
Server side:
<code>$ ./zig-out/bin/zfs -d tmp 8080
info: Listening on 0.0.0.0:8080 and serving tmp/
info: New client on 127.0.0.1:51598 [1/10]
info: Request 'tmp/weirdFileName'
warning: FileNotFound
info: Request 'tmp/hello'
info: Got stat from file
info: Got md5hash from file
info: Sent metadata: { hash: 4a8a470360bf6b3ca86c519812851d0a, size: 10 }
info: Sent file
info: Client 127.0.0.1:51598 left</code>
Client side:
```
$ ./zfs_client.pl
<blockquote>
weirdFileName
md5sum => '00000000000000000000000000000000'
filesize => 12
FileNotFound
hello
md5sum => '4a8a470360bf6b3ca86c519812851d0a'
filesize => 10
Downloaded 10/10 bytes
md5sum matches !
```
</blockquote>
TODO
<ul>
<li>[X] separate code into multiple files</li>
<li>[X] allow to list sub directory
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> give more information when listing directory (in which format?)</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/5955225?v=4 | zig-rbtree | JamesErrington/zig-rbtree | 2024-03-08T14:27:47Z | Red Black Tree implementation in Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/JamesErrington/zig-rbtree/tags | Unlicense | [
"zig"
] | 4 | false | 2024-03-09T11:11:08Z | false | false | unknown | github | [] | zig-rbtree
Red Black Tree implementation in Zig | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | spirv.zig | tiawl/spirv.zig | 2024-04-08T17:05:20Z | spirv-tools packaged for @ziglang | trunk | 0 | 1 | 1 | 1 | https://api.github.com/repos/tiawl/spirv.zig/tags | Unlicense | [
"binding",
"spaceporn",
"spirv",
"spirv-tools",
"zig",
"zig-package",
"ziglang"
] | 3,225 | false | 2025-05-21T09:17:48Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
}
] | spirv.zig
This is a fork of <a>hexops/spirv-tools</a> which itself is a fork of <a>KhronosGroup/SPIRV-Tools</a>.
Why this forkception ?
The intention under this fork is the same as <a>hexops</a> had when they forked <a>KhronosGroup/SPIRV-Tools</a>: package the headers for <a>Zig</a>. So:
* Unnecessary files have been deleted,
* The build system has been replaced with <code>build.zig</code>.
However this repository has subtle differences for maintainability tasks:
* No shell scripting,
* A cron runs every day to check <a>KhronosGroup/SPIRV-Tools</a> and <a>KhronosGroup/SPIRV-Headers</a>. Then it updates this repository if a new release is available.
How to use it
The current usage of this repository is centered around <a>tiawl/shaderc.zig</a> compilation. But you could use it for your own projects. Headers are here and there are no planned evolution to modify them. See <a>tiawl/shaderc.zig</a> to see how you can use it. Maybe for your own need, some headers are missing. If it happens, open an issue: this repository is open to potential usage evolution.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>KhronosGroup/SPIRV-Tools</a>
* <a>KhronosGroup/SPIRV-Headers</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/shaderc.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>KhronosGroup/SPIRV-Tools</a>
* <a>KhronosGroup/SPIRV-Headers</a>
* <a>tiawl/toolbox</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | glslang.zig | tiawl/glslang.zig | 2024-04-09T10:07:03Z | glslang packaged for @ziglang | trunk | 0 | 1 | 2 | 1 | https://api.github.com/repos/tiawl/glslang.zig/tags | Unlicense | [
"binding",
"glslang",
"spaceporn",
"zig",
"zig-package",
"ziglang"
] | 2,058 | false | 2025-05-21T09:18:50Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
}
] | glslang.zig
This is a fork of <a>KhronosGroup/glslang</a> packaged for <a>Zig</a>
Why this fork ?
The intention under this fork is to package <a>KhronosGroup/glslang</a> for <a>Zig</a>. So:
* Unnecessary files have been deleted,
* The build system has been replaced with <code>build.zig</code>,
* A cron runs every day to check <a>KhronosGroup/glslang</a>. Then it updates this repository if a new release is available.
How to use it
The goal of this repository is not to provide a <a>Zig</a> binding for <a>KhronosGroup/glslang</a>. There are at least as many legit ways as possible to make a binding as there are active accounts on Github. So you are not going to find an answer for this question here. The point of this repository is to abstract the <a>KhronosGroup/glslang</a> compilation process with <a>Zig</a> (which is not new comers friendly and not easy to maintain) to let you focus on your application. So you can use <strong>glslang.zig</strong>:
- as raw (no available example, open an issue if you are interested in, we will be happy to help you),
- as a daily updated interface for your <a>Zig</a> binding of <a>KhronosGroup/glslang</a> (again: no available example).
Important note
The current usage of this repository is centered around <a>tiawl/shaderc.zig</a> compilation. So for your usage it could break because some files have been filtered in the process. If it happens, open an issue: this repository is open to potential usage evolution.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>KhronosGroup/glslang</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/shaderc.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>KhronosGroup/glslang</a>
* <a>tiawl/toolbox</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/50003626?v=4 | zig-projects | jkohhokj/zig-projects | 2024-04-14T02:22:50Z | Projects to learn Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/jkohhokj/zig-projects/tags | - | [
"lc3",
"rsa",
"zig"
] | 2,360 | false | 2024-07-15T01:50:14Z | false | false | unknown | github | [] | Zig Projects
LC3 Virtual Machine (Zig 14.0)
Sources:
<a>Writing your Own Virtual Machine</a>
<a>lc3vm-zig</a>
<a>lets build an lc 3 virtual machine</a>
<blockquote>
Note: Raw mode on terminal doesn't work properly, you have to press [ENTER] to input a character.
</blockquote>
There are a bunch of programs in <code>/images</code>. The proper one to run are the <code>.obj</code> files.
If you don't want the detailed instructions run like this:
<code>zig run -lc src/main.zig -- images/programs/rogue.obj release</code>
Otherwise run without <code>release</code>.
Example of <code>character_counter.obj</code>:
<code>zig run -lc lc3-zig/src/main.zig -- lc3-zig/images/programs/character_counter/character_counter.obj release
Starting the VM...
Character Counter - Copyleft (c) Dennis Ideler.
Please enter a line of lower case text.
asdfasdfqwertyuiopasdfasdf
asdfasdfqwertyuiopasdfasdf
a:4
b:0
c:0
d:4
e:1
f:4
g:0
h:0
i:1
j:0
k:0
l:0
m:0
n:0
o:1
p:1
q:1
r:1
s:4
t:1
u:1
v:0
w:1
x:0
y:1
z:0
HALT</code>
Example with debug prints on <code>hello2.obj</code>:
<code>zig run -lc lc3-zig/src/main.zig -- lc3-zig/images/hello2.obj
File start: 3000
Filename: /home/wslappendix/.cache/zig/o/88a2d62dfdda1e6f7ede7cb12b4a097b/main lc3-zig/images/hello2.obj
Starting the VM...
Breakdown of instruction: 1110000000000101 hardware.vm.Instruction.OP_LEA
Registers in 0x: { 3007, 0, 0, 0, 0, 0, 0, 0, 3002, 1 }
Breakdown of instruction: 0010001000010011 hardware.vm.Instruction.OP_LD
Registers in 0x: { 3007, 5, 0, 0, 0, 0, 0, 0, 3003, 1 }
Breakdown of instruction: 1111000000100010 hardware.vm.Instruction.OP_TRAP
Hello, World!
Registers in 0x: { 3007, 5, 0, 0, 0, 0, 0, 3004, 3004, 1 }
Breakdown of instruction: 0001001001111111 hardware.vm.Instruction.OP_ADD
Registers in 0x: { 3007, 4, 0, 0, 0, 0, 0, 3004, 3005, 1 }
Breakdown of instruction: 0000001111111101 hardware.vm.Instruction.OP_BR
Registers in 0x: { 3007, 4, 0, 0, 0, 0, 0, 3004, 3003, 1 }
Breakdown of instruction: 1111000000100010 hardware.vm.Instruction.OP_TRAP
Hello, World!
Registers in 0x: { 3007, 4, 0, 0, 0, 0, 0, 3004, 3004, 1 }
Breakdown of instruction: 0001001001111111 hardware.vm.Instruction.OP_ADD
Registers in 0x: { 3007, 3, 0, 0, 0, 0, 0, 3004, 3005, 1 }
Breakdown of instruction: 0000001111111101 hardware.vm.Instruction.OP_BR
Registers in 0x: { 3007, 3, 0, 0, 0, 0, 0, 3004, 3003, 1 }
Breakdown of instruction: 1111000000100010 hardware.vm.Instruction.OP_TRAP
Hello, World!
Registers in 0x: { 3007, 3, 0, 0, 0, 0, 0, 3004, 3004, 1 }
Breakdown of instruction: 0001001001111111 hardware.vm.Instruction.OP_ADD
Registers in 0x: { 3007, 2, 0, 0, 0, 0, 0, 3004, 3005, 1 }
Breakdown of instruction: 0000001111111101 hardware.vm.Instruction.OP_BR
Registers in 0x: { 3007, 2, 0, 0, 0, 0, 0, 3004, 3003, 1 }
Breakdown of instruction: 1111000000100010 hardware.vm.Instruction.OP_TRAP
Hello, World!
Registers in 0x: { 3007, 2, 0, 0, 0, 0, 0, 3004, 3004, 1 }
Breakdown of instruction: 0001001001111111 hardware.vm.Instruction.OP_ADD
Registers in 0x: { 3007, 1, 0, 0, 0, 0, 0, 3004, 3005, 1 }
Breakdown of instruction: 0000001111111101 hardware.vm.Instruction.OP_BR
Registers in 0x: { 3007, 1, 0, 0, 0, 0, 0, 3004, 3003, 1 }
Breakdown of instruction: 1111000000100010 hardware.vm.Instruction.OP_TRAP
Hello, World!
Registers in 0x: { 3007, 1, 0, 0, 0, 0, 0, 3004, 3004, 1 }
Breakdown of instruction: 0001001001111111 hardware.vm.Instruction.OP_ADD
Registers in 0x: { 3007, 0, 0, 0, 0, 0, 0, 3004, 3005, 2 }
Breakdown of instruction: 0000001111111101 hardware.vm.Instruction.OP_BR
Registers in 0x: { 3007, 0, 0, 0, 0, 0, 0, 3004, 3006, 2 }
Breakdown of instruction: 1111000000100101 hardware.vm.Instruction.OP_TRAP
HALT</code>
Linked Lists (Zig 13.0)
A Python list in Zig with the same methods and properties.
Example output:
```
Print my list:
3 133 44 44 44 42
Print my list BACKWARDS:
42 44 44 44 133 3
Inline reversing my list...
Print reversed list:
42 44 44 44 133 3
Print reversed list BACKWARDS (so should be normal):
3 133 44 44 44 42
Popping the last element...
This is my popped node: LinkedList.Node{ .value = 3, .next = null, .prev = null }
And the list looks like this now:
42 44 44 44 133
133 44 44 44 42
Let's get rid of 133
42 44 44 44
44 44 44 42
Let's get rid of 100 (it doesn't exist)
I errored!!
42 44 44 44
44 44 44 42
How many 44's are there?
There are 3 44's.
Let's remove all the 44's
42
42
Yey Linked Lists :)
```
RSA Suite (Zig 13.0)
Here's an example output:
<code>Generating primes:
Primes p and q: 691 641
Proving they are prime:
a | b | q | r | s | t
691 | 641 | 1 | 50 | 1 | -1
641 | 50 | 12 | 41 | -12 | 13
50 | 41 | 1 | 9 | 13 | -14
41 | 9 | 4 | 5 | -64 | 69
9 | 5 | 1 | 4 | 77 | -83
5 | 4 | 1 | 1 | -141 | 152
4 | 1 | 4 | 0 | 641 | -691
gcd is 1
bezier coeffs are s=-141, t=152: -141*691+152*641=1</code>
Our prime number generator uses Euler primes from the sequence $k^2-k+41$ when $0 < k < 41$.
<code>Found the public key exponent
e, n = 1231 442931</code>
We generate a random public key coefficient <code>e</code> that's smaller than <code>n</code> but is still sufficiently large. <code>n</code> is simply a product of <code>q</code> and <code>p</code>.
<code>Finding the private key exponent through inverse mod with egcd
a | b | q | r | s | t
441600 | 1231 | 358 | 902 | 1 | -358
1231 | 902 | 1 | 329 | -1 | 359
902 | 329 | 2 | 244 | 3 | -1076
329 | 244 | 1 | 85 | -4 | 1435
244 | 85 | 2 | 74 | 11 | -3946
85 | 74 | 1 | 11 | -15 | 5381
74 | 11 | 6 | 8 | 101 | -36232
11 | 8 | 1 | 3 | -116 | 41613
8 | 3 | 2 | 2 | 333 | -119458
3 | 2 | 1 | 1 | -449 | 161071
2 | 1 | 2 | 0 | 1231 | -441600
gcd is 1
bezier coeffs are s=-449, t=161071: -449*441600+161071*1231=1</code>
We generate the private key <code>d</code> by calculating the inverse modulos of <code>e</code> such that $e*d \equiv 1 (mod\: \phi(n))$. In our case, <code>d</code> is the positive beizer coefficient.
<code>Found the full keypair:
e = 1231
d = 161071
n = 442931
Proving d * e === 1 (mod totient)
161071 * 1231 = 441600 * 449 + 1</code> | [] |
https://avatars.githubusercontent.com/u/51416554?v=4 | monkey-lang | hendriknielaender/monkey-lang | 2024-04-29T15:31:53Z | Thorsten Ball's book "Writing and interpreter in Go" | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/hendriknielaender/monkey-lang/tags | MIT | [
"monkey-lang",
"zig",
"ziglang"
] | 1 | false | 2024-05-16T08:16:28Z | false | false | unknown | github | [] | monkey-lang
Thorsten Ball's book "Writing and interpreter in Go" | [] |
https://avatars.githubusercontent.com/u/54911446?v=4 | miniprof | milanpoliak/miniprof | 2024-06-02T12:00:50Z | Minimalistic profiler for Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/milanpoliak/miniprof/tags | MIT | [
"performance",
"profiling",
"zig"
] | 9 | false | 2024-07-01T23:37:49Z | true | true | unknown | github | [] | Zig Miniprof
Minimalistic profiler tool for Zig.
How to use
Install
<ol>
<li>Add Miniprof to <code>build.zig.zon</code> dependencies</li>
</ol>
<code>shell
zig fetch --save https://github.com/milanpoliak/miniprof/archive/refs/tags/v0.1.1.tar.gz</code>
<ol>
<li>Add Miniprof to <code>build.zig</code></li>
</ol>
```zig
const miniprof = b.dependency("miniprof", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("miniprof", miniprof.module("miniprof"));
```
Run
```zig
// Import Miniprof
const profiler = @import("miniprof");
const OpenBlock = profiler.OpenBlock;
const allocator = std.testing.allocator;
// Setup global profiler...
try profiler.setupGlobalProfiler(allocator, 64); // Profilers have capacity, but they use std.ArrayList and can grow when needed
var block = OpenBlock("A block");
defer block.close();
// ... or create a custom instance (e.g. if you need independent profiles for different code paths)
var prof = try profiler.Profiler.init(allocator, 64);
var block = profiler.OpenBlockWithProfiler("A block", &prof);
defer block.close();
// ... do stuff
// Print results in a table (or use profiler.blocks directly to report it in other formats)
try profiler.writeTable(profiler.GlobalProfiler, std.io.getStdOut().writer(), allocator)
```
Example table output
```text
Block Exclusive time % of total time Total time Hits
a block 11283703 0.24 9561689374 2
another block 4661619021 97.51 4769561005 290875
```
Disabling profiler
For release builds, or any other situations you want the profiler to be disabled
simply import the <code>disabled</code> module in your <code>build.zig</code>.
The <code>disabled</code> module exposes all functions with the same signatures, but empty bodies.
<code>zig
exe.root_module.addImport("miniprof", miniprof.module("disabled"));</code>
Known limitations
<ul>
<li>Multiple blocks with the same name will be treated as a single block </li>
</ul> | [] |
https://avatars.githubusercontent.com/u/296714?v=4 | probe | mitjafelicijan/probe | 2024-06-19T20:12:05Z | Just testing things | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/mitjafelicijan/probe/tags | 0BSD | [
"assembly",
"c",
"d",
"experiments",
"zig"
] | 4,359 | false | 2025-04-11T19:36:05Z | false | false | unknown | github | [] | <strong>Just testing things.</strong>
Nothing crazy here. I put little experiments and tests I do here so I can
reference them later if I need to.
<blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
Check <code>shell.nix</code> to see the software and dependencies that are used
in these examples. If you use Nix just do <code>nix-shell shell.nix</code>.
</blockquote>
Every test has it's own <code>Makefile</code> so please check that before you try
running it.
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
Some of the examples are specific to certain operating systems and
they will not work everywhere. Take this into account. This code is
also written in the most explicit way and lacks massively when it
comes to checking of errors etc.
</blockquote>
| | Compiler | What does it do? |
|----------------------------------------|------------|----------------------------------------------------------------|
| <a>c-asm</a> | clang-17 | Calls a function written in ASM from C code. |
| <a>c-embed</a> | clang-17 | Embedding external resources in compiled binary. |
| <a>c-signals</a> | clang-17 | Uses SIGUSR1 and SIGUSR2 as IPC mechanism. |
| <a>c-structs</a> | clang-17 | Saves and reads structs in/from binary files. |
| <a>c-httpd</a> | clang-17 | Simple HTTP server with route handling primer in C. |
| <a>zig-c-interop</a> | zig-0.11.0 | Uses functions written in C from Zig code. |
| <a>zig-ppm</a> | zig-0.11.0 | Creates an image with random pixels in PPM image format. |
| <a>zig-struct-json</a> | zig-0.11.0 | Serialization of a struct into JSON and then reading it back. |
| <a>zig-telnet</a> | zig-0.11.0 | Connects to Redis server like it is a basic telnet server. |
| <a>zig-x11</a> | zig-0.11.0 | Uses X11 to create a basic window without any bindings needed. |
| <a>zig-http</a> | zig-0.11.0 | Basic example of a HTTP 1.1 server without any routing etc. |
| <a>zig-x11-box</a> | zig-0.11.0 | Move a box around with arrow keys with Xlib and Zig. |
| <a>zig-kv-store</a> | zig-0.11.0 | Simple Key-value store that mimics memcached written in Zig. |
| <a>zig-wad</a> | zig-0.11.0 | Reads doom.wad and extracts the identification header. |
| <a>zig-os-props</a> | zig-0.11.0 | Detects properties of the target operating system. |
| <a>zig-tlv-encoding</a> | zig-0.13.0 | Naive implementation of TLV encoding in Zig. |
| <a>zig-embed</a> | zig-0.13.0 | Embedding external resources in compiled binary. |
| <a>zig-struct-bin</a> | zig-0.13.0 | Save a struct into binary file and then reading it back. |
| <a>zig-elf</a> | zig-0.14.0 | Read execution header of Elf64 format in Zig. |
| <a>c-bluetooth</a> | clang-17 | Scans for all Bluetooth devices. |
| <a>d-x11</a> | dmd-2.110 | Uses X11 to create a basic window without any bindings needed. |
| <a>d-bmp-header</a> | dmd-2.110 | Reads BMP image header and prints the information out. |
| <a>c-luajit</a> | clang-19 | Testing execution speed of Lua vs Luajit vs embedded Luajit. |
| <a>c-embedding-data</a> | clang-19 | Embedding game assets to executable binary (with raylib). |
License
<a>probe</a> was written by <a>Mitja
Felicijan</a> and is released under the BSD
zero-clause license, see the LICENSE file for more information. | [] |
https://avatars.githubusercontent.com/u/112193680?v=4 | zig-river-config | nitrogenez/zig-river-config | 2024-06-05T21:31:10Z | River configuration with the power of a programming language. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/nitrogenez/zig-river-config/tags | BSD-3-Clause | [
"configuration",
"river",
"riverwm",
"utility",
"wayland",
"wayland-compositor",
"zig",
"zig-lang",
"zig-language",
"zig-library",
"zig-package",
"ziglang"
] | 22 | false | 2024-06-09T07:00:17Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/28966224?v=4 | escalator | weskoerber/escalator | 2024-05-23T02:36:36Z | A library for privelege-escalation written in Zig. | main | 1 | 1 | 0 | 1 | https://api.github.com/repos/weskoerber/escalator/tags | MIT | [
"zig",
"zig-package"
] | 4 | false | 2024-08-09T03:29:37Z | true | true | 0.12.0 | github | [] | Escalator
A library for privelege-escalation written in Zig.
Requirements
<ul>
<li><a>zig</a> compiler (<code>0.12.0</code> or newer)</li>
</ul>
Install
First, add the dependency to your <code>build.zig.zon</code> using <code>zig fetch</code>:
<code>console
zig fetch --save git+https://github.com/weskoerber/escalator#main</code>
Then, import <code>escalator</code> into your <code>build.zig</code>:
```zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
<code>const escalator = b.dependency("escalator", .{
.target = target,
.optimize = optimize,
}).module("escalator");
const my_exe = b.addExecutable(.{
.name = "my_exe",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
my_exe.root_module.addImport(escalator);
</code>
}
```
Usage
Documentation can be found at https://weskoerber.github.io/escalator. The docs
are generated by Zig's autodoc feature and deployed via Github Actions.
Also see the <code>examples</code> directory for example usage. Example executables can be
built by setting the <code>examples</code> option to <code>true</code>:
<code>zig
const mac_address = b.dependency("escalator", .{
.target = target,
.optimize = optimize,
.examples = true,
}).module("escalator");</code>
Acknowlegments
<ul>
<li><a>dns2utf8/sudo.rs</a></li>
</ul> | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.