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/434125?v=4 | zig-clay | ssttevee/zig-clay | 2025-03-09T02:54:21Z | clay bindings for zig | trunk | 0 | 2 | 0 | 2 | https://api.github.com/repos/ssttevee/zig-clay/tags | - | [
"clay",
"zig",
"zig-binding",
"ziglang"
] | 300 | false | 2025-03-13T09:42:23Z | true | true | 0.14.0 | github | [
{
"commit": "v0.13",
"name": "clay",
"tar_url": "https://github.com/nicbarker/clay/archive/v0.13.tar.gz",
"type": "remote",
"url": "https://github.com/nicbarker/clay"
},
{
"commit": "5d7c3e4171b3a4ea03d9a8cf18ee65fb65b03c9f",
"name": "raylib",
"tar_url": "https://github.com/Not-N... | zig-clay
This is my take on zig bindings for <a>clay</a>, inspired by https://codeberg.org/Zettexe/clay-zig.
The goal is to be as zig-idiomatic as possible, while being as close as possible to the original clay syntax and naming.
In general, all symbols that are originally prefixed with <code>Clay_</code> are translated to <code>clay.</code>.
All symbols prefixed with <code>clay.</code> are optimized for zig-idiomaticity, but may not all be bit-compatible with their C counter parts. Most notably, <code>clay.RenderCommand</code> and <code>clay.String</code>. In such cases, the bit-incompatible type will have a <code>asSlice()</code> (for <code>clay.String</code> and <code>clay.RenderCommandArray</code>) or a <code>toZig()</code> (for <code>clay.RenderCommand</code>, <code>clay.ScrollContainerData</code>, and <code>clay.ElementData</code>) helper method for converting to the zig-optimized variants, and a <code>fromSlice()</code> or a <code>fromZig()</code> helper method for converting to the c-compatible variants.
Using zig-clay in your own project
Run this command from your project folder
<code>sh
zig fetch --save git+https://github.com/ssttevee/zig-clay.git#{optional commit hash to pin version}</code>
Then add this snippet to your build.zig file
```zig
const clay = b.dependency("clay", .{
.optimize = optimize,
.target = target,
});
exe.root_module.addImport("clay", clay.module("clay"));
```
Examples
Examples can be found in the <code>examples</code> folder.
Renderers
Currently, only the raylib renderer bindings are available because it's the only library with a strong zig bindings package. If bindings for cairo or SDL become available, I'd be more than happy to add them. | [] |
https://avatars.githubusercontent.com/u/124872?v=4 | zig-common-access-token | jedisct1/zig-common-access-token | 2025-05-16T09:39:42Z | Zig implementation of Common Access Token (CTA-5007). | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/jedisct1/zig-common-access-token/tags | MIT | [
"access",
"cat",
"common",
"common-access-tokens",
"commonaccesstoken",
"cta",
"please-use-better-authentication-mechanisms",
"token",
"tokens",
"zig",
"zig-package"
] | 27 | false | 2025-05-19T08:35:36Z | true | false | unknown | github | [] | Common Access Token (CAT) for Zig
A Zig implementation of the Common Access Token (CAT) specification with HMAC signatures.
What is CAT?
Common Access Token (CAT) is a token format designed for authorization and authentication in distributed systems, particularly for media and content delivery applications. It provides a secure, compact, and efficient way to represent claims and authorization information between parties.
CAT is built on established standards:
- Based on <a>CBOR Web Token (CWT)</a> format
- Uses <a>CBOR Object Signing and Encryption (COSE)</a> for cryptographic operations
- Provides a binary alternative to JWT with smaller token sizes and more efficient processing
Overview
This library provides a complete implementation for generating and validating Common Access Tokens (CAT) using HMAC signatures. It is designed to be interoperable with other implementations like <a>node-cat</a> and <a>common-access-token</a>.
Key benefits of using CAT tokens:
- <strong>Compact</strong>: Binary format results in smaller token sizes compared to text-based formats
- <strong>Efficient</strong>: CBOR encoding/decoding is faster and requires less processing power
- <strong>Secure</strong>: Built on established cryptographic standards
- <strong>Extensible</strong>: Supports custom claims and extensions
Features
<ul>
<li><strong>Token Operations</strong>:</li>
<li>Generate CAT tokens with HMAC signatures (HS256)</li>
<li>Validate CAT tokens with comprehensive security checks</li>
<li>
Support for token expiration and time-based validation
</li>
<li>
<strong>Claims Support</strong>:
</li>
<li>Standard CWT claims (issuer, subject, audience, expiration, etc.)</li>
<li>CAT-specific claims (version, renewal, usage, data, authorization)</li>
<li>
Custom claim extension capability
</li>
<li>
<strong>CBOR Implementation</strong>:
</li>
<li>High-performance CBOR encoding/decoding</li>
<li>Support for all CBOR data types</li>
<li>Support for indefinite-length arrays, maps, and strings</li>
<li>Support for floating-point numbers</li>
<li>
Support for tagged values
</li>
<li>
<strong>Error Handling</strong>:
</li>
<li>Comprehensive error types</li>
<li>Detailed error messages</li>
<li>Error context information</li>
<li>
Error recovery mechanisms
</li>
<li>
<strong>Integration</strong>:
</li>
<li>Interoperability with other CAT implementations</li>
<li>Easy integration with Zig applications</li>
<li>Comprehensive documentation and examples</li>
</ul>
Installation
Add this library to your <code>build.zig.zon</code> file:
<code>zig
.dependencies = .{
.zig_cat = .{
.url = "https://github.com/yourusername/zig-cat/archive/refs/tags/v0.1.0.tar.gz",
.hash = "...",
},
},</code>
Then in your <code>build.zig</code>:
<code>zig
const zig_cat = b.dependency("zig_cat", .{
.target = target,
.optimize = optimize,
});
exe.addModule("cat", zig_cat.module("cat"));</code>
Usage
Token Generation
This example demonstrates how to create a CAT token with standard claims:
```zig
const std = @import("std");
const cat = @import("cat");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>// Create a key for token signing
const key_hex = "403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d79569388";
const key = try cat.util.hexToBytes(allocator, key_hex);
defer allocator.free(key);
// Create a map of keys
var keys = std.StringHashMap([]const u8).init(allocator);
defer keys.deinit();
try keys.put("Symmetric256", key);
// Create CAT options
const cat_options = cat.CatOptions{
.keys = keys,
.expect_cwt_tag = true,
};
// Create a CAT instance
var cat_instance = cat.Cat.init(allocator, cat_options);
defer cat_instance.deinit();
// Create claims
var claims = cat.Claims.init(allocator);
defer claims.deinit();
try claims.setIssuer("example");
try claims.setSubject("user123");
try claims.setAudience("service");
const now = cat.util.currentTimeSecs();
try claims.setExpiration(now + 120); // 2 minutes from now
try claims.setIssuedAt(now);
// Generate token
const token = try cat_instance.generate(claims, .{
.validation_type = cat.CatValidationType.Mac,
.alg = "HS256",
.kid = "Symmetric256",
.generate_cwt_id = true,
});
defer allocator.free(token);
std.debug.print("Generated token: {s}\n", .{token});
</code>
}
```
Token Validation
```zig
const std = @import("std");
const cat = @import("cat");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>// Create a key for token validation
const key_hex = "403697de87af64611c1d32a05dab0fe1fcb715a86ab435f1ec99192d79569388";
const key = try cat.util.hexToBytes(allocator, key_hex);
defer allocator.free(key);
// Create a map of keys
var keys = std.StringHashMap([]const u8).init(allocator);
defer keys.deinit();
try keys.put("Symmetric256", key);
// Create CAT options
const cat_options = cat.CatOptions{
.keys = keys,
.expect_cwt_tag = true,
};
// Create a CAT instance
var cat_instance = cat.Cat.init(allocator, cat_options);
defer cat_instance.deinit();
// Validate the token
var claims = try cat_instance.validate(token, cat.CatValidationType.Mac, .{
.issuer = "example",
.audience = null,
});
defer claims.deinit();
std.debug.print("Token is valid!\n", .{});
</code>
}
```
Examples
The library includes several ready-to-use examples in the <code>examples/</code> directory:
<ul>
<li><strong>generate.zig</strong>: Demonstrates basic token generation with standard claims</li>
<li><strong>validate.zig</strong>: Shows how to validate tokens and extract claims</li>
<li><strong>interop.zig</strong>: Tests interoperability with the NodeJS implementation</li>
<li><strong>cat_claims.zig</strong>: Demonstrates using CAT-specific claims for advanced use cases</li>
</ul>
To run an example:
```bash
Generate a token
zig build generate
Validate a token (replace with an actual token)
zig build validate --
Test interoperability with NodeJS implementation
zig build interop [-- ]
Use CAT-specific claims
zig build cat_claims
```
Security Considerations
When using CAT tokens in your applications, keep these security best practices in mind:
<ol>
<li><strong>Key Management</strong>:</li>
<li>Store signing keys securely</li>
<li>Rotate keys periodically</li>
<li>
Use different keys for different environments
</li>
<li>
<strong>Token Validation</strong>:
</li>
<li>Always validate tokens before trusting their contents</li>
<li>Check expiration times</li>
<li>
Verify the issuer and audience claims
</li>
<li>
<strong>Token Lifetime</strong>:
</li>
<li>Use short-lived tokens when possible</li>
<li>
For longer sessions, consider refresh token patterns
</li>
<li>
<strong>Claims</strong>:
</li>
<li>Only include necessary information in tokens</li>
<li>Be cautious with sensitive data in claims</li>
</ol>
Compatibility
This library is designed to be interoperable with other CAT implementations:
<ul>
<li><strong><a>node-cat</a></strong>: The NodeJS reference implementation</li>
<li><strong><a>common-access-token</a></strong>: The Rust implementation</li>
<li>Other implementations that follow the CAT specification</li>
</ul>
License
This project is licensed under the MIT License - see the LICENSE file for details. | [] |
https://avatars.githubusercontent.com/u/85748765?v=4 | VulkanMemoryAllocator | johan0A/VulkanMemoryAllocator | 2025-03-14T09:08:06Z | VulkanMemoryAllocator packaged for the Zig build system | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/johan0A/VulkanMemoryAllocator/tags | MIT | [
"zig",
"zig-library",
"zig-package"
] | 11 | false | 2025-04-28T19:13:40Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "VulkanMemoryAllocator",
"tar_url": "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator"
},
{
"commit": "68ab446d1fa0707bb7082c... | VulkanMemoryAllocator
This is <a>VulkanMemoryAllocator</a>,
packaged for the <a>Zig</a> build system.
how to use
<ol>
<li>Add <code>VulkanMemoryAllocator</code> to the dependency list in <code>build.zig.zon</code>: </li>
</ol>
<code>sh
zig fetch --save git+https://github.com/johan0A/VulkanMemoryAllocator#v3.2.1</code>
<ol>
<li>Config <code>build.zig</code>:</li>
</ol>
<code>zig
...
const vma_dep = b.dependency("VulkanMemoryAllocator", .{
.target = target,
.optimize = optimize,
});
your_compilation.linkLibrary("vma", vma_dep.artifact("VulkanMemoryAllocator"));
...</code> | [
"https://github.com/johan0A/VulkanMemoryAllocator"
] |
https://avatars.githubusercontent.com/u/587972?v=4 | unikraft-zig | tw4452852/unikraft-zig | 2025-04-22T08:01:26Z | Create an unikernel with Unikraft and Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/tw4452852/unikraft-zig/tags | - | [
"unikernel",
"unikraft",
"zig"
] | 11 | false | 2025-04-29T01:31:11Z | true | true | 0.14.0 | github | [] | Create an unikernel with Unikraft and Zig
Usage
<code>git clone --recurse-submodules https://github.com/tw4452852/unikraft-zig
cd unikraft-zig
make olddefconfig
make</code>
The generated image will be <code>./workdir/build/app-zig_qemu-x86_64</code>,
and you could run it with the qemu now (follow the instructions on https://unikraft.org/guides/internals#running).
<code>qemu-system-x86_64 -nographic -kernel ./workdir/build/app-zig_qemu-x86_64 -cpu qemu64,pdpe1gb</code>
You should see this:
<code>Booting from ROM..Powered by
o. .o _ _ __ _
Oo Oo ___ (_) | __ __ __ _ ' _) :_
oO oO ' _ `| | |/ / _)' _` | |_| _)
oOo oOO| | | | | (| | | (_) | _) :_
OoOoO ._, ._:_:_,\_._, .__,_:_, \___)
Helene 0.18.0~eabefb07-custom
Hi Zig
test.test.hello... sample test! PASS
1 passed, 0 skipped, 0 failed</code>
You could also specify test root file and test filter by <code>make menuconfig</code>
in <code>Application Options -> Zig app</code>.
Have fun!
Supported architectures
<ul>
<li><code>x86_64</code></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/100683661?v=4 | zprof | ANDRVV/zprof | 2025-05-10T19:34:43Z | ๐งฎ Cross-allocator profiler for Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/ANDRVV/zprof/tags | MIT | [
"allocator",
"memory",
"profiler",
"zig",
"zig-package",
"ziglang"
] | 18 | false | 2025-05-12T16:50:19Z | true | false | unknown | github | [] | zprof - A cross-allocator profiler for Zig
<strong>zprof</strong> is a lightweight, easy-to-use memory profiler that helps you track allocations, detect memory leaks, and logs memory changes.
๐ Table of Contents
<ul>
<li><a>zprof - A cross-allocator profiler for Zig</a></li>
<li><a>๐ Table of Contents</a></li>
<li><a>๐ฅ Installation</a><ul>
<li><a>Using a package manager (Recommended)</a></li>
</ul>
</li>
<li><a>๐ Quick Start</a></li>
<li><a>๐ Usage</a><ul>
<li><a>Basic Usage</a></li>
<li><a>Detecting Memory Leaks</a></li>
<li><a>Logging Options</a></li>
<li><a>Full Profiler API</a></li>
<li><a>Fields</a></li>
<li><a>Methods</a></li>
<li><a>Methods in logging</a></li>
</ul>
</li>
<li><a>๐ Examples</a><ul>
<li><a>Testing for Memory Leaks</a></li>
<li><a>Tracking Peak Memory Usage</a></li>
</ul>
</li>
</ul>
๐ฅ Installation
Using a package manager (Recommended)
Add <code>zprof</code> to your project's <code>build.zig.zon</code>:
<code>zig
.{
.name = "my-project",
.version = "0.1.0",
.dependencies = .{
.zprof = .{
.url = "https://github.com/ANDRVV/zprof/archive/v0.1.3.zip",
.hash = "...",
},
},
}</code>
Then in your <code>build.zig</code>, add:
```zig
// Add zprof as a dependency
const zprof_dep = b.dependency("zprof", .{
.target = target,
.optimize = optimize,
});
// Add the module to your executable
exe.root_module.addImport("zprof", zprof_dep.module("zprof"));
```
๐ Quick Start
Here's how to use <code>zprof</code> in three easy steps:
```zig
const std = @import("std");
const zprof = @import("zprof");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
<code>// 1. Create a profiler by wrapping your allocator
var prof = zprof.Zprof.init(&gpa.allocator, true); // true enables logging
// 2. Use the profiler's allocator instead of your original one
const allocator = prof.allocator;
// 3. Use the allocator as normal
const data = try allocator.alloc(u8, 1024);
defer allocator.free(data);
// Get memory stats
prof.profiler.sumLog(); // Logs a summary of memory usage
// Check for leaks
std.debug.print("Has leaks: {}\n", .{prof.profiler.hasLeaks()});
</code>
}
```
๐ Usage
Basic Usage
To start profiling memory usage, simply wrap your allocator with <code>Zprof</code>:
```zig
var prof = zprof.Zprof.init(&allocator, false); // false disables automatic logging
const tracked_allocator = prof.allocator;
// Use tracked_allocator wherever you would use your original allocator
```
Detecting Memory Leaks
<code>zprof</code> makes it easy to detect memory leaks in your application:
<code>zig
// At the end of your program or test
const has_leaks = prof.profiler.hasLeaks();
if (has_leaks) {
// Handle leaks (e.g., report, abort in tests)
std.debug.print("Memory leak detected!\n", .{});
prof.profiler.sumLog(); // Print detailed info about allocations
return error.MemoryLeak;
}</code>
Logging Options
<code>zprof</code> provides several logging functions to help you understand your application's memory usage:
```zig
// Log a complete summary of memory usage
prof.profiler.sumLog();
// Sample output:
// Zperf [*]: 2048 allocated-bytes=2048 alloc-times=1 free-times=0 live-bytes=2048 live-peak-bytes=2048
// Log just allocation and deallocation counts
prof.profiler.actionLog();
// Sample output:
// Zperf [*]: allocated-bytes=2048 alloc-times=1 free-times=0
// Log current memory usage
prof.profiler.liveLog();
// Sample output:
// Zperf [*]: live-bytes=2048 live-peak-bytes=2048
// Log specific allocation events (useful in custom allocators)
// Is called when logging from init is enabled
prof.profiler.allocLog(1024);
// Sample output:
// Zperf [+][myFunction]: allocated-now=1024
// Log specific deallocation events
// Is called when logging from init is enabled
prof.profiler.freeLog(1024);
// Sample output:
// Zperf [-][myFunction]: deallocated-now=1024
```
Full Profiler API
The <code>Profiler</code> struct contains several fields and methods:
Fields
| Field | Type | Description |
|-------|------|-------------|
| <code>allocated</code> | <code>u64</code> | Total bytes allocated since initialization |
| <code>alloc_count</code> | <code>u64</code> | Number of allocation operations |
| <code>free_count</code> | <code>u64</code> | Number of deallocation operations |
| <code>live_peak</code> | <code>u64</code> | Maximum memory usage at any point |
| <code>live_bytes</code> | <code>u64</code> | Current memory usage |
Methods
| Method | Description |
|--------|-------------|
| <code>hasLeaks()</code> | Returns <code>true</code> if there are memory leaks |
| <code>reset()</code> | Resets all profiling statistics |
| <code>sumLog()</code> | Logs a summary of all memory statistics |
| <code>actionLog()</code> | Logs allocation and deallocation counts |
| <code>liveLog()</code> | Logs current memory usage |
Methods in logging
| Method | Description |
|--------|-------------|
| <code>allocLog(size)</code> | Logs allocation from allocator calls |
| <code>freeLog(size)</code> | Logs deallocation from allocator calls |
๐ Examples
Testing for Memory Leaks
```zig
test "no memory leaks" {
var arena = std.heap.ArenaAllocator.init(std.testing.allocator);
defer arena.deinit();
<code>var prof = zprof.Zprof.init(&arena.allocator, false);
const allocator = prof.allocator;
// Perform allocations
const data = try allocator.alloc(u8, 1024);
defer allocator.free(data);
// Verify no leaks
try std.testing.expect(!prof.profiler.hasLeaks());
</code>
}
```
Tracking Peak Memory Usage
```zig
fn processLargeData(allocator: std.mem.Allocator, data: []const u8) !void {
var buffer = try allocator.alloc(u8, data.len * 2);
defer allocator.free(buffer);
<code>// Process data...
</code>
}
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
<code>var prof = zprof.Zprof.init(&gpa.allocator, false);
const allocator = prof.allocator;
const data = try loadData(allocator);
defer allocator.free(data);
try processLargeData(allocator, data);
// Log peak memory usage
std.debug.print("Peak memory usage: {} bytes\n", .{prof.profiler.live_peak});
</code>
}
```
Made with โค๏ธ for the Zig community | [] |
https://avatars.githubusercontent.com/u/177000224?v=4 | zli | mahiremirhan/zli | 2025-05-17T04:54:46Z | ๐ A blazing fast Zig CLI framework. Build ergonomic, high-performance command-line tools with ease. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/mahiremirhan/zli/tags | MIT | [
"api",
"c",
"compression",
"delphi",
"filter",
"gzip-decompression",
"image-editor",
"pascal",
"x509",
"zig",
"zig-package",
"zlib-ng",
"zlib-replacement",
"zlibrary"
] | 40 | false | 2025-05-22T07:54:00Z | true | true | 0.14.0 | github | [] | zli - A Blazing Fast Zig CLI Framework ๐
Welcome to the <strong>zli</strong> repository! This project provides a powerful framework for building command-line tools in Zig. With <strong>zli</strong>, you can create ergonomic and high-performance CLI applications with ease.
Table of Contents
<ol>
<li><a>Introduction</a></li>
<li><a>Features</a></li>
<li><a>Installation</a></li>
<li><a>Getting Started</a></li>
<li><a>Usage</a></li>
<li><a>Contributing</a></li>
<li><a>License</a></li>
<li><a>Links</a></li>
</ol>
Introduction
<strong>zli</strong> is designed to simplify the process of building command-line applications. Zig is a low-level programming language that emphasizes performance and safety. By leveraging Zig's strengths, <strong>zli</strong> allows developers to focus on functionality without worrying about the underlying complexities.
Features
<ul>
<li><strong>Fast Performance</strong>: Built on Zig's efficient compilation and execution model.</li>
<li><strong>Ergonomic Design</strong>: Intuitive API that makes it easy to create and manage commands.</li>
<li><strong>Modular Architecture</strong>: Easily extend functionality with custom modules.</li>
<li><strong>Rich Documentation</strong>: Comprehensive guides and examples to help you get started.</li>
<li><strong>Cross-Platform Support</strong>: Works on Windows, macOS, and Linux.</li>
</ul>
Installation
To get started with <strong>zli</strong>, you need to install the framework. Visit the <a>Releases</a> section to download the latest version. Follow the instructions to install and execute the framework.
Getting Started
After installing <strong>zli</strong>, you can create a new CLI application. Hereโs how:
<ol>
<li>Open your terminal.</li>
<li>Navigate to the directory where you want to create your project.</li>
<li>Run the following command to create a new project:</li>
</ol>
<code>bash
zli create my-cli-app</code>
<ol>
<li>Navigate into your new project directory:</li>
</ol>
<code>bash
cd my-cli-app</code>
<ol>
<li>Open the main source file in your favorite text editor.</li>
</ol>
Usage
Creating commands in <strong>zli</strong> is straightforward. Hereโs a simple example of how to define a command:
```zig
const std = @import("std");
const zli = @import("zli");
pub fn main() !void {
const app = zli.Application.init("my-cli-app", "1.0.0");
<code>app.command("greet", "Greet the user", greet);
try app.run();
</code>
}
fn greet(args: *zli.CommandArgs) !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello, {}!\n", .{args.get("name")});
}
```
Running Your Application
Once you have defined your commands, you can run your application from the terminal:
<code>bash
./my-cli-app greet --name="World"</code>
This will output:
<code>Hello, World!</code>
Contributing
We welcome contributions to <strong>zli</strong>! If you have suggestions, improvements, or bug fixes, please follow these steps:
<ol>
<li>Fork the repository.</li>
<li>Create a new branch for your feature or fix.</li>
<li>Make your changes and commit them.</li>
<li>Push your branch to your fork.</li>
<li>Open a pull request.</li>
</ol>
Please ensure your code adheres to the project's coding standards and includes tests where applicable.
License
<strong>zli</strong> is licensed under the MIT License. See the <a>LICENSE</a> file for more details.
Links
For more information and updates, check the <a>Releases</a> section. You can find the latest downloads and version updates there.
Feel free to explore the repository, contribute, and enhance your command-line tool development experience with <strong>zli</strong>! | [] |
https://avatars.githubusercontent.com/u/23480513?v=4 | patch | cbilz/patch | 2025-02-18T22:46:46Z | Zig package for applying patches to files | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/cbilz/patch/tags | MIT | [
"build-system",
"diff",
"git",
"patch",
"zig",
"zig-package"
] | 358 | false | 2025-03-06T14:25:50Z | false | false | unknown | github | [] | Zig package for applying patches to files
Work in progress. Feedback is welcome!
Goal
This project will provide a Zig package for applying diffs in Git and unified
formats to directory trees or individual files. It will be free of system
dependencies by default while allowing integration with Git or GNU patch when
needed.
Motivation
One use case for this package will be to enable building C and C++ projects from
pristine tarballs while applying patches for the host system, bug fixes, or
other reasons. This approach is more transparent to dependents compared to
building from a forked version of the upstream source.
Rationale
The package will expose <strong>outputs as artifacts</strong> (via <code>b.addNamedLazyPath(...)</code>)
and accept <strong>inputs as options</strong> (via <code>b.option(LazyPath, ...)</code>), following <a>the
intended
approach</a>.
Internally, the package will use <strong><code>std.Build.Step.Run</code></strong> instead of custom build
steps in preparation for the <a>separation of the build runner from the configure
process</a>.
By default, the package will use its <strong>own <code>patch</code> implementation</strong> to help
dependents reduce their system dependencies. Every system dependency removed
makes it easier to onboard new contributors.
However, there will also be options (via <code>b.systemIntegrationOption(...)</code>) to
<a><strong>use the system packages</strong></a> Git or
GNU patch when appropriate, such as when packaging or when build times or
compatibility are of concern.
Next steps
<ol>
<li>Complete implementation and review resource management:<ul>
<li>Ensure a small number of file descriptors are open at any time.</li>
<li>Delete temporary directories on exit.</li>
<li>Clean up output directories in case of errors.</li>
</ul>
</li>
<li>Create a test build step.</li>
<li>Add additional test cases to check the following behaviors:<ul>
<li>Correct handling of quote wrapped paths.</li>
<li>Correct handling of patches with junk text between a hunk and the next
header.</li>
<li>Rejection of invalid paths (both wrapped and unwrapped).</li>
<li>Rejection of empty patches.</li>
<li>Rejection of patches without any headers.</li>
<li>Rejection of invalid headers.</li>
<li>Rejection of invalid hunks.</li>
<li>Rejection of multiple changes to the same file within a single Git patch.</li>
</ul>
</li>
<li>Fix bugs.</li>
<li>Implement the remaining characteristics described in the
<a>Rationale</a>.</li>
<li>Update this README.</li>
<li>Tag a release.</li>
</ol>
Requirements
Uses Zig 0.14.0-dev.3462+edabcf619. | [] |
https://avatars.githubusercontent.com/u/3088277?v=4 | zig-nn | thevilledev/zig-nn | 2025-03-13T19:51:10Z | A lightweight neural network library implemented in Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/thevilledev/zig-nn/tags | MIT | [
"learning",
"neural-networks",
"zig",
"zig-package"
] | 144 | false | 2025-04-08T10:53:44Z | true | true | 0.14.0 | github | [] | Neural Network in Zig
<a></a>
A minimalistic neural network implementation in Zig for learning purposes. This project focuses on understanding the fundamentals of neural networks including hidden layers, activation functions, and basic training processes.
Features
<ul>
<li>Matrix operations from scratch</li>
<li>Common activation functions (Sigmoid, Linear, ReLU, Tanh)</li>
<li>Advanced activation functions (Swish, GLU, SwiGLU)</li>
<li>Basic feed-forward neural network architecture</li>
<li>Support for gated architectures used in modern transformer models</li>
</ul>
See <a>examples</a>.
Documentation
Detailed documentation is available in the <code>docs</code> directory:
- <a>Neural Network Architecture</a> - Design principles and implementation details
- <a>Advanced Activation Functions</a> - Detailed information about activation functions
Building
Make sure you have Zig installed on your system. This project is developed with the latest stable version of Zig.
For convenience, a Makefile is provided with common operations:
```bash
Build and run everything (build, test, examples)
make
Run specific examples, for example:
make example-simple-xor
Build with different optimization modes
make BUILD_MODE=ReleaseFast
make release # Build with ReleaseSafe mode
See all available commands
make help
```
Testing
The project includes a comprehensive test suite to verify the functionality of all components. The build system is configured to run tests for each module sequentially, making it easy to identify which component has issues.
```bash
Run all tests
make test
Run tests for specific components, for example:
zig build test-matrix # Run matrix operation tests
zig build test-activation # Run activation function tests
zig build test-layer # Run neural network layer tests
zig build test-network # Run full network tests
```
Learning Goals
This project serves as a learning exercise for:
<ul>
<li>Understanding neural network fundamentals</li>
<li>Implementing mathematical operations in Zig</li>
<li>Working with Zig's memory management and error handling</li>
</ul>
License
MIT License | [] |
https://avatars.githubusercontent.com/u/51416554?v=4 | shuffling-allocator.zig | hendriknielaender/shuffling-allocator.zig | 2025-02-11T14:14:15Z | a shuffling allocator | main | 5 | 2 | 0 | 2 | https://api.github.com/repos/hendriknielaender/shuffling-allocator.zig/tags | MIT | [
"allocator",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 48 | false | 2025-03-14T22:08:04Z | true | true | unknown | github | [] | shuffling-allocator.zig
The <strong>ShufflingAllocator</strong> package provides a type that wraps an existing allocator and shuffles the order of heap allocations, effectively randomizing the placement of heap-allocated memory. This randomization is useful for testing, benchmarking, and performance evaluation, allowing you to decouple the effects of memory locality from performance metrics during code optimization or profiling.
Features
<ul>
<li><strong>Heap Allocation Shuffling</strong>: Randomizes the placement of heap allocations to avoid accidental memory locality, reducing cache effects during performance testing.</li>
<li><strong>Concurrency Support</strong>: Designed to support multi-threaded environments while maintaining proper synchronization using mutexes.</li>
<li><strong>Customizable Randomization</strong>: Uses a global random state to shuffle allocations across different size classes, enhancing the reliability of performance tests.</li>
<li><strong>Raw Memory Management</strong>: Provides custom alloc, free, resize, and remap methods adhering to the Zig standard library's allocator interface.</li>
</ul>
Use Cases
<ul>
<li><strong>Performance Testing</strong>: Separate the impact of memory locality from other performance factors when benchmarking code changes.</li>
<li><strong>Memory Management Research</strong>: Experiment with different allocation patterns and their impact on system performance.</li>
<li><strong>Randomization for Debugging</strong>: Randomize heap allocations to test for latent bugs or memory-related issues that depend on specific memory layouts.</li>
</ul>
<strong>Note on Security Use Cases</strong>
While randomizing heap allocation addresses certain memory access patterns that could influence performance, this package is <strong>not</strong> designed for security purposes (e.g., as a substitute for Address Space Layout Randomization (ASLR)). If you're looking for a solution focused on security hardening, this package may not meet your needs due to design choices that prioritize performance over security.
Installation
To use this package in your Zig project, you can simply import it:
<code>zig
const ShufflingAllocator = @import("shuffling_allocator").ShufflingAllocator;</code>
API Reference
This is the primary type in this package, implementing the standard <code>std.mem.Allocator</code> interface, with the following methods:
<ul>
<li><code>alloc</code>: Allocates memory with randomized placement. If the memory size is too large for shuffling, it falls back to standard allocation.</li>
<li><code>free</code>: Frees the memory, also randomizing its location in the heap.</li>
<li><code>resize</code>: Resizes the allocated memory without applying shuffling.</li>
<li><code>remap</code>: Remaps the memory without applying shuffling.</li>
</ul>
Inspired by https://github.com/fitzgen/shuffling-allocator | [] |
https://avatars.githubusercontent.com/u/30945458?v=4 | GradleZigBuild | FalsePattern/GradleZigBuild | 2025-05-04T21:59:58Z | A gradle plugin for integrating with the zig build system and zig toolchain management. | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/FalsePattern/GradleZigBuild/tags | NOASSERTION | [
"gradle",
"gradle-kotlin-dsl",
"gradle-plugin",
"gradle-zig",
"zig",
"ziglang"
] | 100 | false | 2025-05-07T09:17:35Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/533849?v=4 | mcgain | wnkz/mcgain | 2025-03-05T20:56:05Z | A simple command-line tool to control audio device volume levels on macOS | main | 1 | 2 | 0 | 2 | https://api.github.com/repos/wnkz/mcgain/tags | Apache-2.0 | [
"coreaudio",
"macos",
"zig"
] | 17 | false | 2025-05-16T13:13:40Z | true | true | 0.14.0 | github | [] | ๐ค mcgain
A simple command-line tool to control audio device volume levels on macOS.
<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>
This is my first project written in Zig. While I'm learning the language and trying to follow best practices, there might be some non-idiomatic code.
</blockquote>
โจ Features
<ul>
<li>List available audio devices</li>
<li>Get volume levels for input/output channels</li>
<li>Set volume levels for input/output channels</li>
<li>Support for both scalar (0-1) and decibel values</li>
</ul>
Prerequisites
<ul>
<li>macOS (uses CoreAudio)</li>
<li>Zig 0.13.0 or later</li>
</ul>
Installation
<code>bash
git clone https://github.com/wnkz/mcgain.git
cd mcgain
zig build</code>
The binary will be available at <code>zig-out/bin/mcgain</code>
๐ Usage
List available devices
<code>bash
mcgain ls</code>
Get volume levels
<code>bash
mcgain get-levels # Show volume levels in scalar (0-1)
mcgain get-levels -d # Show volume levels in decibels
mcgain get-levels -n # Show device names</code>
Set volume levels
<code>bash
mcgain set-levels <device_id> <in|out> <value> # Set volume using scalar (0-1)
mcgain set-levels -d <device_id> <in|out> <value> # Set volume using decibels
mcgain set-levels -n "Device Name" <in|out> <value> # Set volume by device name</code>
Building from source
<code>bash
zig build # Build the project
zig build run # Build and run</code>
License
This project is licensed under the Apache License 2.0 - see the <a>LICENSE</a> file for details.
Acknowledgments
<ul>
<li>Written in <a>Zig</a></li>
<li>Uses macOS CoreAudio Framework</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/208390463?v=4 | SystemElva | SystemElva/SystemElva | 2025-03-25T16:13:44Z | A hobbyist OS project designed to fit on a 1.44 MiB floppy diskette. | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/SystemElva/SystemElva/tags | MIT | [
"bootloader",
"hobby-os",
"kernel",
"operating-system",
"os",
"zig",
"zig-package"
] | 140 | false | 2025-05-18T15:17:31Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/823099?v=4 | maxminddb.zig | marselester/maxminddb.zig | 2025-02-14T00:32:15Z | MaxMind DB format reader in Zig. | master | 0 | 2 | 2 | 2 | https://api.github.com/repos/marselester/maxminddb.zig/tags | ISC | [
"maxmind",
"maxmind-db",
"zig",
"zig-package"
] | 73 | false | 2025-05-12T15:26:54Z | true | true | unknown | github | [] | Zig MaxMind DB Reader
This Zig package reads the <a>MaxMind DB format</a>.
It's based on <a>maxminddb-rust</a> implementation.
You'll need <a>MaxMind-DB/test-data</a> to run examples and tests.
<code>sh
$ git submodule update --init
$ zig build test
$ zig build example_lookup
zh-CN = ็ๅ
ธ
de = Schweden
pt-BR = Suรฉcia
es = Suecia
en = Sweden
ru = ะจะฒะตัะธั
fr = Suรจde
ja = ในใฆใงใผใใณ็ๅฝ</code>
Quick start
Add maxminddb.zig as a dependency in your <code>build.zig.zon</code>.
<code>sh
$ zig fetch --save git+https://github.com/marselester/maxminddb.zig#master</code>
Add the <code>maxminddb</code> module as a dependency in your <code>build.zig</code>:
<code>zig
const mmdb = b.dependency("maxminddb", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("maxminddb", mmdb.module("maxminddb"));</code>
See <a>examples</a>. | [] |
https://avatars.githubusercontent.com/u/146390816?v=4 | kcov | allyourcodebase/kcov | 2025-04-28T19:32:14Z | kcov ported to the zig build system | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/allyourcodebase/kcov/tags | GPL-2.0 | [
"zig",
"zig-package"
] | 12 | false | 2025-05-15T10:33:40Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "kcov",
"tar_url": "https://github.com/SimonKagstrom/kcov/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/SimonKagstrom/kcov"
},
{
"commit": "6c72830882690c1eb2567a537525c3f432c1da50",
"name": "zlib",
"tar_url": "https://github.c... | <a></a>
Kcov
This is <a>Kcov</a>, packaged for <a>Zig</a>. | [
"https://github.com/allyourcodebase/kcov"
] |
https://avatars.githubusercontent.com/u/48999343?v=4 | csscolorparser-zig | sorairolake/csscolorparser-zig | 2025-04-28T02:28:10Z | Zig CSS color parser library | develop | 0 | 2 | 1 | 2 | https://api.github.com/repos/sorairolake/csscolorparser-zig/tags | Apache-2.0 | [
"color",
"css",
"css-color",
"hsl",
"hwb",
"oklab",
"oklch",
"parser",
"rgb",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 85 | false | 2025-05-12T16:44:16Z | true | true | 0.14.0 | github | [] |
csscolorparser-zig
<a></a>
<strong>csscolorparser-zig</strong> is a <a>Zig</a> library for parsing CSS color string as
defined in the W3C's <a>CSS Color Module Level 4</a>.
Usage
Add this package to your <code>build.zig.zon</code>:
<code>sh
zig fetch --save git+https://github.com/sorairolake/csscolorparser-zig.git</code>
Add the following to your <code>build.zig</code>:
<code>zig
const csscolorparser = b.dependency("csscolorparser", .{});
exe.root_module.addImport("csscolorparser", csscolorparser.module("csscolorparser"));</code>
Supported color formats
<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>Named colors</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> <a>RGB hexadecimal notations</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> 6 digits (<code>#RRGGBB</code>)
<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> 8 digits (<code>#RRGGBBAA</code>)
<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> 3 digits (<code>#RGB</code>)
<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> 4 digits (<code>#RGBA</code>)
<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> [<code>rgb()</code> and <code>rgba()</code>]
<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> [<code>hsl()</code> and <code>hsla()</code>]
<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> [<code>hwb()</code>]
<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><code>lab()</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><code>lch()</code></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> <a><code>oklab()</code></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> <a><code>oklch()</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> [<code>color()</code>]
Documentation
To build the documentation:
<code>sh
zig build doc</code>
The result is generated in <code>zig-out/doc/csscolorparser</code>.
If you want to preview this, run a HTTP server locally. For example:
<code>sh
python -m http.server -d zig-out/doc/csscolorparser</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/csscolorparser-zig.git</a>.
Changelog
Please see <a>CHANGELOG.adoc</a>.
Contributing
Please see <a>CONTRIBUTING.adoc</a>.
Acknowledgment
This library is ported from both the [<code>csscolorparser</code>] crate in <a>Rust</a> and the
[<code>github.com/mazznoer/csscolorparser</code>] package in <a>Go</a>.
The <code>csscolorparser</code> crate v0.7.0 is distributed under the terms of either the
Apache License 2.0 or the MIT License, and the
<code>github.com/mazznoer/csscolorparser</code> package v0.1.5 is distributed under the
terms of the MIT License.
License
Copyright (C) 2025 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/150533238?v=4 | zigport | mmycin/zigport | 2025-03-16T19:24:11Z | A CLI tool that automatically generates TypeScript FFI bindings for Zig libraries, making it easy to call Zig functions from JavaScript/TypeScript in Bun projects | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/mmycin/zigport/tags | MIT | [
"bun-ffi",
"cli",
"ffi",
"generator",
"zig",
"zig-ffi"
] | 33 | false | 2025-04-14T18:47:54Z | false | false | unknown | github | [] | Zigport
<code>zigport</code> is an NPM package as well as a command-line tool that automates the generation of TypeScript Foreign Function Interface (FFI) bindings for <strong>Zig</strong> libraries created by Tahcin Ul Karim (Mycin). It simplifies the process of calling Zig functions from JavaScript/TypeScript, making it an excellent choice for <strong>Bun</strong>-based projects that require high-performance Zig functions. Yes, you can now summon Zig speed into your Bun app without breaking a sweat!
Why zigport?
<ul>
<li><strong>Automated Zig FFI Binding Generation</strong>: No need to manually write bindings; <code>zigport</code> does the heavy lifting for you.</li>
<li><strong>Seamless Integration with Bun</strong>: Works like magic with Bunโs FFI capabilities.</li>
<li><strong>Efficient Type Mapping</strong>: Zig types get mapped to TypeScript with zero headaches.</li>
<li><strong>Simple CLI Interface</strong>: Generate and clean bindings with a single command. No over-engineered nonsense.</li>
</ul>
Installation
You can install <code>zigport</code> globally using <code>npm</code>, <code>yarn</code>, or <code>bun</code>:
```bash
Using npm
npm install -g zigport
Using yarn
yarn global add zigport
Using bun
bun add -g zigport
```
Getting Started
1. Set Up Your Project
Create a <code>lib/</code> directory in your project root. This is where the magic happens.
<code>bash
mkdir -p lib/zig</code>
2. Write Your Zig Code
Inside <code>lib/zig/</code>, create a Zig source file (e.g., <code>hello.zig</code>) with the following content:
```zig
const std = @import("std");
export fn say_hello() void {
std.debug.print("Hello, {s}!\n", .{"World"});
}
```
3. Generate Bindings
Now, let <code>zigport</code> do its thing:
<code>bash
zigport generate lib/</code>
This will:
- Compile Zig files into dynamic libraries (<code>.so</code>, <code>.dll</code>, <code>.dylib</code> depending on your platform).
- Generate TypeScript FFI bindings.
- Create an <code>index.ts</code> file inside <code>lib/</code>.
4. Use Zig Functions in TypeScript
Once the bindings are generated, import and use them in your TypeScript code:
```typescript
import { sayHello } from "./lib";
sayHello();
```
5. Run it!
Note that for now it only supports <strong>Bun</strong>, but weโre working on supporting Deno and Node.js. For this, you'll need Bun installed on your machine.
Install Bun using <code>npm</code>, <code>yarn</code>, or <code>bun</code>:
<code>bash
npm install -g bun</code>
Now run the file.
<code>bash
bun run fileName.ts</code>
Boom. Zig-powered performance, Bun simplicity. Lifeโs good.
CLI Commands
<code>zigport generate <path></code>
Generates Zig FFI bindings and compiles Zig files into dynamic libraries.
<code>bash
zigport generate lib/</code>
<code>zigport clean</code>
Removes generated files, including compiled Zig libraries and TypeScript bindings.
<code>bash
zigport clean</code>
<code>zigport help</code>
Displays the help menu with available commands.
<code>bash
zigport help</code>
Advanced Usage
Passing and Returning Numbers
Zig can return numbers, making complex calculations lightning-fast.
Zig Code (<code>math.zig</code>):
<code>zig
export fn add_numbers(a: i32, b: i32) i32 {
return a + b;
}</code>
Generate bindings:
<code>bash
zigport generate lib/</code>
TypeScript Usage:
```typescript
import { addNumbers } from "./lib";
console.log("5 + 3 =", addNumbers(5, 3));
```
Passing and Returning Strings
Zig can return strings too! But memory management is your responsibility.
Zig Code (<code>string_utils.zig</code>):
```zig
const std = @import("std");
export fn greet(name: [<em>]const u8) [</em>]const u8 {
const message = "Hello, " ++ name ++ "!";
return message;
}
```
Generate bindings:
<code>bash
zigport generate lib/</code>
TypeScript Usage:
```typescript
import { greet } from "./lib";
console.log(greet("Alice"));
```
Zig just greeted Alice from TypeScript. Mind-blowing, right?
Troubleshooting
1. <code>zigport</code> fails to generate bindings
<ul>
<li>Ensure that <strong>Zig</strong> is installed.</li>
<li>Check that the <code>lib/zig/</code> directory contains valid Zig files.</li>
<li>Run <code>zig build</code> inside <code>lib/zig/</code> to diagnose compilation issues.</li>
</ul>
2. TypeScript FFI calls fail
<ul>
<li>Ensure that the Zig functions are properly exported using <code>export</code>.</li>
<li>Verify that the correct function signatures are used in TypeScript.</li>
</ul>
3. Dynamic libraries are not loading
<ul>
<li>On <strong>Windows</strong>, ensure that <code>.dll</code> files are in the correct directory.</li>
<li>On <strong>macOS</strong>, use <code>install_name_tool</code> to set the correct library paths.</li>
<li>On <strong>Linux</strong>, check <code>LD_LIBRARY_PATH</code>.</li>
</ul>
Example Project
Hereโs a simple Bun project using <code>zigport</code>:
Directory Structure
<code>my-project/
โโโ lib/
โ โโโ zig/
โ โ โโโ hello.zig
โ โ โโโ math.zig
โ โ โโโ string_utils.zig
โ โ โโโ build.zig
โโโ src/
โ โโโ main.ts
โโโ package.json</code>
<code>main.ts</code>
```typescript
import { sayHello, addNumbers, greet } from "../lib";
sayHello("zigport User");
console.log(addNumbers(10, 20));
console.log(greet("Bob"));
```
Contributing
Love <code>zigport</code>? Want to make it even better? Feel free to open issues or submit pull requests on GitHub. If <code>zigport</code> saved you hours of headache, consider buying us a virtual coffee โ๏ธ!
License
This project is licensed under the MIT License. See the <a>LICENSE</a> file for details.
Note: Also, check out <a>RustPort</a> โ a similar tool that generates TypeScript FFI bindings for Rust libraries. Because Rust needs love too! | [] |
https://avatars.githubusercontent.com/u/65524156?v=4 | ClockHelper-zig | RecursiveError/ClockHelper-zig | 2025-03-23T19:48:04Z | ClockHelper is a utility to facilitate clock management on STM32 microcontrollers. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/RecursiveError/ClockHelper-zig/tags | MIT | [
"embedded",
"stm32",
"zig",
"zig-package"
] | 2,254 | false | 2025-04-06T12:28:58Z | true | true | 0.14.0 | github | [] | ClockHelper
ClockHelper is a utility to facilitate clock management on STM32 microcontrollers.
usage
To use it, it's very simple:
Choose a controller from the <a>list</a>:
```zig
const ClockHelper = @import("ClockHelper");
const STM32F103x = ClockHelper.@"STM32F103C(8-B)Tx";
```
Create a clock using the settings you want to use:
<code>zig
const config = STM32F103x.Config{};
const Clock = STM32F103x.ClockTree.init_comptime(config);</code>
And that's it, ClockHelper will give you the clock value of each peripheral for this setting, and it will also warn you if a setting is invalid!
```zig
const std = @import("std");
const ClockHelper = @import("ClockHelper");
const STM32F103x = ClockHelper.@"STM32F103C(8-B)Tx";
const config = STM32F103x.Config{};
const Clock = STM32F103x.ClockTree.init_comptime(config);
const conf_text = ClockHelper.print_clock_configs(config);
pub fn main() !void {
std.debug.print("Corrent Config:\n{s}\n", .{conf_text.*});
<code>std.debug.print(
\\Corrent OutClocks:
\\SysClock: {d}Mhz
\\AHB Clock: {d}Mhz
\\APB1 Clock: {d}Mhz
\\APB2 Clock: {d}Mhz
\\
, .{
(Clock.SysCLKOutput.get_comptime() / 1_000_000),
(Clock.AHBOutput.get_comptime() / 1_000_000),
(Clock.APB1Output.get_comptime() / 1_000_000),
(Clock.APB2Output.get_comptime() / 1_000_000),
});
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/29697678?v=4 | logex | ross-weir/logex | 2025-04-30T14:23:51Z | logex is a drop-in zig std.log extensions library enabling extra functionality/customization | main | 2 | 2 | 0 | 2 | https://api.github.com/repos/ross-weir/logex/tags | - | [
"logging",
"zig",
"ziglang"
] | 52 | false | 2025-05-16T03:27:21Z | true | true | 0.14.0 | github | [] | Logex
<a></a>
<code>logex</code> (log extensions) is a minimal, extensible logging library for Zig that enhances <code>std.log</code> with additional features while maintaining a simple, drop-in interface.
Features
<ul>
<li><strong>Drop-in Extension</strong>: Extends <code>std.log</code> with extra features - easy to add and remove without changing logging calls throughout your project</li>
<li><strong>Extensible Appenders</strong>: Comes with console and file appenders, with the ability to implement custom appenders for any logging destination</li>
<li><strong>Customize Formatting</strong>: Multiple format options:</li>
<li>Text (compatible with <code>std.log</code> default format)</li>
<li>JSON</li>
<li>Custom (implement your own formatting function)</li>
<li><strong>Minimal Impact</strong>: <code>logex</code> aims to add minimal overhead by remaining comptime as much as possible like the default <code>std.log</code> implementation.</li>
</ul>
Install
Add <code>logex</code> as a dependency to your zig project like so:
<code>bash
zig fetch --save git+https://github.com/ross-weir/logex.git</code>
And configure it in your <code>build.zig</code>:
```zig
// .. snip
const logex = b.dependency("logex", .{
.target = target,
.optimize = optimize,
});
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{
.name = "logex",
.module = logex.module("logex"),
},
},
});
```
Quick Start
```zig
const std = @import("std");
const logex = @import("logex");
// Create appender types
// Log to the console at debug and above levels, using default text formatting
const ConsoleAppender = logex.appenders.Console(.debug, .{});
// Log to file at info and above levels, using JSON formatting
const FileAppender = logex.appenders.File(.info, .{
.format = .json,
});
// Create logger type with both appender types
const Logger = logex.Logex(.{ ConsoleAppender, FileAppender });
// Use in std_options
pub const std_options: std.Options = .{
.logFn = Logger.logFn,
};
pub fn main() !void {
// Initialize appender instances
const console_appender = ConsoleAppender.init;
const file_appender = try FileAppender.init("app.log");
<code>// Initialize logger
try Logger.init(.{}, .{ console_appender, file_appender });
// Use std.log as usual
// Debug message will only be displayed on console
std.log.debug("Debug message", .{});
// Info message will be logged to file and console
std.log.info("Info message", .{});
</code>
}
```
Removing <code>logex</code> is as simple as removing <code>Logger.logFn</code> and deleting initialzation.
Appenders
<code>logex</code> comes with two built-in appenders:
<ul>
<li><strong>Console Appender</strong>: Logs to <code>stderr</code>, works the same as the default <code>logFn</code> from <code>std.log</code></li>
<li><strong>File Appender</strong>: Logs to file</li>
</ul>
Creating Custom Appenders
You can create custom appenders by implementing the <code>Appender</code> interface:
```zig
const logex = @import("logex");
const MyCustomAppender = struct {
pub fn log(
self: <em>@This(),
comptime record: </em>const logex.Record,
context: *const logex.Context,
) !void {
// Implement your logging logic
}
};
```
See a more complete example <a>here</a>.
Formatting
<code>logex</code> supports multiple output formats:
<ul>
<li><strong>Text</strong>: Default format compatible with <code>std.log</code></li>
<li><strong>JSON</strong>: Structured logging in JSON format</li>
<li><strong>Custom</strong>: Implement your own formatting function</li>
</ul>
See a complete example using a custom formatter <a>here</a>.
Examples
Check out the <a>example</a> directory for complete usage examples. | [] |
https://avatars.githubusercontent.com/u/37661824?v=4 | tcp-ip | LvMalware/tcp-ip | 2025-02-14T22:41:12Z | User-space implementation of the TCP/IP stack using Linux TAP interface | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/LvMalware/tcp-ip/tags | - | [
"arp",
"ethernet-protocol",
"icmp",
"internet-protocol",
"network",
"network-programming",
"tcp",
"zig"
] | 254 | false | 2025-03-21T22:50:02Z | true | false | unknown | github | [] | TCP/IP
What is this?
This is a user-land implementation of the TCP/IP protocol using the Linux TAP interface. The goal was to have a deeper understanding about TCP/IP and other network protocols by implementing them myself. It also seemed like an interesting project to exercise Zig programming. I started by following <a>this</a> guide and then filled the missing parts by reading the related RFCs.
How to run it
You will need <a>Zig</a> (version 0.14.0) to build.
```
Clone project
git clone https://github.com/LvMalware/tcp-ip
cd into the folder
cd tcp-ip/
build project
zig build
Add <code>cap_net_admin</code> capability to the file:
sudo setcap cap_net_admin=ep zig-out/bin/stack
Run the executable
./zig-out/bin/stack
```
By default, the tap interface will have the IP <code>10.0.0.4</code> and the program will run a TCP echo server listenning on port <code>5501</code>. Now you can use a tcp client like netcat to interact with it.
<code>nc 10.0.0.4 5501</code>
Implemented
Basics of:
- Ethernet
- IP functionality
- ICMP echo (ping)
- ARP request/response
- TCP functionality (connection, retransmission, etc.)
Missing/TODO
<ul>
<li>
Handle Urgent data on the TCP
</li>
<li>
Implement IP options and fragmentation
</li>
<li>
Implement timeouts
</li>
<li>
Many more
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/94462076?v=4 | image-builder | lumi2021/image-builder | 2025-02-11T02:03:05Z | A very tiny library that I made for generating disk images in the zig build script. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/lumi2021/image-builder/tags | MIT | [
"build-tool",
"disk-image",
"osdev",
"zig",
"zig-library",
"ziglang"
] | 4,765 | false | 2025-05-18T16:50:11Z | true | false | unknown | github | [] | LUMI's Image Building Steps for Zig;
This is a very tiny library that I made for generating disk images
in the zig build script.
It is fully written in zig and completelly system-independent.
How to settup it in your project:
<ol>
<li>Clone this repository;</li>
<li>Copy the <code>image-builder/</code> directory inside your project's root or dependency directory;</li>
<li>See the documentation about how to use it.</li>
</ol>
Content and Documentation:
Inside <code>image-builder/</code> there are 2 itens:
<code>image-builder/
|-- main.zig -- Main namespace interface
'-- .src/ -- Implementation of the library</code>
You should only import <code>main.zig</code> and never directly use anything inside
<code>.src/</code> if you don't know exactly what you're doing!
In your build script, create a reference for <code>imageBuilder.zig</code> as follows:
<code>zig
const imageBuilder = @import("image-builder/main.zig");</code>
Also create references for important constants:
<code>zig
const KiB = imageBuilder.size_constants.KiB; // 1 KiB in sectors size
const MiB = imageBuilder.size_constants.MiB; // i MiB in sectors size
const GPTr = imageBuilder.size_constants.GPT_reserved_sectors; // GPT reserved sectors</code>
You can create a GPT disk by calling the <code>addBuildGPTDiskImage()</code> function.
It returns a <code>Disk</code> structure that contains the build step and some usefull
functions to manipulate it data:
<code>zig
const disk = imageBuilder.addBuildGPTDiskImage(
b, // The `*Build` reference
20*MiB, // The size of the disk, in sectors
"mydisk.img" // The image file name, relative to `zig-out`
);</code>
To create a partition inside the disk, you can call tha function <code>addPartition()</code> in
the disk instance. Notice that you need togive to it a path to a directory. This
directory is the source of the content of the partition, relative to the project root
directory:
<code>zig
disk.addPartition(
.FAT, // The file system
"Main", // The partition label
"disk-data", // The source directory
20*MiB - GPTr // The partition size
);</code>
and at the end, don't forget to link the disk creation step with some already
existent:
<code>zig
build_step.dependOn(&disk.step);
// or
b.default_step = &disk.step;</code>
<strong>For more information about how to use the tool, check <a>build.zig</a> or the module files!</strong>
Development Status:
<code>Version: 1.0</code>
<code>| Disk Type | Implemented | Tested |
|--------------|-------------|--------|
| GPT | ๐ฉ | โ ๏ธ |
| MBR | ๐ด | ๐ด |
| Hybrid | ๐ด | ๐ด |
| Free | ๐ด | ๐ด |</code>
<code>| File Systems | Implemented | Tested |
---------------|-------------|--------|
| vFAT | ๐ฉ | โ ๏ธ |
| Ext2 | ๐ด | ๐ด |
| Ext3 | ๐ด | ๐ด |
| Ext4 | ๐ด | ๐ด |
| NTFS | ๐ด | ๐ด |
| Btrfs | ๐ด | ๐ด |
| ISO 9660 | ๐ด | ๐ด |</code>
<blockquote>
obs: disk types and file systems listed here are planned to be added at some moment
</blockquote>
Using and Contributing:
Feel free to use this code how you want, this project is under the <a>MIT license!</a> \
Feel free to contribute using the tool, sending issues or pull requests! | [] |
https://avatars.githubusercontent.com/u/164466470?v=4 | zig-demo-webserver | scottredig/zig-demo-webserver | 2025-03-12T22:44:55Z | a webserver which hosts a zig build path | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/scottredig/zig-demo-webserver/tags | MIT | [
"zig",
"zig-package"
] | 7 | false | 2025-04-21T10:57:33Z | true | true | unknown | github | [
{
"commit": "0b676643886b1e2f19cf11b4e15b028768708342",
"name": "mime",
"tar_url": "https://github.com/andrewrk/mime/archive/0b676643886b1e2f19cf11b4e15b028768708342.tar.gz",
"type": "remote",
"url": "https://github.com/andrewrk/mime"
}
] | zig-demo-webserver
A webserver which hosts the install directory (where the contents of running <code>zig build</code> goes) of a zig project.
See the example folder's build.zig for usage. Intentionally made without bells and wistles, focused on serving the result of a zig build as simply as possible. | [] |
https://avatars.githubusercontent.com/u/69104965?v=4 | lexbor-zig | doccaico/lexbor-zig | 2025-02-18T00:49:49Z | Zig build package and wrapper for Lexbor v2.4.0 | main | 0 | 1 | 1 | 1 | https://api.github.com/repos/doccaico/lexbor-zig/tags | - | [
"lexbor",
"zig"
] | 2,446 | false | 2025-05-17T17:12:47Z | true | true | unknown | github | [] | (WIP) lexbor-zig
Experimental Zig build package and wrapper for <a>Lexbor</a> v2.4.0
Currently, it has only been tested on Windows.
Fetch
<code>zig fetch --save=lexbor https://github.com/doccaico/lexbor-zig/archive/<git-commit-hash>.tar.gz</code>
Using as a single static library (it included all modules)
```zig
// build.zig
// const exe = b.addExecutable(.{
// ...
const lexbor = b.dependency("lexbor", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("lexbor", lexbor.module("lexbor"));
// src/main.zig
const std = @import("std");
const core = @import("lexbor").core;
pub fn main() !void {
const array = core.array.create();
const status = core.array.init(array, 32);
<code>try std.testing.expectEqual(status, .ok);
_ = core.array.destroy(array, true);
</code>
}
```
Using individual modules (e.g. html module)
```zig
// build.zig
// const exe = b.addExecutable(.{
// ...
const lexbor = b.dependency("lexbor", .{
.target = target,
.optimize = optimize,
.html = true,
});
exe.root_module.addImport("lexbor", lexbor.module("lexbor"));
```
See more options: <a>build.zig</a>
How to build a static library (it included all modules)
```
git clone https://github.com/doccaico/lexbor-zig
zig build
```
How to build static libraries separately (e.g. html module)
```
git clone https://github.com/doccaico/lexbor-zig
zig build -Dhtml
``` | [] |
https://avatars.githubusercontent.com/u/35633190?v=4 | coreutilz | a2p1k02/coreutilz | 2025-05-18T13:37:07Z | Simple reimplementation of coreutils written on Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/a2p1k02/coreutilz/tags | - | [
"coreutils",
"ls",
"touch",
"zig",
"ziglang"
] | 5 | false | 2025-05-19T09:57:58Z | true | false | unknown | github | [] | coreutilz
Simple reimplementation of coreutils written on Zig
Build
<code>sh
sudo pacman -Syu zig
git clone https://github.com/a2p1k02/coreutilz/
cd coreutilz
zig build.zig</code>
TODO
<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> ls
<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> touch
<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> chmod
<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> chown
<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> cat
<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> mkdir
<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> rm
<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> ... | [] |
https://avatars.githubusercontent.com/u/35633190?v=4 | zigos | a2p1k02/zigos | 2025-05-17T13:09:36Z | This is a simple OS written with Zig programming language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/a2p1k02/zigos/tags | - | [
"barebones",
"os",
"zig"
] | 4 | false | 2025-05-17T15:50:16Z | true | false | unknown | github | [] | zigos
This is a simple OS from Zig Bare Bones.
I will develop this OS as my hobby project | [] |
https://avatars.githubusercontent.com/u/88044178?v=4 | injector | angelrecovery/injector | 2025-05-18T07:11:57Z | Command line utility to inject shared libraries into target processes on WIndows. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/angelrecovery/injector/tags | BSD-2-Clause | [
"cli",
"injector",
"windows",
"zig"
] | 19 | false | 2025-05-22T04:07:26Z | true | true | 0.14.0 | github | [
{
"commit": "d21b419d808215e1f82605fdaddc49750bfa3bca",
"name": "zigwin32",
"tar_url": "https://github.com/marlersoft/zigwin32/archive/d21b419d808215e1f82605fdaddc49750bfa3bca.tar.gz",
"type": "remote",
"url": "https://github.com/marlersoft/zigwin32"
}
] | injector | [] |
https://avatars.githubusercontent.com/u/132564?v=4 | jetzig-web-app-demo | muthuishere/jetzig-web-app-demo | 2025-04-01T18:42:03Z | A small JetZig Web app with postgres and docker file | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/muthuishere/jetzig-web-app-demo/tags | - | [
"webapp",
"zig",
"ziglang"
] | 45 | false | 2025-04-05T20:13:04Z | true | true | 0.14.0 | github | [
{
"commit": "2c52792217b9441ed5e91d67e7ec5a8959285307.tar.gz",
"name": "jetzig",
"tar_url": "https://github.com/jetzig-framework/jetzig/archive/2c52792217b9441ed5e91d67e7ec5a8959285307.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/jetzig-framework/jetzig"
}
] | 404 | [] |
https://avatars.githubusercontent.com/u/53528937?v=4 | clig | Lygaen/clig | 2025-02-23T12:08:14Z | CLI + Config loading for Zig ! Everything is setup to have almost no friction ! | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Lygaen/clig/tags | NOASSERTION | [
"cli",
"cli-parser",
"config",
"config-parser",
"library",
"zig",
"zig-library",
"ziglang"
] | 3,100 | false | 2025-03-07T20:35:43Z | true | true | 0.14.0 | github | [] |
CLI + Config for zig 0.14.0 !
Many of the current libraries in zig only support for CLI command arguments or config loading but not both at the same time.
This library aims to solve that problem ! It aims to be as minimal as possible, and as much in compile-time as possible.
Installation
Run the following command in your favourite terminal, in a folder containing a <code>build.zig.zon</code> :
<code>sh
$ zig fetch --save git+https://github.com/Lygaen/clig</code>
Add the dpendency to your <code>build.zig</code> :
```zig
const std = @import("std");
pub fn build(b: *std.Build) void {
// -- snip --
<code>const clig_dep = b.dependency("clig", .{
.target = target,
.optimize = optimize,
});
// Where `exe` represents your executable/library to link to
exe.linkLibrary(clig_dep.artifact("clig"));
// -- snip --
</code>
}
```
And voilร ! Everything is in order.
Usage
You can see the <code>example/</code> folder for an example usage of this library. It aims to be as less disruptive as possible :
First import <code>clig</code> :
<code>zig
const clig = @import("clig");</code>
Define your config, it should be <strong>default constructible</strong> (aka. all fields should have defaults) :
<code>zig
const Config = struct {
flag: u8 = 5,
string: []const u8 = "default value",
randoming: enum {
true_random,
prng,
cprng,
} = .true_random,
advanced: struct {
testify: bool = false,
random: u8 = 76,
} = .{},
};</code>
Define a <code>help</code> struct that contains the description of the fields of <code>Config</code>, having the same name.
<blockquote>
Until we can add additional information to fields, this is the only solution to add compile-time information
to a struct.
<code>zig
const ConfigHelp = struct {
flag: []const u8 = "Flag that does strictly nothing",
string: []const u8 = "Might want to set a variable as a string as well",
randoming: []const u8 = "Sets the useless type of randomness to use",
advanced: struct {
testify: []const u8 = "Type-ception is fun",
random: []const u8 = "Sets the randomness as to how much do nothing",
} = .{},
};</code>
</blockquote>
Now you can call <code>clig.init(#ConfigType, #Allocator, #InitOptions)</code> freely !
```zig
pub fn main() !void {
// -- snip --
<code>_ = clig.init(Config, allocator, .{
.help = .{
.title = "Example",
.preambule = "CLIG Example CLI application that can do nothing ;)",
.description = ConfigHelp,
},
}) catch |err| switch (err) {
error.HelpMessageShown => return, // Handle the case where help was shown
else => return err,
};
defer clig.deinit();
</code>
}
```
And that's it ! If you have already a <code>Config</code> type defined, all you need is to add a <code>Helper</code> companion of the said type to add the descriptions.
CLI arguments can be parsed using :
<code>--arg=<value></code> or <code>--arg value</code> or if the type is a bool <code>--arg</code> (to set to true).
The above types will generate the following configs and help message :
```sh
$ zig build run -- --help
clig-example - Example
CLIG Example CLI application that can do nothing ;)
Arguments :
--flag
Default: 5 - Flag that does strictly nothing
--string
Default: default value - Might want to set a variable as a string as well
--randoming
Default: true_random - Sets the useless type of randomness to use
Section advanced
--advanced.testify
Default: false - Type-ception is fun
--advanced.random
Default: 76 - Sets the randomness as to how much do nothing
```
<code>json
$ cat config.json
{
"flag": 5,
"string": "default value",
"randoming": "true_random",
"advanced": {
"testify": false,
"random": 76
}
}</code>
TODOs
<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> Config file loading
<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> Argument loading
<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> <code>=</code> in arguments loading
<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> Comptime Help
<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> More detailed documentation
<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> ENV arguments
<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> Better Errors
<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> Revamp the example | [] |
https://avatars.githubusercontent.com/u/36482619?v=4 | ulid-zig | jkoop/ulid-zig | 2025-05-02T18:56:34Z | A simple ULID helper for Zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/jkoop/ulid-zig/tags | MIT | [
"ulid",
"zig",
"zig-package",
"ziglang"
] | 5,753 | false | 2025-05-16T15:00:57Z | true | true | 0.14.0 | github | [] | Ulid package for Zig
This is a simple package for Zig projects that implements <a>ULID</a> as an enum with convenience methods. Includes methods for <code>std.json</code> to en-/decode as a string, e.g. <code>"01JT9B27HTN19SEWVMWXRDRVC4"</code>.
<ul>
<li><a>API docs</a></li>
</ul>
Usage
```zig
const Ulid = @import("ulid").Ulid;
// generate a new ulid // we default to non-monotonic mode
var ulid = Ulid.generate(.{}) catch unreachable;
// for monotonic mode, guaranteeing ulid to be "higher" than all previous. See api doc
var ulid = try Ulid.generate(.{ .monotonic_mode = true });
// parse a ulid from a string
var ulid = try Ulid.fromString("01JT9B27HTN19SEWVMWXRDRVC4");
// encode a ulid to a string
var buffer: [26]u8 = @splat(0);
ulid.toString(&buffer); // overwrites the bytes of the buffer with the string and returns the string
// compare two ulids
if (ulid1 == ulid2) {
// this ๐ is allowed; they're enums after all
}
```
Installation
The normal procedure:
<code>sh
zig fetch --save https://github.com/jkoop/ulid-zig/archive/COMMIT.zip</code>
```zig
// build.zig before b.installArtifact(exe);
const ulid = b.dependency("ulid", .{
.target = target,
.optimize = optimize,
}).module("ulid");
exe.root_module.addImport("ulid", ulid);
``` | [] |
https://avatars.githubusercontent.com/u/49008623?v=4 | zterm | kioz-wang/zterm | 2025-04-17T14:11:59Z | A Zig implementation of console_codes (4). Let's start to print colorful message anywhere! | main | 4 | 1 | 0 | 1 | https://api.github.com/repos/kioz-wang/zterm/tags | MIT | [
"cli",
"zig",
"zig-package"
] | 774 | false | 2025-05-22T07:05:41Z | true | true | 0.14.0 | github | [
{
"commit": "ff6152d6d52e666b38862b4efa2ceccde79b2f8f",
"name": "zargs",
"tar_url": "https://github.com/kioz-wang/zargs/archive/ff6152d6d52e666b38862b4efa2ceccde79b2f8f.tar.gz",
"type": "remote",
"url": "https://github.com/kioz-wang/zargs"
}
] | zterm
A Zig implementation of <a>console_codes (4)</a>.
Features
<ul>
<li>No memory allocator needed</li>
<li>Generate attributes containing multiple styles (e.g. bold, italic) and colors (including foreground/background)</li>
<li>Comptime constructor</li>
<li>Use <code>.value(v)</code> to wrap any value for formatting, enforcing strict attribute handling (applied before output and reset after)</li>
<li>Use <code>.fprint(writer, fmt, args)</code> to incrementally apply an attribute before output</li>
<li>Move cursor to/at a position</li>
<li>Get the position of current cursor</li>
<li>Support <a><code>NO_COLOR</code></a> (also, support <code>NO_STYLE</code>!)</li>
<li>Check environments at runtime</li>
<li>Get literal string (ignore environments, comptime) by <code>toString()</code></li>
<li>Get window size</li>
</ul>
Plans
<blockquote>
See <a>issues</a>.
</blockquote>
<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> Cross-platform: windows, macos
<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> Read the key, text, password and etc
APIs
<blockquote>
See https://kioz-wang.github.io/zterm/#doc
</blockquote>
Installation
fetch
Get the latest version:
<code>bash
zig fetch --save git+https://github.com/kioz-wang/zterm</code>
To fetch a specific version (e.g., <code>v0.14.1</code>):
<code>bash
zig fetch --save https://github.com/kioz-wang/zterm/archive/refs/tags/v0.14.1.tar.gz</code>
Version Notes
<blockquote>
See https://github.com/kioz-wang/zterm/releases
</blockquote>
The version number follows the format <code>vx.y.z</code>:
- <strong>x</strong>: Currently fixed at 0. It will increment to 1 when the project stabilizes. Afterward, it will increment by 1 for any breaking changes.
- <strong>y</strong>: Represents the supported Zig version. For example, <code>vx.14.z</code> supports <a>Zig 0.14.0</a>.
- <strong>z</strong>: Iteration version, where even numbers indicate releases with new features or significant changes (see <a>milestones</a>), and odd numbers indicate releases with fixes or minor changes.
import
Use <code>addImport</code> in your <code>build.zig</code> (e.g.):
```zig
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe_mod.addImport("Term", b.dependency("zterm", .{}).module("Term"));
const exe = b.addExecutable(.{
.name = "your_app_name",
.root_module = exe_mod,
});
exe.linkLibC();
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
```
After importing the <code>Term</code>, you could get a terminal <code>getStd</code> by:
<code>zig
const term = @import("Term").getStd();</code>
Examples
See builtin demo: <code>zig build run -- -h</code>
<blockquote>
Welcome to submit PRs to link your project that use <code>zterm</code>!
</blockquote>
More real-world examples are coming!
<ul>
<li>emmm...</li>
</ul>
License
<a>MIT</a> ยฉ Kioz Wang | [] |
https://avatars.githubusercontent.com/u/98653095?v=4 | taqp | Flokkq/taqp | 2025-02-18T16:31:50Z | diy macro-pad | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Flokkq/taqp/tags | NOASSERTION | [
"diy",
"macro-pad",
"rust",
"streamdeck",
"zig"
] | 317 | false | 2025-03-05T22:51:13Z | false | false | unknown | github | [] | Making a diy stream-deck (taqp)
<ul>
<li>I want to learn zig, hardware orientated programming and ffi</li>
<li>Also having a self-made stream-deck is pretty awesome</li>
</ul>
The plan...
<ul>
<li>[ ] setup</li>
<li>[x] talk to rust from zig</li>
<li>[x] talk to esp from zig</li>
<li>[x] connect to esp from device</li>
<li>[ ] react to physical button press</li>
<li>[ ] send data to the daemon running on the device</li>
<li>[ ] load config from the gui application</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/118655836?v=4 | B3T | GasFurr/B3T | 2025-05-08T16:12:06Z | B3T: Better Todo Than (your) Todo. Lightweight todo manager for developers written in Zig. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/GasFurr/B3T/tags | MIT | [
"cli",
"lightweight",
"todo-list",
"zig"
] | 99 | false | 2025-05-16T21:40:08Z | true | true | 0.15.0-dev.471+369177f0b | github | [
{
"commit": "dc25a9ba890935f99d2f139caeec65ca00e5b6ca.tar.gz",
"name": "microwave",
"tar_url": "https://github.com/edqx/microwave/archive/dc25a9ba890935f99d2f139caeec65ca00e5b6ca.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/edqx/microwave"
}
] | CURRENTLY WIP - ALL INFO DOWN HERE IS JUST IMAGE OF WHAT SOFTWARE SHOULD DO AT THE END OF DEVELOPMENT!
CURRENTLY NOT WORKING.
B3T: Better Todo Than (your) Todo
<em>Lightweight, offline-first todo tracker for developers. Built with Zig.</em>
No bloat, no cloud, just your tasks.
<a></a>
<a></a>
๐ Why B3T?
For developers tired of:
<ul>
<li><strong>Cloud-dependent tools</strong> that break without Wi-Fi.</li>
<li><strong>Heavyweight apps</strong> that drain resources.</li>
<li><strong>Scattered TODOs</strong> buried in code comments.</li>
</ul>
B3T solves this with <strong>local-first task management</strong> and seamless codebase integration.
โจ Features
<ul>
<li><strong>๐ด Offline-First</strong>
Work from a cabin, train, or server room. No accounts, no sync, no BS.</li>
<li><strong>โก Zig-Powered Simplicity</strong>
Single binary, zero runtime dependencies. Just works.</li>
<li><strong>๐ Codebase-Aware</strong>
Automatically find <code>//B3T-TODO</code> comments with <code>b3t scan</code>.</li>
<li><strong>๐ Template-Driven</strong>
Define projects via <code>b3t.toml</code>. Reuse configs across projects.</li>
<li><strong>๐ Minimalist by Default</strong>
No GUIs, no plugins, no distractions.</li>
</ul>
๐ ๏ธ Quick Start
<ol>
<li><strong>Install</strong> (requires <a>Zig</a>):</li>
</ol>
<code>bash
git clone https://github.com/gasfurr/b3t
cd b3t
./install.sh # Installs B3T with bash script</code>
<ol>
<li><strong>Init a Project</strong>:</li>
</ol>
<code>bash
b3t init # Creates b3t.toml in your project</code>
<ol>
<li><strong>Scan for TODOs</strong>:</li>
</ol>
<code>bash
b3t scan # Detects TODOs in code comments</code>
<ol>
<li><strong>List Tasks</strong>:</li>
</ol>
<code>bash
b3t list # Shows tasks from code.</code>
๐ Example Workflow
(everything here is not working for now.)
<strong>1. Create your <code>mytemplate.toml</code>:</strong>
```toml
[project]
name = "my_awesome_app"
[options]
scan.taskName = "//B3T-TODO:" # Configure parser
Priorities configuration
priorities = [ "HIGH", "MED", "LOW", "CRIT"] #2, 3, 4, 1
priorities.level = [2, 3, 4, 1] # Just write it in same order
priorities.flag = "b3t.priority=" #It will find the keyword and set priority
Ignore configuration
project.ignore = ["src/stolencode.rs", "src/privatelinks.txt"] # Will not read this files
And everything else... (more in docs)
```
<strong>2. Write Code with TODOs:</strong>
<code>rust
// main.rs
fn main() {
//B3T-TODO: Fix memory leak b3t.priority=CRIT
//B3T-TODO: Fix the typo in print b3t.priority=LOW
//B3T-TODO: someunpriorityzed todo
// my api token: lolyoureallyleakedapitokenintodos?
//B3T-TODO: Multithreading support b3t.priority=MED
}</code>
<strong>3. Do the work:</strong>
```bash
~ b3t template save mytemplate.toml mytemplate
Save your templates.
~ cd home/my_awesome_app
Go to your project root
~ b3t init my_awesome_app -t mytemplate
Creates b3t.toml by your template (stored in program)
~ b3t scan # When you in your projects root
Detects the comments using b3t.toml configuration. (It scans all files if not said otherwise.)
~ cd /home/.homework # Now you can do anything
~ b3t list my_awesome_app # Just ask for your project's Todo list!
|> my_awesome_app todo:
| โบ 1.[CRIT] Fix memory leak
| โ src/main.rs:2
| โบ 2.[MED] Multithreading support
| โ src/main.rs:6
| โบ 3.[LOW] Fix the typo in print
| โ src/main.rs:3
| โบ 4.[] someunpriorityzed todo
| โ src/main.rs:4
And then you can just delete your project from database anytime
~ b3t delete my_awesome_app
|> Are you sure? [Yes/any key]
So easy, isn't it?
```
๐ง Philosophy
<ul>
<li><strong>Your Machine, Your Rules</strong>
Tasks stay on your device. No telemetry, no hidden sync.</li>
<li><strong>Templates Over Boilerplate</strong>
Configure once, reuse everywhere. No more copy-pasting.</li>
<li><strong>Small and Focused</strong>
Does one thing well: track TODOs in code. Nothing else.</li>
</ul>
๐ค Contributing
B3T is <strong>open source</strong> (<a>MIT</a>). We welcome:
<ul>
<li><strong>Templates</strong>: Share <code>b3t.toml</code> presets for frameworks.</li>
<li><strong>Core Improvements</strong>: Zig optimizations or bug fixes.</li>
<li><strong>Documentation</strong>: Improve guides for advanced configs.</li>
</ul>
Check <a>CONTRIBUTING.md</a> for guidelines.
๐ License
B3T is licensed under the <a>MIT License</a>.
This project uses <a>microwave</a> (<a>MIT License</a>) for TOML parsing.
โ FAQ
<strong>Q: Why Zig?</strong>
A: For raw speed and explicit control. And i just love this language, it's <em>the</em> c but better as i see it.
<blockquote>
I just feel like writing good software is best support for new programming language.
</blockquote>
<strong>Q: How to add task manually?</strong>
A: It's not intended, but you can just create some sort of <code>todo.txt</code> and <code>b3t</code> will parse it.
<blockquote>
It's a design choice - b3t strictly believes in your codebase as only true source.
</blockquote>
<strong>Q: Can I sync across devices?</strong>
A: Not directlyโby design. But you can version-control <code>.b3t</code> with Git if you want.
<strong>Q: Why no GUI/plugins?</strong>
A: To stay minimal. Pipe <code>b3t list</code> to other tools if needed.
<strong>Q: What if I want more features?</strong>
A: Keep an eye on <a>BetterB3T</a> for plugins/SQLite. This version is intentionally barebones.
<strong>Made by developers, for developers.</strong> | [] |
https://avatars.githubusercontent.com/u/35633190?v=4 | grepz | a2p1k02/grepz | 2025-05-18T11:01:27Z | Zig way for linux grep | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/a2p1k02/grepz/tags | - | [
"grep",
"linux",
"zig",
"ziglang"
] | 2 | false | 2025-05-18T11:04:07Z | true | false | unknown | github | [] | grepz
Zig way for linux grep | [] |
https://avatars.githubusercontent.com/u/70007968?v=4 | JanRenderer | Name-hw/JanRenderer | 2025-02-21T10:22:20Z | ์ฌ์ฌํด์ ๋ง๋ C++17๊ณผ Zig๋ก ์์ฑ๋ Vulkan ๋ ๋๋ง ์์ง | main | 4 | 1 | 0 | 1 | https://api.github.com/repos/Name-hw/JanRenderer/tags | MIT | [
"3d",
"3d-graphics",
"cpp",
"graphics",
"graphics-engine",
"graphics-programming",
"render",
"renderer",
"renderering",
"rendering-3d-graphics",
"rendering-engine",
"shader",
"shaders",
"vulkan",
"vulkan-compute-shaders",
"vulkan-engine",
"vulkan-renderer",
"zig",
"zig-lib",
"z... | 25,261 | false | 2025-05-16T11:44:36Z | true | true | 0.11.0 | github | [
{
"commit": "ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00",
"name": "zmath",
"tar_url": "https://github.com/zig-gamedev/zmath/archive/ccf7297ef6c01e21b2d51ad81b5b6ce929e86a00.tar.gz",
"type": "remote",
"url": "https://github.com/zig-gamedev/zmath"
},
{
"commit": "75ab44d1bff1c16585ceeacf2db5... | <strong>JanRenderer (WIP)</strong>
<a></a>
Rendering engine built with Vulkan written in C++17 and Zig.
<strong>Features</strong>
<ul>
<li>Rendering engine built with Vulkan</li>
<li>Written in C++17 and Zig</li>
<li>Using Depth buffer</li>
<li>Generate Mipmaps</li>
<li>MSAA (MultiSampling Anti-Aliasing) support</li>
<li>Compute Shader</li>
</ul>
<strong>Getting Started</strong>
<ol>
<li>Link the glfw library.</li>
<li>Import the built JanRenderer library and JanRenderer.zig. (see <a>this</a>).</li>
</ol>
<strong>Build</strong>
<ol>
<li>First, install <a>vcpkg</a> and run 'vcpkg install'.</li>
<li>Build using zig's build system in Visual Studio Code (see shortcuts below).</li>
<li>Executable program and Library files are created in the 'bin' folder.</li>
</ol>
Shortcuts
<ul>
<li>build: Ctrl+Shift+B</li>
<li>debug: F5</li>
<li>run: Ctrl+F5</li>
</ul>
Vscode extensions
<ol>
<li><a>https://marketplace.visualstudio.com/items?itemName=ziglang.vscode-zig</a></li>
<li><a>https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools</a></li>
<li><a>https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap</a></li>
</ol>
Libraries
Install the library via vcpkg or zig's build system (see build.zig, build.zig.zon).
Namings
<ol>
<li>Variables: camelCase</li>
<li>Functions: camelCase</li>
<li>Types (including classes, structs, enums, typedefs, etc): PascalCase</li>
<li>Enums: PascalCase</li>
</ol>
<strong>Dependencies</strong>
Vcpkg
<ul>
<li><a>volk</a></li>
<li><a>cglm</a></li>
<li><a>stb</a></li>
<li><a>tinyobjloader</a></li>
</ul>
Zig build system
<ul>
<li><a>zmath</a></li>
<li><a>zglfw</a></li>
<li><a>zgui</a></li>
<li><a>coyote-ecs</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/64004309?v=4 | sandsim | asynched/sandsim | 2025-04-27T15:50:39Z | A simple demo on sand particles using Zig and Raylib | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/asynched/sandsim/tags | - | [
"raylib",
"zig"
] | 932 | false | 2025-04-29T11:07:04Z | true | true | 0.14.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"
}
] | Sandsim
A simple demo on sand falling down using raylib.
Preview
| [] |
https://avatars.githubusercontent.com/u/121856799?v=4 | wasm-fmt-vscode | Inc44/wasm-fmt-vscode | 2025-03-15T21:09:11Z | Code Formatter powered by WebAssembly | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Inc44/wasm-fmt-vscode/tags | MIT | [
"c",
"clang-format",
"cpp",
"css",
"formatter",
"html",
"javascript",
"lua",
"python",
"ruff",
"sql",
"wasm",
"yaml",
"zig"
] | 209 | true | 2025-03-15T23:18:17Z | false | false | unknown | github | [] |
<a>
</a>
wasm fmt - Visual Studio Code Extension
wasm fmt is a multi-language code formatting tool with the following advantages:
<ol>
<li>It eliminates the need for a language runtime environment.</li>
<li>Powered by WebAssembly, it operates swiftly and reliably across all VSCode environments, including VSCode Desktop, vscode.dev, and github.dev.</li>
</ol>
Supported languages
<ul>
<li><a>ruff_fmt</a></li>
</ul>
<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> Python
<ul>
<li><a>gofmt</a></li>
</ul>
<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> Golang
<ul>
<li><a>web_fmt</a></li>
</ul>
<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> JavaScript / TypeScript / JSX / TSX
<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> JSON / JSONC
<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> CSS / SCSS / SASS / LESS
<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> HTML / Vue / Svelte / Astro / Jinja / Twig
<ul>
<li><a>clang-format</a></li>
</ul>
<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> C / C++
<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> Objective-C / Objective-C++
<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> C#
<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> Java
<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> JavaScript / TypeScript [^1]
<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> JSON / JSONC [^1]
<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> Protobuf
<ul>
<li><a>dart_fmt</a></li>
</ul>
<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> Dart
<ul>
<li><a>zig_fmt</a></li>
</ul>
<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> Zig
<ul>
<li><a>lua_fmt</a></li>
</ul>
<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> Lua
<ul>
<li><a>sql_fmt</a></li>
</ul>
<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> SQL
<ul>
<li><a>yamlfmt</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> YAML
<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> GitHub Actions Workflow</li>
</ul>
[^1]: JavaScript / TypeScrip / JSON / JSONC are supported by clang-format as well, but web_fmt is used for better output. | [] |
https://avatars.githubusercontent.com/u/86977709?v=4 | jasm | Jotrorox/jasm | 2025-02-19T17:12:41Z | A simple Assembler written from scratch, for educational and recreational purposes | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Jotrorox/jasm/tags | MIT | [
"asm",
"assembler",
"assembly",
"binary",
"hex",
"jasm",
"jasm-assembler",
"unix",
"vscode",
"zig"
] | 171 | false | 2025-04-24T12:15:25Z | false | false | unknown | github | [] | JASM Assembler
A modern, user-friendly x86_64 assembler for Linux.
Features
<ul>
<li>Simple, intuitive syntax</li>
<li>Support for most x86_64 instructions</li>
<li>ELF and raw binary output formats</li>
<li>Fast compilation times</li>
<li>Comprehensive error messages</li>
</ul>
Installation
Building from Source
<ol>
<li>
Clone the repository:
<code>bash
git clone https://github.com/jotrorox/jasm.git
cd jasm</code>
</li>
<li>
Build the project:
<code>bash
cc -o nob nob.c
./nob --type Release</code>
</li>
</ol>
The build system supports different build types:
- <code>Debug</code>: Includes debugging symbols and ASAN (Address Sanitizer)
- <code>Release</code>: Optimized build with maximum performance
- <code>Verbose</code>: Includes additional warnings and debug information
Additional build options:
- <code>--verbose</code>: Show detailed build information
- <code>--output <dir></code>: Specify output directory (default: build)
- <code>--clean</code>: Clean the build directory
- <code>--verbose</code>: Show verbose output
- <code>--quiet</code>: Suppress output
- <code>--cc <path></code>: Specify the C compiler (default: cc)
- <code>--help</code>: Show help message
System Requirements
<ul>
<li>Linux x86_64</li>
<li>A C compiler (<code>cc</code> in your path)</li>
</ul>
Usage
Basic usage:
<code>bash
jasm input.jasm [output]</code>
Options:
- <code>-h, --help</code>: Display help message
- <code>-v, --verbose</code>: Enable verbose output
- <code>-V, --version</code>: Display version information
- <code>-f, --format <format></code>: Specify output format (elf, bin)
Examples
Hello World
```jasm
Example: Print "Hello, world!" to stdout
data msg "Hello, World!\n"
sys_write(stdout, msg, 14)
mov rax, 1 # sys_write
mov rdi, 1 # stdout
mov rsi, msg # message
mov rdx, 14 # length
call
sys_exit(0)
mov rax, 60 # sys_exit
mov rdi, 0 # status
call
```
Documentation
For detailed documentation, visit our <a>documentation website</a>.
License
This project is licensed under the MIT License - see the <a>LICENSE</a> file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Author
Johannes (Jotrorox) Mรผller | [] |
https://avatars.githubusercontent.com/u/175068426?v=4 | advisory-db | Zig-Sec/advisory-db | 2025-03-16T08:59:16Z | Security advisory database for Zig packages | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Zig-Sec/advisory-db/tags | CC0-1.0 | [
"security",
"security-advisories",
"security-audit",
"vulnerabilities",
"zig"
] | 236 | false | 2025-05-12T12:37:38Z | true | true | 0.14.0 | github | [] | Zig-Sec Advisory Database
The Zig-Sec Advisory Database is a repository of security-advisories filed against Zig packages.
The following tools make use of the given database and can be used to audit Zig packages:
<ul>
<li><code>zat</code>: The Zig Audit Tool (not released yet)</li>
</ul>
Reporting Vulnerabilities
To report a new vulnerability, open a pull request using the template below.
Steps
<ol>
<li>Create a file named <code>ZIGSEC-0000-0000.zon</code> in the <code>packages/<package_name></code> subdirectory of the repository. The name for a package can be found in its <code>build.zig.zon</code>. For example if the name is <code>zbor</code>, the advisory is placed in <code>packages/zbor/</code>.</li>
<li>Copy and paste the <a>ZON advisory template</a> into the created file. Delete the comments and fill it out with details about the vulnerability. Make sure to describe the vulnerability in detail.</li>
<li>Open a <a>pull request</a>. After being reviewed your advisory will be assigned a unique identifier <code>ZIGSEC-YYYY-NNNN</code> and be published to the database.</li>
</ol>
<blockquote>
The created <code>.zon</code> file can be validated using the validate application. It can be build using <code>zig build</code>.
</blockquote>
Criteria
The following vulnerabilities qualify for an advisory:
<ul>
<li>Code Execution</li>
<li>Memory Corruption</li>
<li>Privilege Escalation</li>
<li>File Disclosure or Directory Traversal</li>
<li>Web Security (XSS, CSRF, etc.)</li>
<li>Format Injection (SQL Injection, etc.)</li>
<li>Cryptography Failure (confidentiality breakage, integrity breakage, authenticity breakage, key leakage)</li>
<li>Covert Channels (Specter, Meltdown, etc.)</li>
<li>Denial of Service (especially if used in a web context)</li>
</ul>
In addition to the qualifiers stated above, the package should have a certain user base, i.e. the
vulnerability actually impacts other packages and users.
Advisory Format
Advisories are defined using the Zig Object Notation (ZON).
```zon
.{
// Identifier for the advisory (mandatory) in the format ZIGSEC-YYYY-NNNN,
// e.g. ZIGSEC-2025-0001 for the first published advisory in the year 2025.
// Please use ZIGSEC-0000-0000 in pull requests.
.id = "ZIGSEC-0000-0000",
<code>// The name of the affected Zig package (mandatory).
.package = "mypackage",
// The fingerprint of the affected Zig package (mandatory).
.fingerprint = 0xec469ac53ee70841,
// Disclosure date of the advisory as an RFC3339 date (mandatory).
.date = "2025-01-31",
// A package-url (https://github.com/package-url/purl-spec) for the Zig package (optional).
//
// A purl is a URL composed of seven components:
// ```
// scheme:type/namespace/name@version?qualifiers#subpath
// ```
.purl = "pkg:github/r4gus/mypackage",
// Whether the advisory is withdrawn (optional).
//.withdrawn = "YYYY-MM-DD",
// URL to a long-form description of this issue, e.g. a GitHub issue/PR,
// a change log entry, or a blogpost announcing the release (optional, except
// for advisories using a license that requires attribution).
.url = "https://github.com/mystuff/mypackage/issues/123",
// URL to additional helpful references regarding the advisory (optional).
.references = .{
"https://github.com/mystuff/mypackage/discussions/1",
},
// Optional: the advisory license.
//.license = .{
// // A license identifier (mandatory).
// .id = "CC-BY-4.0",
// // A reference with a description of the license (optional).
// .ref = "https://creativecommons.org/licenses/by/4.0/deed.en",
//},
// Optional: Indicates the type of informational security advisory
// - `unmaintained` for packages that are no longer maintained
// - `notice` for other informational notices
.informational = .unmaintained,
// Optional: Categories this advisory falls under. Valid categories are:
// code_execution, crypto_failure, denial_of_service, file_disclosure
// format_injection, memory_corruption, memory_exposure, privilege_escalation.
.categories = .{
.code_execution,
},
// Optional: a Common Vulnerability Scoring System score. More information
// can be found on the CVSS website, https://www.first.org/cvss/.
//.cvss = "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
// Freeform keywords which describe this vulnerability.
.keywords = .{
"http", "memory"
},
// Vulnerability aliases, e.g. CVE IDs (optional but recommended)
//.aliases = .{ "CVE-2025-XXXX" },
// Related vulnerabilities (optional)
//.related = .{ "CVE-2024-YYYY", "CVE-2018-ZZZZ" },
// Optional: metadata which narrows the scope of what this advisory affects
.affected = .{
// CPU architectures impacted by this vulnerability (optional).
// For a list of CPU architectures run `zig targets`.
.arch = .{ "x86", "x86_64"},
// Operating systems impacted by this vulnerability (optional)
// For a list of operating systems run `zig targets`.
//.os = .{ "windows" },
},
// Versions which include fixes for this vulnerability (mandatory).
// Those are [Semantic Versions](https://semver.org/).
// Use `.patched = .{}` e.g. in case of unmaintained where there is no fix.
.versions = .{
.patched = .{">= 1.2.0"},
// Versions which were never vulnerable (optional).
//.unaffected = .{"< 1.1.0"},
},
// A short description of the issue.
.description = "Your short description here",
// A long desctiption of the issue in [Markdown](https://www.markdownguide.org/)
// format (mandatory).
.detail = "Your description here.",
// Recommendations (optional but recommended).
.recommended = "You should do XYZ",
</code>
}
```
FAQ
<em>Q: Do I need to be the owner of a package to file an advisory?</em>
A: No, anyone can file an advisory against a package. Make sure the package has a certain reach and describe the vulnerability in detail. We must be able to validate the vulnerability in order to merge it.
<em>Q: Is this the official way to report vulnerabilities for Zig packages?</em>
A: There are many ways to report vulnerabilities for software including the <a>GitHub Advisory Database</a> and the <a>Open Source Vulnerabilities Database</a>. This is just another way inspired by <a>RustSEC</a> and dedicated specifically to Zig packages. <strong>Together with ZAT, this is part of a research project on how to increase the security of the Zig ecosystem through transparency</strong>.
License
All content in this repository is published in the public domain, except otherwise specified.
Advisories published under a different domain contain a license field specifying the license.
Dev Notes
Pages for every advisory can be generated by running <code>zig build advisories</code> (<strong>TODO</strong>: execute this via github actions). | [] |
https://avatars.githubusercontent.com/u/69888212?v=4 | soulib | blitz-krieg-cmd/soulib | 2025-03-16T22:35:29Z | Souls Lib - Zig library for Reading and Writing Dark Souls Remastered files. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/blitz-krieg-cmd/soulib/tags | GPL-3.0 | [
"fromsoftware",
"parser",
"zig",
"zig-package",
"ziglang"
] | 72 | false | 2025-03-25T19:17:19Z | true | true | 0.14.0 | github | [] | Souls Lib (Soulib)
<blockquote>
Currently a very WIP library being created slowly in my free time. Feel free to contribute but I don't have any clear direction on how I want this project to be structured so please be mindful of that. If you have any questions feel free to ask them.
</blockquote>
Goals
<ul>
<li>Zig Library</li>
<li>C ABI Library from Zig</li>
<li>All recent common fromsoft formats (excluding older titles. anything prior ds1-ptde)</li>
</ul>
Design of the library
Rough summary of using the library:
<ul>
<li>Open file using it's path.</li>
<li>Read all bytes from file.</li>
<li>Pass file bytes to library and parse.</li>
</ul>
Example Usage
```zig
const std = @import("std");
// Import the library.
const soulib = @import("soulib");
pub fn main() !void {
// Define the allocator to use.
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const allocator = arena.allocator();
<code>// Define the file to parse over.
const path = "path/to/dcx/file.dcx";
var file = std.fs.openFileAbsolute(
path,
.{ .mode = .read_only },
) catch unreachable;
defer file.close();
// Read the bytes from the file.
const fileBytes = try file.readToEndAlloc(allocator, try file.getEndPos());
// Parse the file.
const dcx = try soulib.DCX.read(
allocator,
fileBytes,
);
// Use the parsed data.
std.debug.print("HEADER:\n Magic: {c}\n Compression Type: {c}\n Compressed size: {d}\n Decompressed size: {d}\nBODY:\n Length: {d}\n Summary: {x}", .{
dcx.header.dcx,
dcx.header.format,
dcx.header.compressedSize,
dcx.header.uncompressedSize,
dcx.data.len,
dcx.data[0..32],
});
</code>
}
```
Formats
Basic descriptions are provided below. Checkmarks show library progress on file type.
State | Format | Extension | Description
------ | ------ | --------- | -----------
โ๏ธ | DCX | .dcx | A simple wrapper for a single compressed file
โ๏ธ | TPF | .tpf | A container for platform-specific texture data
โ | BND3 | .*bnd | A general-purpose file container used before DS2
โ | BHD5 | .bhd, .bhd5 | The header file for the large primary file archives used by most games
โ | BTAB | .btab | Controls lightmap atlasing
โ | BTL | .btl | Configures point light sources
โ | BTPB | .btpb | Contains baked light probes for a map
โ | BXF3 | .*bhd + .*bdt | Equivalent to BND3 but with a separate header and data file
โ | CCM | .ccm | Determines font layout and texture mapping
โ | CLM2 | .clm | A FLVER companion format that has something to do with cloth
โ | DRB | .drb | Controls GUI layout and styling
โ | EDD | .edd | An ESD companion format that gives friendly names for various elements
โ | EMELD | .eld, .emeld | Stores friendly names for EMEVD events
โ | EMEVD | .evd, .emevd | Event scripts
โ | ENFL | .entryfilelist | Specifies assets to preload when going through a load screen
โ | ESD | .esd | Defines a set of state machines used to control characters, menus, dialog, and/or map events
โ | F2TR | .flver2tri | A FLVER companion format that links the vertices to the FaceGen system
โ | FLVER | .flv, .flver | FromSoftware's standard 3D model format
โ | FMG | .fmg | A collection of strings with corresponding IDs used for most game text
โ | GPARAM | .fltparam, .gparam | A generic graphics configuration format
โ | GRASS | .grass | Specifies meshes for grass to be dynamically placed on
โ | LUAGNL | .luagnl | A list of global variable names for Lua scripts
โ | LUAINFO | .luainfo | Information about AI goals for Lua scripts
โ | MCG | .mcg | A high-level navigation format used in DeS and DS1
โ | MCP | .mcp | Another high-level navigation format used in DeS and DS1
โ | MSB | .msb | The main map format, listing all enemies, collisions, trigger volumes, etc
โ | MTD | .mtd | Defines some material and shader properties; referenced by FLVER materials
โ | NVM | .nvm | The navmesh format used in DeS and DS1
โ | PARAM | .param | A generic configuration format
โ | PARAMDEF | .def, .paramdef | A companion format that specifies the format of data in a param
โ | PARAMTDF | .tdf | A companion format that provides friendly names for enumerated types in params
โ | RMB | .rmb | Controller rumble effects for all games
Examples Building
<blockquote>
To run examples:
<code>zig build read_dcx -Dtarget=x86_64-windows -- "E:/SteamLibrary/steamapps/common/DARK SOULS REMASTERED/msg/ENGLISH/item.msgbnd.dcx"</code>
</blockquote>
Notes on Testing
The tests in the source look to a Dark Souls Remastered Directory. It should be alongside the build.zig and called "dsr".
<ul>
<li>build.zig</li>
<li>src/</li>
<li>root.zig</li>
<li>dcx.zig</li>
<li>dsr/</li>
<li>chr/</li>
<li>msg/</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/26161607?v=4 | multi-zig-project | pierangelomiceli/multi-zig-project | 2025-04-10T22:49:31Z | Zig + VS Code Multi-Project Debug Setup | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/pierangelomiceli/multi-zig-project/tags | MIT | [
"devtools",
"template-project",
"vscode",
"zig",
"ziglang"
] | 9 | false | 2025-04-15T22:41:59Z | false | false | unknown | github | [] |
โก Zig + VS Code Multi-Project Debug Setup
This repository is a <strong>starter template</strong> for working with <strong>multiple Zig projects</strong> in a single workspace using <strong>VS Code</strong>, with:
<ul>
<li>โ
A single <code>tasks.json</code></li>
<li>โ
A single <code>launch.json</code></li>
<li>โ
Dynamic project selection at debug/build time (via input dropdown)</li>
<li>โ
LLDB debugger support</li>
<li>โ
No scripts, no <code>.env</code>, no bash tricks</li>
</ul>
๐ Project structure
<code>multi-zig-project/
โโโ project1/
โ โโโ src/
โ โโโ build.zig
โโโ project2/
โ โโโ src/
โ โโโ build.zig
โโโ .vscode/
โโโ tasks.json
โโโ launch.json</code>
๐ง How it works
When you press โถ๏ธ <strong>Run and Debug</strong> in VS Code or press F5 key:
<ol>
<li>You're prompted to pick the project (<code>project1</code> or <code>project2</code>) to debug</li>
<li>You're prompted to pick the project (<code>project1</code> or <code>project2</code>) to build</li>
<li>The correct <code>zig build</code> command runs automatically in the right folder</li>
<li>The debugger starts the corresponding executable from <code>zig-out/bin/</code></li>
<li>You have full step-debugging and breakpoints with <strong>LLDB</strong></li>
</ol>
All this is handled using <strong>VS Code's built-in <code>inputs</code> API</strong>, so:
<ul>
<li>No external files</li>
<li>No shell scripts</li>
<li>No hardcoded paths</li>
</ul>
๐ How to use it
<ol>
<li>Open the workspace in VS Code</li>
<li>Place a breakpoint on project1 or project2 <code>main.zig</code> files.</li>
<li>Press <code>F5</code> to Debug </li>
<li>you'll be prompted to pick a project to Debug</li>
<li>you'll be prompted to pick a project for pre-build</li>
</ol>
๐ Requirements
<ul>
<li><a>Zig</a></li>
<li><a>VS Code</a></li>
<li><a>CodeLLDB Extension</a></li>
</ul>
๐ Why this setup?
Zig doesn't yet have a built-in package manager or multi-project workflow like <code>cargo</code> in Rust.
This setup gives you:
<ul>
<li>Clean structure</li>
<li>One config for all projects</li>
<li>Less duplication</li>
<li>Fully native integration with VS Code</li>
</ul>
Fully working with breakpoint on vscode.
๐ก Inspired by
This was built out of necessity โ because we were tired of repeating configurations on <code>launch.json</code> and <code>tasks.json</code> files during my learning experiments.
Hope it helps others looking for a clean Zig + VS Code workflow!
๐ฆ License
MIT โ Free to use, modify, fork, or scream at. | [] |
https://avatars.githubusercontent.com/u/49297668?v=4 | zig-fetch-py | crosstyan/zig-fetch-py | 2025-03-07T09:57:43Z | zig fetch in python | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/crosstyan/zig-fetch-py/tags | WTFPL | [
"zig"
] | 32 | false | 2025-04-28T11:00:09Z | false | false | unknown | github | [] | zig-fetch-py
A Python utility for working with Zig package manager files and Zig Object Notation (ZON).
Features
<ul>
<li>Parse ZON files into Python dictionaries</li>
<li>Convert ZON files to JSON</li>
<li>Download and extract dependencies from ZON files</li>
<li>Recursively download nested dependencies</li>
<li>Scan directories for <code>build.zig.zon</code> files</li>
</ul>
Installation
Using uv (recommended)
<a>uv</a> is a fast Python package installer and resolver.
```bash
Install uv if you don't have it
curl -sSf https://astral.sh/uv/install.sh | bash
Clone the repository
git clone https://github.com/yourusername/zig-fetch-py.git
cd zig-fetch-py
Create and activate a virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install the package in development mode
uv pip install -e .
Install development dependencies
uv pip install -e ".[dev]"
```
Using pip
```bash
Clone the repository
git clone https://github.com/yourusername/zig-fetch-py.git
cd zig-fetch-py
Create a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
Install the package in development mode
pip install -e .
Install development dependencies
pip install -e ".[dev]"
```
Usage
Command Line Interface
The package provides a command-line interface with the following commands:
Download Dependencies
Download dependencies from a ZON file or directory:
```bash
Download dependencies from a single ZON file
zig-fetch download examples/test.zon
Download dependencies from a directory (finds all build.zig.zon files)
zig-fetch download lib/
Download dependencies recursively (finds dependencies of dependencies)
zig-fetch -v download examples/test.zon --recursive
Combine directory scanning with recursive downloading
zig-fetch -v download lib/ --recursive
```
Options:
- <code>--recursive</code>, <code>-r</code>: Recursively process dependencies of dependencies
- <code>--verbose</code>, <code>-v</code>: Enable verbose logging (on the parent command)
This will download all dependencies to <code>~/.cache/zig/p</code> and extract them to directories named after their hash values.
Convert ZON to JSON
Convert a ZON file to JSON:
<code>bash
uv run zig-fetch convert examples/test.zon</code>
Options:
- <code>--indent N</code>, <code>-i N</code>: Set the indentation level for the JSON output (default: 2)
- <code>--output PATH</code>, <code>-o PATH</code>: Output file (default: stdout)
- <code>--empty-tuple-as-dict</code>: Parse empty tuples (<code>.{}</code>) as empty dictionaries (<code>{}</code>) instead of empty lists (<code>[]</code>)
- <code>--verbose</code>, <code>-v</code>: Enable verbose logging
Python API
You can also use the package as a Python library:
```python
from zig_fetch_py.parser import parse_zon_file, zon_to_json
from zig_fetch_py.downloader import process_dependencies
Parse a ZON file
zon_data = parse_zon_file("examples/test.zon")
Convert ZON to JSON
json_str = zon_to_json(zon_content, indent=2)
Download dependencies
dependencies = process_dependencies("examples/test.zon")
```
ZON Parser Options
The ZON parser supports the following options:
<ul>
<li><code>empty_tuple_as_dict</code>: If True, empty tuples (<code>.{}</code>) will be parsed as empty dictionaries (<code>{}</code>) instead of empty lists (<code>[]</code>)</li>
</ul>
Trivia
Cursor (powered by Claude 3.7) help me do almost all of the heavy lifting. I
can't even write a proper parser by my own.
The motivation of it is this issue (<a>add http/socks5 proxy support for package manager</a>).
Until proper proxy support is added to zig, I'll maintain this repo. (The Zon parser might be useful for other projects though)
License
```
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2024 <a>crosstyan@outlook.com</a>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
<code> DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
</code>
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
<ol>
<li>You just DO WHAT THE FUCK YOU WANT TO.</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/35633190?v=4 | zshell | a2p1k02/zshell | 2025-05-14T08:01:21Z | This is a simple shell that was coded in the Zig programming language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/a2p1k02/zshell/tags | - | [
"linux",
"shell",
"unix",
"unix-shell",
"zig",
"ziglang"
] | 2 | false | 2025-05-14T08:05:10Z | true | false | unknown | github | [] | zshell
Zshell - Zig shell. This is a simple shell that was coded in the Zig programming language.
So, if I test this shell correct, it will work great
How to build
<ol>
<li>Install all dependencies e.g.
<code>doas pacman -Syu zig</code></li>
<li>Build it
<code>zig build</code></li>
<li>Run it
<code>zig build run</code></li>
<li>If you complete all steps, you will see this prompt
<code>a2p1k02@archlinux /home/a2p1k02/Projects/zig/zshell $</code></li>
</ol> | [] |
https://avatars.githubusercontent.com/u/44649669?v=4 | zig-compile-commands | Tomcat-42/zig-compile-commands | 2025-04-08T18:27:33Z | compile_commands.json generation for c projects using zig build | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/Tomcat-42/zig-compile-commands/tags | MIT | [
"build",
"c",
"compile-commands",
"compile-commands-json",
"zig",
"zig-build",
"zig-build-system"
] | 5 | false | 2025-04-08T19:34:11Z | true | true | 0.15.0-dev.208+8acedfd5b | github | [] | zig compile commands
Simple build module to generate a <code>compile_commands.json</code>
file from <a>clang compilation database fragments</a> dir.
Note: I will only maintain support for zig master.
Usage
Fetch the package:
<code>sh
zig fetch --save=compile_commands git+https://github.com/Tomcat-42/zig-compile-commands</code>
Add the <code>-gen-cdb-fragment-path <DIR></code> flag to your target. Here could be any dir,
for example the zig cache:
```zig
const flags: []const []const u8 = &.{
"-std=c23",
"-Wall",
"-Wextra",
"-Werror",
"-Wpedantic",
"-fno-strict-aliasing",
"-gen-cdb-fragment-path",
b.fmt("{s}/{s}", .{ b.cache_root.path.?, "cdb" }),
};
const mod = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.pic = true,
});
mod.addIncludePath(b.path("include"));
mod.addCSourceFiles(.{
.root = b.path("src"),
.files = &.{"main.c"},
.flags = flags,
});
const exe = b.addExecutable(.{
.name = "exe",
.root_module = mod,
});
```
Now, create the step. The arguments are the fragments dir(the same that you added to the flags)
and the resulting <code>compile_commands.json</code> path:
<code>zig
const cc_step = b.step("cc", "Generate Compile Commands Database");
const gen_file_step = try GenCompileCommands.createStep(
b,
b.fmt("{s}/{s}", .{ b.cache_root.path orelse "./", "cdb" }),
b.fmt("{s}/{s}", .{ b.cache_root.path orelse "./", "compile_commands.json" }),
);
gen_file_step.dependOn(&exe.step);
cc_step.dependOn(gen_file_step);</code>
Finally, generate the file:
<code>sh
zig build cc</code> | [] |
https://avatars.githubusercontent.com/u/54773474?v=4 | zinit | ComixHe/zinit | 2025-03-26T19:19:39Z | A tiny init for linux container. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ComixHe/zinit/tags | MIT | [
"container",
"init",
"linux",
"zig"
] | 21 | false | 2025-05-21T17:43:49Z | true | true | 0.15.0-dev.621+a63f7875f | github | [
{
"commit": "refs",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | zinit
A tiny init written in Zig for linux container, which for forwarding signal and recycling dead processes.
Requirements
<ul>
<li>Zig compiler (>= 0.14.0)</li>
<li>Linux >= 3.4 (for PR_SET_CHILD_SUBREAPER)</li>
<li>Linux kernel supports signalfd</li>
</ul>
Installation & Build
<code>bash
git clone <repo_url> && cd <project_dir>
zig build --release=safe</code>
CommandโLine Options
```Text
Usage: zinit [OPTIONS] -- [args...]
Options:
-h, --help Show help and exit
-v, --version Show version and exit
-s, --signal The triggered signal when parent process dies
--forward-mode The mode of forwarding signals to child processes
```
<ul>
<li><code><command></code>: The binary to execute.</li>
<li><code>[args...]</code>: Arguments passed to the child process.</li>
</ul>
Examples
```bash
!/path/to/zinit /bin/bash
export YOUR_ENV=SOME_VALUE
do some preparing
exec my-binary
```
Configuration & Environment Variables
you can build from source with '-Dtracing-child=true' or set <strong>ZINIT_TRACING_CHILD=ON</strong> at runtime to make child process waiting before execvpe.
The priority of <strong>ZINIT_TRACING_CHILD</strong> is higher than build config, you can set this to <strong>ON</strong> or <strong>OFF</strong> to override config value.
One usage is using strace to tracing child process.
License
This project is licensed under the MIT License. See the <code>LICENSE</code> file for details. | [] |
https://avatars.githubusercontent.com/u/26410371?v=4 | nix-zon-parser | Jeansidharta/nix-zon-parser | 2025-02-21T18:56:30Z | A nix library to parse build.zig.zon files into a nix expression | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Jeansidharta/nix-zon-parser/tags | MIT | [
"nix",
"zig",
"ziglang"
] | 9 | false | 2025-02-24T06:03:55Z | false | false | unknown | github | [] | Zon parser to Nix expression
This is a function to conver a <code>.zon</code> expression to a nix value. <code>.zon</code> files are related to the <a>zig</a> language and are mainly used to declare project metadata, such as version, name, and dependencies.
Motivation
Currently there are very few tools to package zig projects in nix. The main issue is zig's dependencies. During build, zig will try to fetch any missing dependencies from the internet; however, since nix builds are pure, they don't have internet access. Therefore, if we want to package a zig project, we must fetch it ourselves before zig build, and provide these packages to zig using the <code>zig build --system <PREFETCHED_DEPENDENCIES></code> command.
The manual way of doing it is to create a nix flake and populate its inputs with the project's dependencies. We then need to patch <code>build.zig.zon</code> to point to our fetched dependency, instead of a URL.
With this project, we could instead read the project's dependencies during evaluation, and automatically fetch theses dependencies using <a><code>fetchurl</code></a> with the correct hash and version. It would then be very painless to maintain a flake for any zig project.
Usage
The recomended way of using this is through flakes. Simply add this into your inputs and use its <code>parse</code> output:
```nix
{
inputs.nix-zon-parser.url = "github:Jeansidharta/nix-zon-parser";
outputs = { nix-zon-parser, ... }: let
parsed = nix-zon-parser.parse (builtins.readFile ./build.zig.zon);
inherit (parsed) name version dependencies;
<code> # You can then use these variables to create your derivation
in {
# Rest of your flake
};
</code>
}
```
Issues
The project is not currently very robust. It is not very well tested, and might give weird results if the zon file is not correctly formated. This project is not meant to validate a zon file, but instead to read data from a valid zon file. Therefore, it assumes the file is correctly formated while parsing it. If you encounter any issues using it, please open an issue.
Testing
The <code>test.sh</code> script should run all automated tests.
Comparison with Zon2nix
<a>zon2nix</a> is a project that is similar in spirit, but has a very different purpose.
zon2nix is a CLI script that will take a <code>build.zig.zon</code> file as an argument and spit in stdout a nix expression with all of the file's dependencies. Since it's a CLI application, it cannot be used by nix to fetch the project's dependencies at runtime. The user must first manually call <code>zon2nix build.zig.zon > dependencies.nix</code> an then import these dependencies in their derivation script. Another issue is that zon2nix only cares about the dependencies, and so it cannot be used to fetch othe metadata, such as the project name or version.
This project is a parser entirely written in nix. This means it is significantly slower than zon2nix, but it allows us to use the information in <code>build.zig.zon</code> to make a derivation. The user can then do things like
<code>nix
{
parsedBuild = parse (builtins.readFile ./build.zig.zon);
projectName = parsedBuild.name;
projectVersion = parsedBuild.version;
projectDependencies = parsedBuild.dependencies;
}</code>
Contributing
If you wish to open an issue or a PR, feel free to do so. I'll do my best to respond in a timely manner. | [] |
https://avatars.githubusercontent.com/u/67539676?v=4 | zig-wc | guuzaa/zig-wc | 2025-02-27T14:14:55Z | A simple word count program written in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/guuzaa/zig-wc/tags | Unlicense | [
"binutils",
"zig",
"ziglang"
] | 12 | false | 2025-03-06T12:29:34Z | true | true | unknown | github | [] | wc - Word Count Utility in Zig
A modern implementation of the classic Unix <code>wc</code> utility written in the Zig programming language. This tool counts lines, words, and characters in text files or from standard input.
Features
<ul>
<li>Count lines, words, and characters in files or from stdin</li>
<li>Selectively display only the counts you need</li>
<li>Process multiple files at once with totals</li>
<li>Clean, modular codebase with comprehensive test coverage</li>
</ul>
Installation
Prerequisites
<ul>
<li>Zig compiler (0.13 or later recommended)</li>
</ul>
Building from Source
Clone the repository and build using Zig's build system:
<code>bash
git clone https://github.com/yourusername/wc.git
cd wc
zig build</code>
The executable will be available at <code>zig-out/bin/wc</code>.
Installing System-wide
<code>bash
zig build install</code>
Usage
```
Usage: wc [OPTION]... [FILE]...
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified. If no FILE is specified, read standard input.
Options:
-c print the byte counts
-l print the newline counts
-w print the word counts
-h, --help display this help and exit
With no options, print line, word, and byte counts.
```
Examples
Count lines, words, and characters in a file:
<code>bash
wc file.txt</code>
Count only lines in multiple files:
<code>bash
wc -l file1.txt file2.txt</code>
Count words from standard input:
<code>bash
cat file.txt | wc -w</code>
Project Structure
<ul>
<li><code>src/main.zig</code>: Entry point and main program flow</li>
<li><code>src/counter.zig</code>: Core counting functionality</li>
<li><code>src/options.zig</code>: Command-line options handling</li>
<li><code>src/formatter.zig</code>: Output formatting</li>
<li><code>src/cli.zig</code>: Command-line argument parsing</li>
<li><code>build.zig</code>: Build configuration</li>
</ul>
Development
Running Tests
<code>bash
zig build test</code>
Building with Different Optimization Levels
```bash
Debug build
zig build -Doptimize=Debug
Release build
zig build -Doptimize=ReleaseFast
```
How It Works
The program reads input either from files specified on the command line or from standard input if no files are provided. It counts:
<ul>
<li><strong>Lines</strong>: The number of newline characters (<code>\n</code>)</li>
<li><strong>Words</strong>: Sequences of non-whitespace characters</li>
<li><strong>Characters</strong>: The total number of bytes</li>
</ul>
For each file, it displays the requested counts along with the filename. If multiple files are processed, a total line is displayed at the end.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the Unlicense License - see the <code>LICENSE.txt</code> file for details. | [] |
https://avatars.githubusercontent.com/u/131526244?v=4 | glfw-demo | 7R35C0/glfw-demo | 2025-04-01T14:42:51Z | Simple demos of using GLFW library. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/7R35C0/glfw-demo/tags | MIT | [
"glfw",
"glfw-demo",
"zig",
"zig-build-system"
] | 119 | false | 2025-04-06T11:26:44Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "glfw",
"tar_url": "https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip"
}
] |
README
The repo contains simple demos of using <a>GLFW</a>
library.
Tested only with Linux Fedora 41, X11, glfw 3.4.0 and zig 0.14.0
๐ Requirement
Before running the demos, check
<a>GLFW 3.4.0</a>
requirements, especially installing dependencies, and install
<a>Zig 0.14.0</a>
programming language.
Also install <a>CMake (3.30.8)</a> and
<a>Clang (19.1.7)</a>, these versions are informative,
the code may or may not work with other versions.
๐ Implementation
Repo uses the <a>Zig Build System</a>
to build and run the demos written in C language. The GLFW library itself
is configured, built, and installed as dependency with CMake, via the zig
build system.
๐ Usage
Run <code>zig build dep</code> step once to fetch, configure, build and install C/C++
dependencies, the results will be in the <code>include</code> and <code>lib</code> folders.
This step will only need to be run again if dependencies or their configs
have been changed.
Use <code>zig build run -- demo/<folder_name></code> step to run a demo, the output
will be in <code>zig-out/bin</code>. The <code>zig build run</code> step uses the <code>src</code> folder
by default.
๐ Final note
More information are in <a>build.zig</a> and each demo file.
However, for more detailed information or other use cases of library,
please refer to <a>GLFW documentation</a>
and related guides.
Unless explicitly stated otherwise, the source codes are licensed under
the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/371708?v=4 | ecpz | apirogov/ecpz | 2025-03-11T01:15:56Z | Evaluate C++ using Python and Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/apirogov/ecpz/tags | MIT | [
"clang",
"cpp",
"python",
"zig"
] | 38 | false | 2025-04-13T14:20:14Z | false | false | unknown | github | [] | ecpz - <strong>E</strong>valuate <strong>C</strong>++ using <strong>P</strong>ython and <strong>Z</strong>ig
Do you need to evaluate some simple C++ code from inside your application,
and it should work cross-platform (Linux, Mac and Windows) without causing a headache?
You've seen it all, <a>quine-relay</a> stopped
being amusing years ago, and you feel the itch for something new?
No problem, <em>easy-peasy with <code>ecpz</code>!</em>
This little package combines the ubiquity of Python and ingeniuity of the Zig
toolchain to give you the ability to compile C++ snippets without pain.
If you have a non-trivial project consisting of more than one source file,
you should probably configure and build it properly using e.g. <a>CMake</a>.
If you need an interactive C++ code execution environment (i.e. a REPL),
check out <a>cling</a>.
But if for some reason you need to produce and execute some ad-hoc throw-away
C++ snippets as a part of your workflow, <code>ecpz</code> might be just what you need!
Usage
Install <code>ecpz</code> using <code>pip</code> or <code>uv</code> and check <code>ecpz --help</code> for all options.
In the following, the features of <code>ecpz</code> are illustrated by some examples.
<code>ecpz run</code>
Compile and run a single source file provided either as argument or via standard input.
For example, create <code>hello.cpp</code>:
```cpp
include
int main() {
std::println("Hello world!");
}
```
And run it:
<code>bash
$ cat hello.cpp | ecpz --clang-arg -std=c++23 run
Hello world!</code>
<code>ecpz print</code>
Evaluates some expressions and pretty-print them using <code>std::print(ln)</code> <em>(note that this automatically implies <code>-std=c++23</code>)</em>.
For example, create a header <code>prelude.hpp</code>:
```cpp
include
include
inline double tau() {
return 2 * std::numbers::pi;
}
```
And now run:
<code>bash
$ ecpz --prelude prelude.hpp print "{:.3f} {} {} {}" "tau()" "[](){ int i=0; ++i; return i; }()" "std::is_same_v<int, double>" "std::is_same_v<int, int32_t>"
6.283 1 false true</code>
You can set the <code>ECPZ_PRELUDE</code> environment variable to the path of your custom
header to make it always included by default. Note that as usual, CLI arguments
override equivalent environment variables.
Creating a Quine
Usually, using I/O to let code open itself directly is forbidden and considered bad sportsmanship.
Everybody agrees that the following things are clear cases of cheating:
<ul>
<li>reading a hard-coded string filename</li>
<li>using the <code>argv[0]</code> trick to reflect back the name of the current file/executable</li>
<li>reading the file using some compile- or runtime reflection capabilities of the programming language</li>
<li>adding and using a special <code>quine</code> command in a custom programming language or environment</li>
</ul>
We will do none of these things. Create some source file <code>FILE</code> with the following content:
```cpp
include "ecpz/subprocess.hpp"
int main(int i, char** a) {
using b = std::istreambuf_iterator; using c = std::string;
auto d = <a></a>{ std::ifstream f(e, std::ios::binary); return c(b(f), b()); };
std::vector e(i+3, a[i-1]); e[0]="ecpz"; e[1]="run";
auto f = i%2 == 0 ? subprocess::run(e).output : d(a[i-1]);
subprocess::set_bin(); std::cout<<f;
}
```
Now run it with <code>ecpz run FILE FILE</code> and convince yourself that we do not cheat in
such despicable and reprehensible ways as the ones listed above!
Spoiler
Nobody ever said that we cannot just...
* run a C++ source file through `ecpz`,
* which uses a Python package,
* which provides the `zig` toolchain,
* which provides `clang`,
* to compile and then run the program, which
* runs its arguments through `ecpz`,
* compiling and then running the same program, which now finally
* prints the file passed to it as the argument
Or, at least *I* did not get the memo that this is illegal.
In that case I apologize for wasting your time.
But even *if* this is still cheating -
isn't cheating in glorious ways not also a form of *art*?
Limitations
The following issues are fixable, i.e. only a matter of more effort and time:
<ul>
<li>currently only synchronous execution is supported, no I/O buffering or streaming</li>
<li>currently it is not possible to pipe input data into <code>ecpz run</code> to pass it as stdin</li>
</ul>
Acknowledgements
Thanks to <a>sheredom</a>
for creating <a>subprocess.h</a>,
the only true header-only C(++) subprocess library I could find! | [] |
https://avatars.githubusercontent.com/u/735975?v=4 | libversion-zig | godsarmy/libversion-zig | 2025-04-02T04:57:02Z | libversion-zig is a small wrapper around libversion C API, making it easier to use with Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/godsarmy/libversion-zig/tags | MIT | [
"libversion",
"zig"
] | 21 | false | 2025-04-12T13:35:23Z | true | true | 0.14.0 | github | [
{
"commit": "refs",
"name": "libversion",
"tar_url": "https://github.com/repology/libversion/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/repology/libversion"
}
] | libversion-zig
This package is a thin wrapper around <a>libversion</a>'s C API.
Its release version is in synchronization with <a>libversion release</a>.
Installation
<code>sh
zig fetch --save git+https://github.com/godsarmy/libversion-zig</code>
Now in your build.zig you can access the module like this:
<code>zig
const libversion = b.dependency("libversion", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("libversion", libversion.module("libversion"));</code>
Usage
<ul>
<li>Import <code>libversion-zig</code> like this:
<code>zig
const libversion = @import("libversion");</code></li>
<li>
Call Functions in <code>libversion-zig</code>
```zig
// execute versionCompare2
_ = libversion.versionCompare2("1.0", "1.1"); // return -1
_ = libversion.versionCompare2("2.0", "1.9"); // return 1
_ = libversion.versionCompare2("2.0", "2.0"); // return 0
// execute versionCompare4
_ = libversion.versionCompare4(
"1.0p1",
"1.0pre1",
libversion.flag.VERSIONFLAG_P_IS_PATCH,
libversion.flag.VERSIONFLAG_P_IS_PATCH,
); // return 1
_ = libverison.versionCompare4(
"1.0p1",
"1.0patch1",
libversion.flag.VERSIONFLAG_P_IS_PATCH,
libversion.flag.VERSIONFLAG_P_IS_PATCH,
); // return 0
_ = libversion.versionCompare4(
"1.0p1",
"1.0post1",
libversion.flag.VERSIONFLAG_P_IS_PATCH,
libversion.flag.VERSIONFLAG_P_IS_PATCH,
); // return 0
```
</li>
</ul>
Zig Release support
<code>libversion-zig</code> keeps track the specification of latest <a>stable version of Zig</a>.
Currently, it can only be built by <a>Zig 0.14</a>.
The plan is to support releases once Zig 1.0 is released but this can still change.
Development & Build
<ul>
<li>Install <a>Zig 0.14</a>.</li>
<li>Clone project by git.</li>
<li>In project workspace, run build/test by <code>zig</code> command.
<code>sh
zig build test</code></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/61741851?v=4 | Leetcode | Abdoelabassi/Leetcode | 2025-04-16T10:11:33Z | Solving Leetcode problems using different programming languages: C/C++, Fortran, Python, Rust, Java, Go, Zig, JS/TS | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Abdoelabassi/Leetcode/tags | - | [
"algorithms",
"bigonotation",
"clang",
"datastructures",
"fortran",
"golang",
"java",
"leetcode",
"rust",
"typescript",
"zig"
] | 1,587 | false | 2025-04-27T18:04:10Z | false | false | unknown | github | [] | Leetcode problems
This repository contains solutions to various Leetcode problems.
The solutions are written with different programming languages, including Python, Java, Rust, Go, Zig, and C++.
Each solution is designed to be efficient and easy to understand.
Directory Structure
Data structures and algorithms
impelemnting various data structures and algorithms in different programming languages.
Leetcode problems
solving various leetcode problems in different programming languages.
Author
EL Abassi Abderrazaq | [] |
https://avatars.githubusercontent.com/u/192961174?v=4 | ziro-sleep | dacheng-zig/ziro-sleep | 2025-04-02T12:06:19Z | coroutine sleep in zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/dacheng-zig/ziro-sleep/tags | - | [
"coroutine",
"zig",
"zoroutine"
] | 19 | false | 2025-05-10T05:23:45Z | true | true | 0.14.0 | github | [
{
"commit": "94ed6af7b2aaaeab987fbf87fcee410063df715b",
"name": "libxev",
"tar_url": "https://github.com/mitchellh/libxev/archive/94ed6af7b2aaaeab987fbf87fcee410063df715b.tar.gz",
"type": "remote",
"url": "https://github.com/mitchellh/libxev"
},
{
"commit": "47fbfb27b143ccde055f3f07444d2... | ziro-sleep
This is a coroutine sleep example, powered by ziro, which is a coroutine engine.
<blockquote>
ziro: https://github.com/dacheng-zig/ziro
libxev: https://github.com/mitchellh/libxev
</blockquote>
Run
<code>shell
zig build run</code>
Release
<code>shell
zig build -Doptimize=ReleaseSmall</code>
Then check <code>zig-out/bin</code>. | [] |
https://avatars.githubusercontent.com/u/126345041?v=4 | zig_freetype2 | PaNDa2code/zig_freetype2 | 2025-04-22T17:03:48Z | Minimal Zig wrapper around FreeType2 | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/PaNDa2code/zig_freetype2/tags | MIT | [
"freetype2",
"zig"
] | 11 | false | 2025-05-10T17:48:06Z | true | true | 0.14.0 | github | [
{
"commit": "refs",
"name": "freetype",
"tar_url": "https://github.com/freetype/freetype/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/freetype/freetype"
}
] | zig_freetype2
<strong>zig_freetype2</strong> is a minimal Zig wrapper around FreeType2, designed to make integrating FreeType into Zig projects easier.
Usage
1. Add as a dependency
Use <code>zig fetch</code> to add the module to your project:
<code>bash
zig fetch --save git+https://github.com/PaNDa2code/zig_freetype2</code>
2. Add to your build script
In your <code>build.zig</code> file:
```zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
<code>const freetype = b.dependency("zig_freetype2", .{});
const freetype_mod = freetype.module("zig_freetype2");
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe_mod.addImport("freetype", freetype_mod);
const exe = b.addExecutable(.{
.name = "my_project",
.root_module = exe_mod,
.linkage = if (target.result.abi == .musl) .static else .dynamic,
});
b.installArtifact(exe);
</code>
}
```
3. Use in your project
Example:
```zig
const std = @import("std");
const freetype = @import("freetype");
pub fn main() !void {
const gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
defer gpa.deinit();
<code>const library = try freetype.Library.init(allocator);
defer library.deinit();
const face = try library.face("arial.ttf");
defer face.deinit();
const glyph = try face.getGlyph('A');
defer glyph.deinit();
</code>
}
```
Current Status
This project is currently incomplete and depends on <strong>libc</strong>.
The long-term goal is to remove the libc dependency entirely and support more platforms. | [
"https://github.com/PaNDa2code/zterm"
] |
https://avatars.githubusercontent.com/u/13835680?v=4 | project-picker | reykjalin/project-picker | 2025-05-16T05:21:15Z | CLI to select from a pre-defined list of items with filtering support | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/reykjalin/project-picker/tags | MIT | [
"cli",
"fuzzy",
"zig"
] | 11 | false | 2025-05-16T05:23:09Z | true | true | 0.14.0 | github | [
{
"commit": "84d6cb381c0d628550fac3f6daa24c5faf7b2cd1",
"name": "vaxis",
"tar_url": "https://github.com/rockorager/libvaxis/archive/84d6cb381c0d628550fac3f6daa24c5faf7b2cd1.tar.gz",
"type": "remote",
"url": "https://github.com/rockorager/libvaxis"
},
{
"commit": "aa24df42183ad415d10bc0a3... | Project picker
Presents a filterable list of pre-defined strings from <code>~/.config/project-picker/projects</code> for you to select and provide to some shell command.
Once an item in the list is selected <code>project-picker</code> will print the full path to STDOUT.
<strong>Exit codes:</strong>
<ul>
<li>If an item is picked <code>project-picker</code> will exit with status <code>0</code>.</li>
<li>If no item is chosen <code>project-picker</code> will exit with status <code>1</code>.</li>
<li>If <code>Ctrl-C</code> is used to close <code>project-picker</code> instead of selecting an item it will exit with status <code>1</code>.</li>
<li>If an error occurred <code>project-picker</code> will exit with status <code>74</code> and an error message is printed to STDERR.</li>
</ul>
Usage example: jump between project folders
Add a list of the projects you want easily available to a config file, then run <code>project-picker</code>.
<code>project-picker</code> will print the selected project path to STDOUT.
Add project paths to the config file
<code>~/projects/project-a
~/projects/project-b
/Users/jdoe/projects/project-c
~/projects/sub-projects/*</code>
If you end a path with <code>/*</code> <code>project-picker</code> will list all the directories in that folder.
Example: jump between projects with cd
Put in a shell script or alias:
```fish
~/.config/fish/functions/pp.fish
Fish alias for project-picker, usage: pp
function pp
set dir (project-picker)
# A non-zero exit code means no project was selected.
if test $status -eq 0
cd $dir
end
end
```
Usage example: pass result to command
This is the quick and dirty way to use <code>project-picker</code>.
If an error occurs or you don't pick an item nothing will be passed to the command.
```bash
<code>cd</code> to selected item.
cd $(project-picker)
Open selected item in vim.
vim $(project-picker)
```
Build <code>project-picker</code>
```sh
Will place <code>project-picker</code> in ./zig-out/bin
zig build -Doptimize=ReleaseSafe
Will place <code>project-picker</code> in ~/.local/bin
zig build -Doptimize=ReleaseSafe --prefix ~/.local
``` | [] |
https://avatars.githubusercontent.com/u/2475286?v=4 | zfixlang | thejchap/zfixlang | 2025-04-03T06:49:30Z | simple interpreter for prefix expressions | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/thejchap/zfixlang/tags | - | [
"interpreter",
"zig"
] | 20 | false | 2025-04-08T23:45:22Z | true | true | 0.14.0 | github | [] | zfixlang
a simple interpreter for prefix expressions in zig to get a feel for the language. implemented with both ast generation as well as just a single pass through the string
syntax:
<code>(+ 1 1)
(* 2 (+ 42 1))</code>
resources
<ul>
<li><a>https://v2.pauladamsmith.com/2024/07/writing-an-interpreter-in-go-in-zig-part-5/</a></li>
<li><a>https://zig.news/edyu/zig-unionenum-wtf-is-switchunionenum-2e02</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/193276332?v=4 | baogao | andoni-hazaiah/baogao | 2025-03-04T18:17:59Z | baogao (bร ogร o) is a flexible and extensible logging library for the Zig Programming Language. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/andoni-hazaiah/baogao/tags | MIT | [
"extensible",
"flexible",
"logger",
"logging",
"logging-library",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 11 | false | 2025-03-08T21:26:16Z | true | true | unknown | github | [] | <strong><code>baogao</code></strong> (<code>bร ogร o</code>) is a flexible and extensible logging library for the Zig Programming Language.
Usage
TODO | [] |
https://avatars.githubusercontent.com/u/1906851?v=4 | dizazm | jhark/dizazm | 2025-05-16T16:34:25Z | A command-line tool for Windows that disassembles symbols in PE files. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/jhark/dizazm/tags | ISC | [
"asm",
"windows",
"x86-64",
"zig",
"zig-package"
] | 12 | false | 2025-05-16T16:37:10Z | true | true | 0.14.0 | github | [
{
"commit": "0e2491d8e6d2be38dc0c2ce8e103469886e468bb",
"name": "flags",
"tar_url": "https://github.com/joegm/flags/archive/0e2491d8e6d2be38dc0c2ce8e103469886e468bb.tar.gz",
"type": "remote",
"url": "https://github.com/joegm/flags"
},
{
"commit": "6035a194bea8472c463345b86c3ef9333490ecfe... | dizazm
A command-line tool for Windows that disassembles symbols in PE files.
Uses <a>Capstone</a> and <a>dbghelp.dll</a>.
Requirements
<ul>
<li>Windows.</li>
<li>Zig compiler (version 0.14.0)</li>
</ul>
Building
<code>sh
zig build</code>
Usage
```
Usage: dizazm [-s | --symbol ] [-a | --address
]
[-l | --length ] [-b | --bytes] [-h | --help]
Disassembles a specified symbol from a Portable Executable (PE) file (.exe, .dll).
Example:
dizazm -s CreateFileW kernel32.dll
Options:
-s, --symbol The name of the symbol to disassemble
-a, --address The address to disassemble (e.g., 0x1000)
-l, --length Number of bytes to disassemble
-b, --bytes Print raw instruction bytes
-h, --help Show this help and exit
Arguments:
```
Note: For dbghelp support you will need to place dbghelp.dll (and optionally symsrv.dll) in the same directory as dizazm.exe. You can get these from the <a>Windows Debugging Tools</a>. The DLL is loaded on demand, so dizazm will work without it, but only be able to find symbols in the export table.
If symsrv.dll is made available then you may also specify a symbol path via <code>_NT_SYMBOL_PATH</code> see <a>Using SymSrv</a>.
E.g. <code>_NT_SYMBOL_PATH="srv*https://msdl.microsoft.com/download/symbols"</code>.
License
This project is licensed under the ISC License - see the <a>LICENSE</a> file for details. | [] |
https://avatars.githubusercontent.com/u/64004309?v=4 | 6502-emulator | asynched/6502-emulator | 2025-02-27T02:47:16Z | A 6502 processor emulator in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/asynched/6502-emulator/tags | - | [
"6502",
"zig"
] | 5 | false | 2025-02-27T04:11:35Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/183272735?v=4 | coroutines-zig | ciathefed/coroutines-zig | 2025-03-09T23:15:24Z | Zig bindings for tsoding's coroutines library | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ciathefed/coroutines-zig/tags | MIT | [
"coroutines",
"zig",
"zig-package"
] | 13 | false | 2025-03-13T00:14:08Z | true | true | 0.14.0 | github | [] | coroutines-zig
Zig bindings for tsoding's <a>coroutines</a> library
Install
<code>shell
zig fetch --save "git+https://github.com/ciathefed/coroutines-zig#v0.1.0"</code>
Add the following to <code>build.zig</code>:
<code>zig
const coroutines = b.dependency("coroutines", .{
.target = target,
.optimize = optimize,
});
exe_mod.addImport("coroutines", coroutines.module("coroutines"));</code>
Example
```zig
const std = @import("std");
const coroutines = @import("coroutines");
fn counter(arg: ?*anyopaque) callconv(.C) void {
const n = @as(usize, @intCast(@intFromPtr(arg)));
for (0..n) |i| {
std.debug.print("[{}] {}\n", .{ coroutines.id(), i });
coroutines.yield();
}
}
pub fn main() !void {
coroutines.init();
<code>coroutines.go(counter, @ptrFromInt(5));
coroutines.go(counter, @ptrFromInt(10));
while (coroutines.alive() > 1) {
coroutines.yield();
}
</code>
}
```
You can find more examples <a>here</a> | [] |
https://avatars.githubusercontent.com/u/1731652?v=4 | zig-mpi-template | ssande7/zig-mpi-template | 2025-03-09T23:20:04Z | Basic template for using MPI with zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ssande7/zig-mpi-template/tags | MIT | [
"mpi",
"zig"
] | 11 | false | 2025-03-10T11:02:40Z | true | true | 0.14.0 | github | [] | Basic template for using MPI with zig. Only tested with OpenMPI 5.0.5-2 for now, but
likely works with other (recent) versions.
Might expand to other implementations in future.
All steps for creating an <code>mpi</code> zig module are in
<a><code>build_mpi.zig</code></a>, which:
- Finds the system MPI header
- Makes a temporary copy in the zig cache with the <code>OMPI_PREDEFINED_GLOBAL</code>
macro definition and usage patched to be friendly
to <code>translate-c</code>
- Sets up the <code>translate-c</code> build step
- Provides a helper function for linking MPI
Relies on being able to call <code>mpicc --showme:arg</code> to query include directories,
library directories, and the MPI library name for linkage.
Also checks link flags to extract rpath if possible, although this may not work
if the base compiler is not <code>gcc</code>, and all other flags are currently ignored. | [] |
https://avatars.githubusercontent.com/u/22117584?v=4 | st | Nish7/st | 2025-03-17T18:48:32Z | Smalltalk + Zig Playground | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Nish7/st/tags | - | [
"smalltalk",
"zig"
] | 2 | false | 2025-03-25T19:11:53Z | false | false | unknown | github | [] | st
smalltalk + zig playground
Smalltalk
Installation
<ul>
<li>Using GNU Smalltalk 3.2.5</li>
<li>Avoiding the Pharo due to the size of the image and the complexity of the environment</li>
<li>All <code>.st</code> are scripts that can be run with <code>gst <script>.st</code></li>
<li><code>gst</code> is the GNU Smalltalk interpreter.</li>
<li>Documentation: <a>GNU Smalltalk</a></li>
</ul>
<strong>Note</strong>: The scripts are not using the Smalltalk dialects of Pharo or Squeak. They are using the GNU Smalltalk dialect. | [] |
https://avatars.githubusercontent.com/u/85001747?v=4 | qik | voidwyrm-2/qik | 2025-04-05T14:39:00Z | A simple register-based virtual machine | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/voidwyrm-2/qik/tags | Apache-2.0 | [
"bytecode",
"bytecode-virtual-machine",
"virtual-machine",
"vm",
"zig"
] | 13 | false | 2025-05-09T07:02:00Z | true | true | 0.14.0 | github | [] | Qik
Notice
I am no longer maintaining or working on Qik whatsoever
Qik is a simple register-based virtual machine | [] |
https://avatars.githubusercontent.com/u/85955025?v=4 | SDL_GPU-Learning | Liam-Malone/SDL_GPU-Learning | 2025-03-19T23:22:10Z | Using SDL3's SDL_gpu backend to learn graphics programming | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/Liam-Malone/SDL_GPU-Learning/tags | - | [
"glsl",
"graphics",
"graphics-programming",
"sdl3",
"sdl3-gpu",
"zig"
] | 15,420 | false | 2025-05-17T12:41:37Z | true | true | unknown | github | [
{
"commit": null,
"name": "sdl",
"tar_url": null,
"type": "relative",
"url": "deps/SDL"
}
] | SDL_GPU Learning
Learning how to write a basic renderer on top of SDL3's SDL_gpu API.
This will hopefully be the renderer that gets used in GAME (My game project, yet-to-be-titled). For now that project remains on the standard SDL3 SDL_Renderer (built for OpenGL backend), but hopefully I can progress this renderer and get it to a good enough stage to not have to deal with that dual-state management nightmare.
Resources
<ul>
<li>
Will largely be referencing the <a>SDL_gpu_examples</a>.
</li>
<li>
I will likely also pull on the LearnOpenGL book, and maybe some of XorDev's shader posts.
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/152508846?v=4 | bb | haha-systems/bb | 2025-05-19T21:48:02Z | bb is always watching | origin | 0 | 0 | 0 | 0 | https://api.github.com/repos/haha-systems/bb/tags | MIT | [
"file-watcher",
"zig",
"ziglang"
] | 14 | false | 2025-05-19T22:14:59Z | true | true | 0.14.0 | github | [] | bb
a little file event watcher written in <a>zig</a>.
*<em>sorry: currently linux only</em>
building
<ol>
<li><code>zig build --release=fast</code></li>
<li><code>cp zig-out/bin/bb ~/.local/bin</code> (or wherever you want it)</li>
</ol>
usage
<code>bb <path> "<pattern>" -- <command> [args..]</code>
<code>path</code> - the path to watch for events, includes all subdirs, uses .gitignore if available, supports relative or absolute paths
<code>pattern</code> - a simple pattern to filter for specific files, supports simple glob (<em>) and maybe (?) parameters, e.g. <code>*.zig</code> or <code>?prefix_*.zig</code>, uses .gitignore if available, </em><em>must be enclosed in quotes</em>*
<code>--</code> to pass the next args to <code>bb</code>
<code>command</code> - the command you want to run on file events
<code>args...</code> - any additional args for the command
full example
<code>bash
bb . "*.zig" -- zig build test --summary all</code>
this will cause any changes to *.zig files in the current directory and below to trigger a test build to run
why?
<ul>
<li>learning zig/linux stuff</li>
<li>i needed a file watcher, so i made one</li>
</ul>
why not just use X?
see <a>why?</a>
license
see <a>LICENSE.md</a> | [] |
https://avatars.githubusercontent.com/u/208390463?v=4 | SelvaDisk | SystemElva/SelvaDisk | 2025-05-16T09:06:08Z | Scriptable disk image creator written in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/SystemElva/SelvaDisk/tags | MPL-2.0 | [
"disk-image",
"image-creator",
"operating-system",
"operating-systems",
"os",
"osdev",
"zig",
"ziglang"
] | 44 | false | 2025-05-20T12:36:05Z | true | true | unknown | github | [
{
"commit": "7f8ff4c0099034f0dbec95f1d3b4dfe066ef0ff0",
"name": "SelvaFat",
"tar_url": "https://github.com/SystemElva/SelvaFat//archive/7f8ff4c0099034f0dbec95f1d3b4dfe066ef0ff0.tar.gz",
"type": "remote",
"url": "https://github.com/SystemElva/SelvaFat/"
},
{
"commit": null,
"name": "S... | 404 | [] |
https://avatars.githubusercontent.com/u/40689339?v=4 | zig-exercism | cpmachado/zig-exercism | 2025-03-21T16:17:04Z | My solutions to exercism Zig track | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/cpmachado/zig-exercism/tags | MIT | [
"exercism",
"exercism-solutions",
"zig",
"ziglang"
] | 1 | false | 2025-03-21T16:18:12Z | false | false | unknown | github | [] | zig-exercism-solutions
My solutions to the go track at <a>Exercism</a>.
LICENSE
See <a>LICENSE</a> for details. | [] |
https://avatars.githubusercontent.com/u/12786150?v=4 | trie.zig | hedzr/trie.zig | 2025-04-16T07:06:19Z | key-value storage identified by dotted path | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/hedzr/trie.zig/tags | Apache-2.0 | [
"radix-tree",
"trie",
"trie-tree",
"zig",
"zig-lib",
"zig-library",
"zig-package"
] | 65 | false | 2025-04-17T11:01:50Z | true | true | 0.14.0 | github | [] | trie.zig
<code>trie.zig</code> implement a Trie-tree structure in zig-lang.
<code>trie.zig</code> provides a key value storage identified by the dotted path, such as <code>app.logging.file</code> => <code>/var/log/app/stdout.log</code>.
<code>trie.zig</code> allows these value to be inserted: string, int, float, and boolean. The future vision includes supporting a broader array of data types, which is dependent on the usefulness of zig-lang's syntax as it evolves.
Usage
The usage is,
```zig
const std = @import("std");
const trie = @import("trie_lib");
fn trie_test(writer: anytype) !void {
const GPA = std.heap.GeneralPurposeAllocator;
// var general_purpose_allocator = GPA(.{}){};
// const gpa = general_purpose_allocator.allocator();
var gpa = GPA(.{ .enable_memory_limit = true }){};
const allocator = gpa.allocator();
defer _ = gpa.deinit();
<code>var t = try trie.Trie(trie.NodeValue).init(allocator, "app");
defer t.deinit();
try t.set("logging.file", "/var/log/app/stdout.log");
try t.set("logging.rotate", true);
try t.set("logging.interval", 3 * 24 * 60 * 60 * 1000 * 1000); // 3 days
try t.set("debug", false);
try t.set("deb.install", false);
try t.set("deb.target", "app-debug.deb");
try t.set("debfile", "app-release.deb");
// print("t: {s} \n", .{try t.dump()});
const dstr = try t.dump();
try writer.print("\nt.dump: \n{s} \n", .{dstr});
var v = try t.get("deb.target");
try writer.print("\ndeb.target: {s} \n", .{v.string});
v = try t.get("debfile");
try writer.print("debfile: {s} \n", .{v.string});
v = try t.get("deb.install");
try writer.print("deb.install: {} \n", .{v.boolean});
v = try t.get("logging.interval");
try writer.print("logging.interval: {} \n", .{v.int});
v = try t.get("logging.rotate");
try writer.print("logging.rotate: {} \n", .{v.boolean});
v = try t.get("debug");
try writer.print("debug: {} \n", .{v.boolean});
</code>
}
```
Import <code>trie.zig</code>
Dependency in <code>build.zig.zon</code>
In your <code>build.zig.zon</code>, add a reference to <code>trie.zig</code>:
<code>zig
.{
.name = "my-app",
.paths = .{""},
.version = "0.0.0",
.dependencies = .{
.trie = .{
.url = "https://github.com/hedzr/trie.zig/archive/master.tar.gz",
.hash = "$INSERT_HASH_HERE"
},
},
}</code>
The hash can also be written and updated by this command line:
<code>bash
zig fetch https://github.com/hedzr/trie.zig/archive/master.tar.gz --save</code>
<blockquote>
Instead of <code>master</code> you can use a specific commit/tag.
</blockquote>
Dependency in <code>build.zig</code>
Suppose you should already have an executable, something like:
<code>zig
const exe = b.addExecutable(.{
.name = "my-app",
.root_module = exe_mod,
});</code>
Add the following line:
<code>zig
const trie_dep = b.dependency("trie", .{
.target = target,
.optimize = optimize,
});
std.debug.print("trie_dep: {s} \n", .{trie_dep.builder.modules.keys()});
exe.root_module.addImport("trie", trie_dep.module("trie"));</code>
You can now <code>const trie = @import("trie");</code> in your project.
In your <code>main.zig</code>
Now insert these codes as a first look,
```zig
const trie = @import("trie");
fn trie_test(writer: anytype) !void {
const GPA = std.heap.GeneralPurposeAllocator;
// var general_purpose_allocator = GPA(.{}){};
// const gpa = general_purpose_allocator.allocator();
var gpa = GPA(.{ .enable_memory_limit = true }){};
const allocator = gpa.allocator();
defer _ = gpa.deinit();
<code>var t = try trie.Trie(trie.NodeValue).init(allocator, "app");
defer t.deinit();
try t.set("logging.file", "/var/log/app/stdout.log");
try t.set("logging.rotate", true);
</code>
}
```
APIs
get
Get leaf node value by its dotted path, or an <code>Error</code> on unexisted node or branch node.
set
Set <code>(key, value)</code> pair into trie tree.
dump
Dump internal structure for debugging purpose.
walk
Walk on all nodes.
```zig
test "walker" {
print("\n", .{});
<code>var t = try Trie(NodeValue).init(test_allocator, "app");
defer t.deinit();
try t.set("logging.file", "/var/log/app/stdout.log");
try t.set("logging.rotate", true);
try t.set("logging.interval", 3 * 24 * 60 * 60 * 1000 * 1000); // 3 days
try t.set("debug", false);
try t.set("deb.install", false);
try t.set("deb.target", "app-debug.deb");
try t.set("debfile", "app-release.deb");
try t.walk(walkOnTTree);
</code>
}
fn walkOnTTree(key: []const u8, val: ?*NodeValue, props: anytype) bool {
_ = props.level;
const delim = props.trie.delimiter;
const alloc = props.trie.alloc.allocator();
const node = props.node;
if (node.endsWith(delim) and node.isBranch()) {
print("{}. {s}/\n", .{ props.level, key });
} else if (node.isLeaf()) {
var vs: []const u8 = "(null)";
if (val) |v| {
vs = v.toString(alloc) catch "(nothing)";
}
print("{}. {s} => {s} ; '{s}'\n", .{ props.level, key, vs, node.fragment.? });
}
return false;
}
```
LICENSE
Apache 2.0 | [] |
https://avatars.githubusercontent.com/u/184196411?v=4 | io-bench | Super-ZIG/io-bench | 2025-04-23T03:51:22Z | SuperZIG.io project benchmarks repository. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Super-ZIG/io-bench/tags | MIT | [
"benchmark",
"superzig",
"zig"
] | 27 | false | 2025-04-24T02:17:23Z | true | true | 0.14.0 | github | [] |
<a>
</a>
<a>
</a>
<b>
When simplicity meets efficiency
</b>
<b>
<i>
part of
<a>SuperZig</a>::<a>io</a> library
</i>
</b>
<blockquote>
Well, the library has a lot of stuff, so I'm going to do the comparisons and benchmarks individually. In this table, I've listed all the important comparisons I've done so far (this document is still under development).
</blockquote>
| Target | Implementation | Competitor | Result |
| ------- | -------------------------------------------------------------------------------------- | ------------- | ------ |
| <code>ascii</code> | <a><code>io.string.utils.ascii</code></a> | <code>std.ascii</code> | x1 |
| <code>utf8</code> | <a><code>io.string.utils.utf8</code></a> | <code>std.unicode</code> | x5 |
<blockquote>
<strong><em>To execute the benchmark, use one of the following commands:</em></strong>
</blockquote>
```bash
For optimized performance:
zig build run --release=fast --
For normal performance:
zig build run --
```
<a>
</a>
| [] |
https://avatars.githubusercontent.com/u/47909066?v=4 | zbc-lib | skelitheprogrammer/zbc-lib | 2025-04-01T12:45:37Z | Basic arithmetic evaluation using Shunting Yards algorithm | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/skelitheprogrammer/zbc-lib/tags | MIT | [
"cal",
"libr",
"zig"
] | 7 | false | 2025-04-02T20:01:18Z | true | true | 0.15.0-dev.37+423907c27 | github | [] | Zig basic calculator library
Basic arithmetic evaluation using <a>Shunting Yards</a> algorithm
Installation
<code>zig fetch --save git+https://github.com/skelitheprogrammer/zbc-lib</code>
In build.zig
```
const calculator = b.dependency("zbc", .{
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("zbc", calculator.module("zbc"));
<code>Import in your code</code>
const calculator = @import("zbc");
<code>Call</code>
try calculator.process(&input);
```
Projects using this library
<a>zbc-cli</a>
Limitations
Currently only accepts <code>+</code>,<code>-</code>,<code>/</code>,<code>*</code>,<code>()</code> operators | [] |
https://avatars.githubusercontent.com/u/6431196?v=4 | zit | oswalpalash/zit | 2025-04-05T23:47:38Z | zit - Zig TUI Library | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/oswalpalash/zit/tags | MIT | [
"zig",
"zig-package"
] | 107 | false | 2025-04-19T14:27:59Z | true | false | unknown | github | [] | Zit - A Text User Interface Library for Zig
Zit is a TUI (Text User Interface) library for Zig that enables developers to create interactive terminal applications. The library provides tools for terminal manipulation, input handling, rendering, layout management, and widget creation.
Features
<ul>
<li><strong>Terminal handling</strong>: Cross-platform terminal operations with raw mode support</li>
<li><strong>Text rendering</strong>: Support for colors (named colors), styles (bold, italic, underline), and basic text drawing</li>
<li><strong>Layout system</strong>: Basic layout management with Rect-based positioning</li>
<li><strong>Widget library</strong>: Core UI components including:</li>
<li>Labels</li>
<li>Buttons</li>
<li>Checkboxes</li>
<li>Progress bars</li>
<li>Lists</li>
<li><strong>Input handling</strong>: Keyboard and mouse event processing</li>
<li><strong>Event system</strong>: Basic event handling for widgets</li>
<li><strong>Modern and intuitive API</strong></li>
<li><strong>Efficient memory management</strong></li>
<li><strong>Thread-safe components</strong></li>
<li><strong>Rich widget set</strong></li>
<li><strong>Cross-platform support</strong></li>
<li><strong>Zero dependencies</strong></li>
</ul>
Memory Management
Zit provides a sophisticated memory management system designed for optimal performance and safety in TUI applications. The system includes:
MemoryManager
The core memory management component that coordinates different allocators:
```zig
var memory_manager = try memory.MemoryManager.init(allocator, arena_size, widget_pool_size);
defer memory_manager.deinit();
// Get the arena allocator for temporary allocations
const arena = memory_manager.getArenaAllocator();
// Get the widget pool allocator for widget instances
const widget_pool = memory_manager.getWidgetPoolAllocator();
```
ArenaAllocator
A fast allocator for temporary allocations with automatic cleanup:
```zig
var arena = try memory.ArenaAllocator.init(parent_allocator, size, is_thread_safe);
defer arena.deinit();
// Reset the arena to free all allocations
arena.reset();
```
PoolAllocator
An efficient allocator for widget instances with object reuse:
```zig
var pool = try memory.PoolAllocator.init(parent_allocator, node_size, initial_capacity);
defer pool.deinit();
// Get statistics about pool usage
const stats = pool.getStats();
```
Memory Safety
Built-in safety features to prevent common memory issues:
```zig
var safety = try memory.MemorySafety.init(allocator);
defer safety.deinit();
// Validate pointer access
if (safety.validatePointer(ptr, len)) {
// Safe to use the pointer
}
// Check for buffer overflows
try safety.checkAllocations();
```
Memory Debugging
Tools for tracking memory usage and detecting leaks:
```zig
var debugger = try memory.MemoryDebugger.init(allocator);
defer debugger.deinit();
// Track allocations
const ptr = try debugger.allocator().alloc(u8, 100);
defer debugger.allocator().free(ptr);
// Dump memory leaks
try debugger.dumpLeaks(std.io.getStdErr().writer());
```
Memory Optimization
Performance optimizations for memory-intensive operations:
```zig
var optimizer = try memory.MemoryOptimizer.init(allocator);
defer optimizer.deinit();
// Pre-allocate cache lines
optimizer.optimize(256);
// Get optimization statistics
const stats = optimizer.getStats();
```
Usage Example
```zig
const std = @import("std");
const zit = @import("zit");
const memory = zit.memory;
pub fn main() !void {
// Initialize memory manager
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>var memory_manager = try memory.MemoryManager.init(allocator, 1024 * 1024, 100);
defer memory_manager.deinit();
// Initialize terminal with memory manager
var term = try zit.terminal.init(memory_manager.getArenaAllocator());
defer term.deinit() catch {};
// Create widgets using the widget pool allocator
var button = try zit.widget.Button.init(memory_manager.getWidgetPoolAllocator(), "Click Me!");
defer button.deinit();
// ... rest of the application code
</code>
}
```
Best Practices
<ol>
<li>Use the <code>MemoryManager</code> as the primary interface for memory management</li>
<li>Use the arena allocator for temporary allocations that can be freed together</li>
<li>Use the widget pool allocator for widget instances</li>
<li>Enable memory safety checks in development builds</li>
<li>Use the memory debugger to track down leaks</li>
<li>Consider using the memory optimizer for performance-critical sections</li>
</ol>
Thread Safety
All memory management components are thread-safe by default. The <code>ArenaAllocator</code> can be configured for thread safety:
<code>zig
// Create a thread-safe arena
var arena = try memory.ArenaAllocator.init(allocator, size, true);</code>
Performance Considerations
<ul>
<li>The arena allocator is extremely fast for temporary allocations</li>
<li>The pool allocator reduces fragmentation for widget instances</li>
<li>The memory optimizer can significantly improve performance for repeated allocations</li>
<li>Memory safety checks have minimal overhead in release builds</li>
</ul>
Installation
Add Zit to your project:
```bash
Clone the repository
git clone https://github.com/oswalpalash/zit.git
Add as a dependency in your build.zig
```
In your <code>build.zig</code>:
```zig
const zit_dep = b.dependency("zit", .{
.target = target,
.optimize = optimize,
});
const zit_module = zit_dep.module("zit");
exe.addModule("zit", zit_module);
```
Quick Start
Here's a simple example to get you started:
```zig
const std = @import("std");
const zit = @import("zit");
pub fn main() !void {
// Initialize allocator
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>// Initialize terminal
var term = try zit.terminal.init(allocator);
defer term.deinit() catch {};
// Get terminal size
const width = term.width;
const height = term.height;
// Initialize renderer
var renderer = try zit.render.Renderer.init(allocator, width, height);
defer renderer.deinit();
// Enable raw mode
try term.enableRawMode();
defer term.disableRawMode() catch {};
// Initialize input handler
var input_handler = zit.input.InputHandler.init(allocator, &term);
try input_handler.enableMouse();
// Create a label
var label = try zit.widget.Label.init(allocator, "Hello, Zit!");
defer label.deinit();
label.setAlignment(.center);
label.setColor(
zit.render.Color{ .named_color = zit.render.NamedColor.bright_white },
zit.render.Color{ .named_color = zit.render.NamedColor.blue }
);
// Main event loop
var running = true;
while (running) {
// Clear the buffer
renderer.back.clear();
// Draw the label
const label_rect = zit.layout.Rect.init(
if (width > 20) (width - 20) / 2 else 0,
if (height > 1) height / 2 else 0,
20,
1
);
try label.widget.layout(label_rect);
try label.widget.draw(&renderer);
// Render to screen
try renderer.render();
// Poll for events with a 100ms timeout
const event = try input_handler.pollEvent(100);
if (event) |e| {
switch (e) {
.key => |key| {
// Exit on 'q' key
if (key.key == 'q' and !key.modifiers.ctrl and !key.modifiers.alt) {
running = false;
}
},
.resize => |resize| {
// Resize renderer
try renderer.resize(resize.width, resize.height);
},
else => {},
}
}
}
// Clean up
try term.clear();
try term.moveCursor(0, 0);
</code>
}
```
Core Components
Terminal Handling
The terminal module provides basic terminal operations:
```zig
// Initialize terminal
var term = try zit.terminal.init(allocator);
// Enable raw mode for direct input
try term.enableRawMode();
// Get terminal dimensions
const width = term.width;
const height = term.height;
// Move cursor and clear screen
try term.moveCursor(x, y);
try term.clear();
```
Input Handling
The input module processes keyboard and mouse events:
```zig
// Initialize input handler
var input_handler = zit.input.InputHandler.init(allocator, &term);
try input_handler.enableMouse();
// Poll for events with timeout
const event = try input_handler.pollEvent(100);
// Handle different event types
if (event) |e| {
switch (e) {
.key => |key| {
// Handle key press
if (key.key == 'q' and !key.modifiers.ctrl and !key.modifiers.alt) {
// Exit on 'q'
}
},
.mouse => |mouse| {
// Handle mouse event
},
.resize => |resize| {
// Handle terminal resize
},
else => {},
}
}
```
Rendering
The render module manages screen drawing:
```zig
// Initialize renderer
var renderer = try zit.render.Renderer.init(allocator, width, height);
// Clear the back buffer
renderer.back.clear();
// Draw text with color and style
renderer.drawStr(
x, y, "Hello, World!",
zit.render.Color{ .named_color = zit.render.NamedColor.bright_white },
zit.render.Color{ .named_color = zit.render.NamedColor.blue },
zit.render.Style.init(true, false, false) // bold
);
// Draw a box
renderer.drawBox(
x, y, width, height,
zit.render.BorderStyle.single,
zit.render.Color{ .named_color = zit.render.NamedColor.white },
zit.render.Color{ .named_color = zit.render.NamedColor.default },
zit.render.Style{}
);
// Render to screen
try renderer.render();
```
Widgets
The widget module provides basic UI components:
```zig
// Create a label
var label = try zit.widget.Label.init(allocator, "Hello, Zit!");
label.setAlignment(.center);
label.setColor(fg_color, bg_color);
// Create a button
var button = try zit.widget.Button.init(allocator, "Click Me!");
button.setColors(normal_fg, normal_bg, hover_fg, hover_bg);
button.setBorder(.rounded);
button.setOnPress(onButtonPress);
// Create a checkbox
var checkbox = try zit.widget.Checkbox.init(allocator, "Enable Feature");
checkbox.setColors(normal_fg, normal_bg, checked_fg, checked_bg);
checkbox.setOnChange(onCheckboxChange);
// Create a progress bar
var progress_bar = try zit.widget.ProgressBar.init(allocator);
progress_bar.setValue(30);
progress_bar.setShowPercentage(true);
progress_bar.setColors(fg, bg, empty_fg, empty_bg);
progress_bar.setBorder(.single);
// Create a list
var list = try zit.widget.List.init(allocator);
try list.addItem("Option 1");
try list.addItem("Option 2");
list.setSelectedIndex(0);
list.setOnSelect(onListSelect);
list.setColors(normal_fg, normal_bg, selected_fg, selected_bg);
list.setBorder(.single);
```
License
This project is licensed under the MIT License - see the <a>LICENSE</a> file for details. | [] |
https://avatars.githubusercontent.com/u/130914459?v=4 | gilfoyle | smercer10/gilfoyle | 2025-04-26T17:24:47Z | WIP UCI chess engine. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/smercer10/gilfoyle/tags | GPL-3.0 | [
"chess-engine",
"zig"
] | 25 | false | 2025-04-26T20:33:02Z | true | true | 0.15.0-dev.384+c06fecd46 | github | [] | Gilfoyle
Coming soon... | [] |
https://avatars.githubusercontent.com/u/1331451?v=4 | zoodle | helabenkhalfallah/zoodle | 2025-03-29T21:46:41Z | Zoodle is a compiler for a minimalist Toy Language written in Zig. It compiles source code into WebAssembly (WASM), with a focus on understanding low-level systems programming, memory management, concurrency, and compiler internals. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/helabenkhalfallah/zoodle/tags | MIT | [
"compiler",
"zig",
"zig-lang",
"ziglang"
] | 3 | false | 2025-03-29T21:55:26Z | false | false | unknown | github | [] | Zoodle
<strong>Zoodle</strong> is a compiler for a minimalist Toy Language written in <a>Zig</a>. It compiles source code into <a>WebAssembly (WASM)</a>, with a focus on understanding low-level systems programming, memory management, concurrency, and compiler internals.
This project is educational and hands-on โ not just a compiler, but a complete deep dive into modern systems programming with Zig.
๐ Project Goals
<ul>
<li>Build a real compiler from scratch using Zig</li>
<li>Learn memory allocation, concurrency, and binary encoding</li>
<li>Output real <code>.wasm</code> binaries that run in browsers and WASM runtimes</li>
</ul>
๐งฉ Toy Language Features
The Toy Language is intentionally small but expressive. It supports:
<ul>
<li><code>int</code>, <code>boolean</code>, and <code>string</code> types</li>
<li>Immutable variables using <code>let</code></li>
<li>Arithmetic and logical expressions</li>
<li>Functions with typed parameters and return values</li>
<li>Control flow: <code>if</code>, <code>while</code>, <code>return</code></li>
<li>Entry point: <code>fn main() -> int</code></li>
</ul>
Example program:
```tl
fn add(a: int, b: int) -> int {
return a + b;
}
fn main() -> int {
let result: int = add(3, 4);
return result;
}
```
๐ฆ Compiler Pipeline
Zoodle's compilation steps:
<ol>
<li><strong>Lexing</strong> โ Breaks source code into tokens</li>
<li><strong>Parsing</strong> โ Converts tokens to an Abstract Syntax Tree (AST)</li>
<li><strong>Semantic Analysis</strong> โ Validates types and scoping</li>
<li><strong>IR Generation</strong> โ Produces an intermediate representation</li>
<li><strong>WASM Codegen</strong> โ Converts IR into <code>.wasm</code> binary</li>
<li><strong>CLI / REPL</strong> โ Runs and interacts with the compiled code</li>
</ol>
๐ง Technologies
<ul>
<li><a>Zig</a> โ Systems programming language</li>
<li><a>WebAssembly (binary + WAT format)</a></li>
<li>Custom parser, memory allocators, and concurrency features</li>
</ul>
๐ Documentation
<ul>
<li><a>Evaluating C, C++, Rust, and Zig for Modern Low-Level Development (Design Philosophies)</a></li>
<li><a>Evaluating C, C++, Rust, and Zig for Modern Low-Level Development (Memory Management)</a></li>
<li><a>Evaluating C, C++, Rust, and Zig for Modern Low-Level Development (Concurrency Mechanisms)</a></li>
<li><a>Evaluating C, C++, Rust, and Zig for Modern Low-Level Development (Error Handling)</a></li>
<li><a>Evaluating C, C++, Rust, and Zig for Modern Low-Level Development (Developer Experience, Portability, Benchmarks and Adoption)</a></li>
</ul>
๐ค Contributing
This is a learning-focused project. Contributions, bug reports, and questions are welcome! Just open an issue or a pull request.
๐ License
MIT License. See <code>LICENSE</code> file for details. | [] |
https://avatars.githubusercontent.com/u/58077502?v=4 | zchp8 | GasInfinity/zchp8 | 2025-05-04T11:14:18Z | A CHIP-8, SCHIP-8 and XO-CHIP emulator with a raylib frontend. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/GasInfinity/zchp8/tags | MIT | [
"chip8",
"raylib",
"zig"
] | 713 | false | 2025-05-04T11:17:37Z | true | true | unknown | github | [
{
"commit": "a5639bb186f5c5644c1eee02f5954320637cfb02.tar.gz",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/a5639bb186f5c5644c1eee02f5954320637cfb02.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
}
] | ๐น๏ธ zchp8
<em>Example of zchp8 running <a>Nyancat</a>.</em>
A CHIP-8, SCHIP-8 and XO-CHIP emulator with (literally garbage) audio support. The frontend is managed by raylib. | [] |
https://avatars.githubusercontent.com/u/131185093?v=4 | ZiggyPongz | cjRem44x/ZiggyPongz | 2025-04-11T17:44:19Z | A classic Pong clone implemented in Zig using Raylib - demonstrating game development fundamentals and modern Zig programming practices. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/cjRem44x/ZiggyPongz/tags | - | [
"education",
"game-development",
"zig",
"zig-gamedev"
] | 18,466 | false | 2025-04-11T18:08:08Z | true | true | 0.15.0-dev.208+8acedfd5b | 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"
}
] | ZiggyPongz
A simple Pong clone written in Zig using the Raylib library. This project serves as an educational resource for learning game development concepts and the Zig programming language.
Educational Purpose
This project is created for educational purposes only to demonstrate:
- Basic game development concepts
- Zig programming language fundamentals
- Collision detection
- Simple game AI
- Real-time graphics rendering with Raylib
- Game loop implementation
- Structure and organization of a small game project
Game Features
<ul>
<li>Classic Pong gameplay mechanics</li>
<li>Player vs CPU gameplay</li>
<li>Score tracking</li>
<li>Smooth paddle movement</li>
<li>Ball physics with screen boundary detection</li>
<li>Simple AI opponent</li>
<li>Visual styling with custom colors</li>
</ul>
Controls
<ul>
<li>Up Arrow: Move player paddle up</li>
<li>Down Arrow: Move player paddle down</li>
<li>ESC: Exit game</li>
</ul>
Technical Details
<ul>
<li>Written in Zig programming language</li>
<li>Uses Raylib for graphics and input handling</li>
<li>Implements basic collision detection</li>
<li>Runs at 60 FPS</li>
<li>Resolution: 1200x800</li>
</ul>
Disclaimer
This is a learning project and is not intended for commercial use. All code is written for educational purposes to understand game development concepts and the Zig programming language.
Building and Running
Prerequisites
<ul>
<li><a>Zig</a> (0.11.0 or later)</li>
<li><a>Raylib</a> (4.5.0 or later)</li>
</ul>
Build Steps
<ol>
<li>
Clone the repository:
<code>bash
git clone https://github.com/yourusername/ZiggyPongz.git
cd ZiggyPongz</code>
</li>
<li>
Build the project:
<code>bash
zig build</code>
</li>
<li>
Run the game:
<code>bash
zig build run</code>
</li>
</ol>
Development
For development with hot reloading:
<code>bash
zig build run -- -watch</code>
Build Modes
<ul>
<li>Release build: <code>zig build -Doptimize=ReleaseFast</code></li>
<li>Debug build: <code>zig build -Doptimize=Debug</code></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/103554944?v=4 | AWA5.zig | TemariVirus/AWA5.zig | 2025-04-10T17:54:56Z | An AWA5.0 interpreter written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/TemariVirus/AWA5.zig/tags | Unlicense | [
"esolang",
"vtuber",
"zig"
] | 8 | false | 2025-04-13T03:56:29Z | true | true | 0.14.0 | github | [] | AWA5.zig
Zero dependency interpreter for the AWA5.0 language, written in Zig.
<a>Language spec</a>
Run
<code>sh
zig build run -- -h</code>
Using in your own project
<code>sh
zig fetch --save git+https://github.com/TemariVirus/AWA5.zig#GIT_COMMIT_HASH_OR_TAG</code>
Then in your <code>build.zig</code>:
<code>zig
const awa5 = b.dependency("AWA5_zig", .{
.target = target,
.optimize = optimize,
});
your_module.addImport("awa5", awa5.module("awa5"));</code> | [] |
https://avatars.githubusercontent.com/u/88557639?v=4 | zig-curl | lishaduck/zig-curl | 2025-04-13T20:34:31Z | https://github.com/mattnite/zig-libcurl rewritten | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/lishaduck/zig-curl/tags | NOASSERTION | [
"zig",
"zig-package"
] | 9 | false | 2025-04-13T20:37:21Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "curl",
"tar_url": "https://github.com/curl/curl/releases/download/curl-8_13_0/curl-8.13.0.tar.gz/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/curl/curl/releases/download/curl-8_13_0/curl-8.13.0.tar.gz"
},
{
"commit": "master",
"n... | cURL for Zig
cURL packaged for Zig.
Installation
<code>sh
zig fetch --save 'git+https://github.com/lishaduck/zig-curl#8.13.0'</code>
This will add a dependency entry to your <code>build.zig.zon</code>.
Then, to link cURL, add this to your <code>build.zig</code>:
<code>zig
const curl = b.dependency("curl", .{});
module.linkLibrary(curl.artifact("curl"));</code> | [] |
https://avatars.githubusercontent.com/u/116777388?v=4 | uinput-zig | Agent-E11/uinput-zig | 2025-05-03T04:42:06Z | A Zig implementation of the uinput.h examples located here: https://www.kernel.org/doc/html/v4.12/input/uinput.html | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Agent-E11/uinput-zig/tags | - | [
"c",
"uinput",
"zig"
] | 3 | false | 2025-05-03T04:44:23Z | true | true | 0.14.0 | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/5868779?v=4 | zgp | pierrekraemer/zgp | 2025-04-09T13:03:32Z | Zig Geometry Processing | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/pierrekraemer/zgp/tags | - | [
"geometry-processing",
"zig"
] | 80 | false | 2025-05-21T15:58:14Z | true | true | 0.14.0 | github | [
{
"commit": "d5f381759825ee0bac29bc294d47aa05be4ab7b5",
"name": "zigglgen",
"tar_url": "https://github.com/castholm/zigglgen/archive/d5f381759825ee0bac29bc294d47aa05be4ab7b5.tar.gz",
"type": "remote",
"url": "https://github.com/castholm/zigglgen"
},
{
"commit": "fce122b6b1e963285b3359f95... | zgp
Zig Geometry Processing | [] |
https://avatars.githubusercontent.com/u/77930083?v=4 | particle-simulation-2d | lucascompython/particle-simulation-2d | 2025-04-29T13:11:34Z | 2D Particle Simulation | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/lucascompython/particle-simulation-2d/tags | GPL-3.0 | [
"dawn",
"imgui",
"sdl",
"webgpu",
"wgpu",
"zig"
] | 102 | false | 2025-05-21T18:30:02Z | true | true | 0.15.0-dev.386+2e35fdd03 | github | [] | 2D Particle Simulation
This project is built with <a><code>Zig</code></a>, <a><code>SDL3</code></a>, <a><code>Dawn</code></a> / <a><code>Wgpu-Native</code></a> and <a><code>ImGui</code></a>.
This project is a rewrite of <a>this project</a> that used Raylib and performed all the calculations on the CPU.
I'm making this project with the goal of learning modern graphics programming and the differences between graphics library stacks.
A 3D version of this simulation that uses <a><code>Rust</code></a> + <a><code>Winit</code></a> + <a><code>Wgpu</code></a> + <a><code>Egui</code></a>, can be found <a>here</a>.
Demo
https://github.com/user-attachments/assets/5b5efdc1-bf9a-4533-bed4-976d08e197d7
Simulation Methods
The simulation can run on different methods, such as:
- CPU - Works everywhere but has limited performance
- GPU (Compute Shaders) - Only works on native and WebGPU (no WebGL support) but has much better performance
I wanted to add another GPU method, namely Transform Feedback since it is (I think) pretty the most performant method for this simulation that can run on WebGL, but I've found it difficult to implement in <code>wgpu</code>. Here is a <a>discussion</a> about it. Still looking into it!
Build Locally
This project has the following build dependencies:
- <strong>zig</strong> - for, well, the program itself
- <strong>python3</strong> - for <a><code>dear_bindings</code></a> and <a><code>fetching the dependencies of Dawn</code></a>
- <strong>git</strong> - for downloading the <a>submodules</a>
- <strong>rust</strong> - for compiling <code>wgpu-native</code>
- <strong>clang</strong> - for compiling <code>C</code>/<code>C++</code> code with <code>LTO</code> enabled and not conflict with the <code>Zig</code>/<code>Rust</code> compilers
- <strong>cmake</strong> - for compiling <code>SDL3</code> and <code>Dawn</code>
- <strong>ninja</strong> - for compiling <code>SDL3</code> and <code>Dawn</code>
- And development packages of multiple things like OpenGL, X11, Wayland, libc++, etc.
```bash
git clone https://github.com/lucascompython/particle-simulation-2d.git
cd particle-simulation-2d
zig build make-deps # Will fetch the submodules and build the dependencies (SDL3, ImGui, Dawn, Wgpu-Native)
zig build run
OR
zig build run -Doptimize=ReleaseFast # for release build
```
TODO:
<ul>
<li>Add Web support</li>
<li>Improve performance</li>
<li>Add mobile support</li>
<li>Make CI work nicely</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/565124?v=4 | ff-fp8x8 | peterhellberg/ff-fp8x8 | 2025-03-17T08:57:58Z | Firefly Zero version of w4-8x8-fill-patterns | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/peterhellberg/ff-fp8x8/tags | - | [
"firefly-zero",
"wasm",
"zig"
] | 21 | false | 2025-03-17T10:05:41Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "ff",
"tar_url": "https://github.com/peterhellberg/ff/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/peterhellberg/ff"
}
] | peter.fp8x8 :zap:
Using <a>Zig</a> to compile a ROM for use in <a>Firefly Zero</a>
Development
Build and run in the Firefly Zero emulator:
<code>sh
zig build run</code>
File watcher (<code>spy</code>) can be started by calling:
<code>sh
zig build spy</code> | [] |
https://avatars.githubusercontent.com/u/52933714?v=4 | zgbc | rmehri01/zgbc | 2025-02-11T08:07:09Z | ๐ฎ Game Boy emulator written in Zig and compiled to WASM. | main | 6 | 0 | 0 | 0 | https://api.github.com/repos/rmehri01/zgbc/tags | MIT | [
"gameboy-emulator",
"wasm",
"zig"
] | 666 | false | 2025-04-17T05:20:49Z | true | true | 0.14.0 | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/67539676?v=4 | coreutils | guuzaa/coreutils | 2025-04-08T11:19:28Z | A project to implement GNU coreutils in C++ and Zig. | main | 1 | 0 | 0 | 0 | https://api.github.com/repos/guuzaa/coreutils/tags | Apache-2.0 | [
"coreutils",
"cpp",
"cpp20",
"zig"
] | 22 | false | 2025-04-21T12:14:19Z | true | true | 0.14.0 | github | [
{
"commit": "1a71188d1816cc0741785d4694f790a1106a150a.tar.gz",
"name": "compile_commands",
"tar_url": "https://github.com/the-argus/zig-compile-commands/archive/1a71188d1816cc0741785d4694f790a1106a150a.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/the-argus/zig-compile-commands"
... | Coreutils Implementation
A project to implement GNU coreutils utilities in <code>C++</code> and <code>Zig</code>. This is an ongoing effort to recreate the essential Unix/Linux command-line tools.
Implemented Utilities
<ul>
<li><code>wc</code>: Word, line, and byte counting utility</li>
<li><code>true</code>: Do nothing, successfully (exit with status 0) </li>
<li><code>false</code>: Do nothing, unsuccessfully (exit with status 1) </li>
</ul>
Planned Utilities
The project aims to implement all core utilities, including but not limited to:
- File Management: <code>ls</code>, <code>cp</code>, <code>mv</code>, <code>rm</code>, <code>mkdir</code>, <code>cat</code>, etc.
- Text Processing: <code>head</code>, <code>tail</code>, <code>sort</code>, <code>uniq</code>, etc.
- System Information: <code>pwd</code>, <code>whoami</code>, <code>uname</code>, etc.
- And many more...
Installation
Prerequisites
<ul>
<li>Zig compiler (0.14 recommended)</li>
</ul>
Building from Source
Clone the repository and build using Zig's build system:
<code>bash
git clone https://github.com/guuzaa/coreutils.git
cd coreutils
zig build</code>
The executables will be available in <code>zig-out/bin/</code>.
Usage
wc Examples
Count lines, words, and characters in a file:
```bash
wc file.txt
```
Count only lines in multiple files:
```bash
wc -l file1.txt file2.txt
```
Count words from standard input:
```bash
cat file.txt | wc -w
```
Contributing
Contributions are welcome! Feel free to:
- Implement new utilities
- Improve existing implementations
- Report bugs
- Suggest enhancements
License
Licensed under Apache-2.0 license (<a>LICENSE</a> or http://opensource.org/licenses/Apache-2.0) | [] |
https://avatars.githubusercontent.com/u/14539473?v=4 | zig-generate-geodesics | alexbishop/zig-generate-geodesics | 2025-04-26T04:44:51Z | Compute the geodesic growth series for the Fabrykowski-Gupta group | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/alexbishop/zig-generate-geodesics/tags | MIT | [
"zig"
] | 21 | false | 2025-05-02T04:51:57Z | true | true | 0.14.0 | github | [] | Geodesic Growth Series: Fabrykowski-Gupta group
This repo contains some code to generate the geodesic growth series for the Fabrykowski-Gupta group.
The design of this code is based on the Unix philosophy. In paricular, the software in this repo is separated into five executables, plus a bash script to connect everything.
The code in this repo uses the usual generating set with the recursively defined generator <code>b = (a,1,b)</code>.
This code is relased under the MIT license.
Requirements
The code in this repo is written for a GNU/Linux based system.
In particular, this program has only been tested on Debian Trixie.
The code makes use of some common GNU coreutils such as <code>sort</code>, <code>gawk</code>, <code>tee</code>, <code>gzip</code>.
This program is written in Zig (v0.14.0), so you will need a copy of the Zig compiler.
How to compile and run
Compile the program by running:
<code>bash
zig build -Doptimize=ReleaseSafe</code>
<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>
You must use <code>ReleaseSafe</code> or <code>Debug</code> as its adds additional bounds checks on array accesses which the program does not explicitly check.
(This should not cause any issues, you sould have to be generating out to well over length 1000 before this becomes an issue: it is simply not realistic to be able to reach this situation.)
</blockquote>
After compiling, the programs should then be available under <code>./zig-out/bin</code>.
To start the code, run the program <code>run.sh</code>.
<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>
You should view and edit the contents of <code>run.sh</code> before running it.
This script contains some settings at the top:
<code>bash
COMPRESS="gzip"
GENERATE_NEXT="./prepend-generator-fg"
OUTDIR="$(pwd)/output"
SORT_TMPDIR="$OUTDIR/tmp"
SORT_BUFFER_SIZE=8G
SIZE=35</code>
There is a description of each such variable in the file <code>run.sh</code>
</blockquote>
Output Files
The output of this program is given as:
<ol>
<li>text files formatted as <code>length*.summary</code> which contain a basic summary of the level;</li>
<li>a summary to standard output which is just a concatination of the <code>length*.summary</code> files; and</li>
<li>compressed text files of the form <code>length*.data</code> contains the contents of the spheres.
These files are compressed using the <code>$COMPRESS</code> variable in <code>run.sh</code>.
The format of these files is described as follows.</li>
</ol>
Summary Format
The files <code>length*.summary</code> have the following format
```text
processing length [length-of-elements-in-sphere]
[timing information]
sphere size: [number-of-elements] ([number-of-geodesics])
file size: [compressed-file-size] / [uncompressed-file-size] ([compression-ratio])
```
For example:
```text
processing length 34
real 240m27.913s
user 279m34.721s
sys 18m11.892s
sphere size: 2,751,740,432 (5,043,285,984)
file size: 15,448,128,041 / 205,633,326,389 (7%)
```
Indicates that
<ul>
<li>there are 2,751,740,432 elements of length 34;</li>
<li>there are 5,043,285,984 elements of length 34;</li>
<li>the compressed file size of length34.data is 15,448,128,041 bytes;</li>
<li>the uncompressed file size of length34.data is 205,633,326,389 bytes; and</li>
<li>generating length34.data from the previous lengths took around 279 minutes = 4.65 hours.</li>
</ul>
Sphere Format
The uncompressed contexts of the files of the form <code>length*.data</code> contain one element per line.
Overview
Each line has the form:
```text
```
where
<ul>
<li><code>[portrait]</code> is an encoding of a minimal size portrait of an element;</li>
<li><code>[descend-set]</code> is an encoding of a subset of the generators which, if pre-composed with the element, will result in a shorter element; and</li>
<li><code>[count]</code> is a count, in base 10, of the number of geodesics give this element.</li>
</ul>
Example
Contents of <code>length3.data</code>:
<code>text
(<Ab(>A1B)):D:1
(<BA1):A:1
(<aB(<a1b)):H:1
(<ab(>a1b)):D:1
(<ba1):A:1
(=1BA):A:1
(=1ba):A:1
(=BA1):B:1
(=ba1):B:1
(>(<1BA)AB):H:1
(>(<1ba)aB):D:1
(>(>BA1)Ab):H:1
(>(>ba1)ab):D:1
(>1BA):B:1
(>1ba):B:1</code>
Some lines from <code>length35.data</code>:
<code>text
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1BA)(<a1b)(>(>ba1)ab))):H:2
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1BA)(<a1b)(>A1B))):H:4
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1BA)(<a1b)(>BA1))):H:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1ba)(>A1B)(<1BA))):H:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1ba)(>A1B)(<A1B))):H:6
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<1ba)(>A1B)(<ab(>a1b)))):H:4
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(<A1B)(<a1b)(>BA1))):A:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(>BA1)(<1BA)(<a1b))):L:2
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(>BA1)(<A1B)(<1ba))):H:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(>a1b)ab)):A:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=(>ba1)(>(<1ba)aB)b)):D:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=1(=BA1)A)):H:1
(<(<(<(<1BA)(<1BA)(<A1B))(=(<A1B)AB)(>ab(>a1b)))(=aB(<AB(<A1B)))(=a(=1ba)(>a1b))):H:2</code>
Format of portraits
Portraits can be defined recusively as follows
```text
the action of the generator a
[portait] ~> 'a'
the action of the generator a^{-1}
[portait] ~> 'A'
the action of the generator b
[portait] ~> 'b'
the action of the generator b^{-1}
[portait] ~> 'B'
we need to expand out the action using wreath recursion
Here
* [action] is how the subtrees are permuted
* the three sub-portraits are the actions on the subtrees
<a>portrait</a> ~> '(' <a>action</a> <a>portrait</a> ')'
do not permute the subtree
[action] ~> '='
do not permute the subtree as like the generator a
[action] ~> '>'
do not permute the subtree as like the generator a^{-1}
[action] ~> '<'
```
Format of the descend set
A descend set is a subset of the generating set <code>X = \{ a, a^{-1}, b, b^{-1} \}</code>.
We encode the desend set as a single ASCII character.
In particular, we encode it as
<code>text
0100 x4 x3 x2 x1</code>
where
<ul>
<li><code>x1</code> is <code>1</code> if and only if <code>a</code> is in the set;</li>
<li><code>x2</code> is <code>1</code> if and only if <code>a^{-1}</code> is in the set;</li>
<li><code>x3</code> is <code>1</code> if and only if <code>b</code> is in the set; and</li>
<li><code>x4</code> is <code>1</code> if and only if <code>b^{-1}</code> is in the set.</li>
</ul>
We choose this encoding as it corresponds to letters in ASCII.
For example, in ASCII, the letter <code>H</code> is encoded as <code>01001000</code> which would correspond to a descend set containing only <code>b^{-1}</code>.
Output of the program
Summary
| length | spherical growth | spherical geodesic growth |
| -- | -- | -- |
| 3 | 16 | 16 |
| 4 | 32 | 32 |
| 5 | 64 | 64 |
| 6 | 128 | 128 |
| 7 | 256 | 256 |
| 8 | 512 | 512 |
| 9 | 1,024 | 1,024 |
| 10 | 1,968 | 2,048 |
| 11 | 3,608 | 3,664 |
| 12 | 6,816 | 7,104 |
| 13 | 12,704 | 13,424 |
| 14 | 23,696 | 25,664 |
| 15 | 43,720 | 48,432 |
| 16 | 80,224 | 91,136 |
| 17 | 146,432 | 170,304 |
| 18 | 266,688 | 318,944 |
| 19 | 484,464 | 591,984 |
| 20 | 878,800 | 1,104,032 |
| 21 | 1,589,376 | 2,049,584 |
| 22 | 2,862,976 | 3,797,952 |
| 23 | 5,145,456 | 7,004,976 |
| 24 | 9,226,328 | 12,928,032 |
| 25 | 16,495,488 | 23,712,040 |
| 26 | 29,422,368 | 43,491,840 |
| 27 | 52,346,136 | 79,512,504 |
| 28 | 92,872,704 | 144,997,904 |
| 29 | 164,374,672 | 263,539,944 |
| 30 | 290,176,048 | 478,231,104 |
| 31 | 511,135,408 | 864,602,376 |
| 32 | 897,966,344 | 1,560,704,000 |
| 33 | 1,573,794,776 | 2,808,866,784 |
| 34 | 2,751,740,432 | 5,043,285,984 |
| 35 | 4,802,049,192 | 9,030,311,920 |
Ouptut content
<strong>NOTE:</strong> The output given in this section is for a slightly older version of the program. In particular, the file sizes will be different by around 1 byte. (The new version of the program ends the file with a <code>\n</code> character while the older version did not.)
Here is some example output of the program.
This code was run on a Lenovo ThinkPad E15 with 12th Gen Intel(R) Core(TM) i3-1215U CPU.
Note that I hibernated my computer partway through, so some of the timings are off (look at the <code>user</code> timing for more accurate information).
```text
processing length 3
real 0m0.008s
user 0m0.011s
sys 0m0.004s
sphere size: 16 (16)
file size: 114 / 215 (53%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 4
real 0m0.008s
user 0m0.012s
sys 0m0.006s
sphere size: 32 (32)
file size: 171 / 511 (33%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 5
real 0m0.006s
user 0m0.008s
sys 0m0.005s
sphere size: 64 (64)
file size: 340 / 1,223 (27%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 6
real 0m0.006s
user 0m0.009s
sys 0m0.005s
sphere size: 128 (128)
file size: 589 / 2,847 (20%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 7
real 0m0.006s
user 0m0.007s
sys 0m0.007s
sphere size: 256 (256)
file size: 1,145 / 6,175 (18%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 8
real 0m0.007s
user 0m0.013s
sys 0m0.004s
sphere size: 512 (512)
file size: 2,142 / 13,311 (16%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 9
real 0m0.007s
user 0m0.009s
sys 0m0.007s
sphere size: 1,024 (1,024)
file size: 4,207 / 28,183 (14%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 10
real 0m0.011s
user 0m0.012s
sys 0m0.010s
sphere size: 1,968 (2,048)
file size: 8,087 / 57,567 (14%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 11
real 0m0.015s
user 0m0.019s
sys 0m0.009s
sphere size: 3,608 (3,664)
file size: 14,909 / 113,887 (13%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 12
real 0m0.019s
user 0m0.029s
sys 0m0.004s
sphere size: 6,816 (7,104)
file size: 28,422 / 229,735 (12%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 13
real 0m0.030s
user 0m0.027s
sys 0m0.022s
sphere size: 12,704 (13,424)
file size: 53,646 / 457,183 (11%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 14
real 0m0.041s
user 0m0.055s
sys 0m0.009s
sphere size: 23,696 (25,664)
file size: 101,700 / 904,455 (11%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 15
real 0m0.070s
user 0m0.083s
sys 0m0.018s
sphere size: 43,720 (48,432)
file size: 191,719 / 1,760,999 (10%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 16
real 0m0.122s
user 0m0.153s
sys 0m0.021s
sphere size: 80,224 (91,136)
file size: 357,935 / 3,399,903 (10%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 17
real 0m0.201s
user 0m0.265s
sys 0m0.029s
sphere size: 146,432 (170,304)
file size: 664,415 / 6,504,671 (10%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 18
real 0m0.369s
user 0m0.501s
sys 0m0.062s
sphere size: 266,688 (318,944)
file size: 1,228,222 / 12,394,867 (9%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 19
real 0m0.671s
user 0m0.969s
sys 0m0.128s
sphere size: 484,464 (591,984)
file size: 2,260,638 / 23,476,403 (9%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 20
real 0m1.286s
user 0m2.011s
sys 0m0.131s
sphere size: 878,800 (1,104,032)
file size: 4,144,199 / 44,299,419 (9%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 21
real 0m2.276s
user 0m3.477s
sys 0m0.360s
sphere size: 1,589,376 (2,049,584)
file size: 7,604,821 / 83,100,139 (9%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 22
real 0m4.157s
user 0m6.590s
sys 0m0.667s
sphere size: 2,862,976 (3,797,952)
file size: 13,865,516 / 155,047,399 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 23
real 0m7.573s
user 0m12.260s
sys 0m1.110s
sphere size: 5,145,456 (7,004,976)
file size: 25,308,064 / 288,058,559 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 24
real 0m13.857s
user 0m22.880s
sys 0m1.989s
sphere size: 9,226,328 (12,928,032)
file size: 45,948,382 / 533,062,639 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 25
real 0m25.472s
user 0m42.380s
sys 0m3.761s
sphere size: 16,495,488 (23,712,040)
file size: 83,313,572 / 982,381,315 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 26
real 1m29.910s
user 2m1.034s
sys 0m9.608s
sphere size: 29,422,368 (43,491,840)
file size: 150,437,518 / 1,803,608,215 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 27
real 2m41.481s
user 3m38.582s
sys 0m15.938s
sphere size: 52,346,136 (79,512,504)
file size: 271,562,082 / 3,299,144,847 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 28
real 4m49.052s
user 6m34.905s
sys 0m26.641s
sphere size: 92,872,704 (144,997,904)
file size: 487,444,555 / 6,011,161,683 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 29
real 8m44.622s
user 12m29.071s
sys 0m51.535s
sphere size: 164,374,672 (263,539,944)
file size: 874,053,652 / 10,917,112,943 (8%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 30
real 15m37.733s
user 22m20.214s
sys 1m32.771s
sphere size: 290,176,048 (478,231,104)
file size: 1,560,402,512 / 19,757,181,219 (7%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 31
real 79m37.222s
user 85m5.353s
sys 4m16.917s
sphere size: 511,135,408 (864,602,376)
file size: 2,781,590,004 / 35,655,330,151 (7%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 32
real 210m17.224s
user 146m14.148s
sys 8m6.128s
sphere size: 897,966,344 (1,560,704,000)
file size: 4,937,352,481 / 64,125,095,363 (7%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 33
real 278m23.807s
user 186m31.923s
sys 11m17.029s
sphere size: 1,573,794,776 (2,808,866,784)
file size: 8,749,389,142 / 115,003,901,189 (7%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 34
real 240m27.913s
user 279m34.721s
sys 18m11.892s
sphere size: 2,751,740,432 (5,043,285,984)
file size: 15,448,128,041 / 205,633,326,389 (7%)
~~~~~~~~~~~~~~~~~~~~~~~~~~
processing length 35
real 636m15.186s
user 672m44.035s
sys 41m58.897s
sphere size: 4,802,049,192 (9,030,311,920)
file size: 27,230,594,230 / 366,833,616,923 (7%)
``` | [] |
https://avatars.githubusercontent.com/u/17596952?v=4 | agez | andrewkreuzer/agez | 2025-02-10T20:14:12Z | age encryption for zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/andrewkreuzer/agez/tags | MIT | [
"age-encryption",
"zig"
] | 1,165 | false | 2025-05-14T20:49:18Z | true | true | 0.11.0 | github | [] | agez | [] |
https://avatars.githubusercontent.com/u/59342135?v=4 | ziglings-solutions | FumingPower3925/ziglings-solutions | 2025-02-16T11:18:55Z | My solutions for the popular ziglings tiny broken problems. Original Repo: | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/FumingPower3925/ziglings-solutions/tags | MIT | [
"low-level-programming",
"system-programming",
"zig",
"ziglang"
] | 37 | false | 2025-02-24T16:52:08Z | false | false | unknown | github | [] | Ziglings Solutions
Description
This set of little exercises are one of the best ways to learn the Zig programming language. And as my current goal is to learn the Zig programming language I started solving them and uploading my solutions here.
Checklist
<ul>
<li>[X] <a>001_hello</a></li>
<li>[X] <a>002_std</a></li>
<li>[X] <a>003_assignment</a></li>
<li>[X] <a>004_arrays</a></li>
<li>[X] <a>005_arrays2</a></li>
<li>[X] <a>006_strings</a></li>
<li>[X] <a>007_strings2</a></li>
<li>[X] <a>008_quiz</a></li>
<li>[X] <a>009_if</a></li>
<li>[X] <a>010_if2</a></li>
<li>[X] <a>011_while</a></li>
<li>[X] <a>012_while2</a></li>
<li>[X] <a>013_while3</a></li>
<li>[X] <a>014_while4</a></li>
<li>[X] <a>015_for</a></li>
<li>[X] <a>016_for2</a></li>
<li>[X] <a>017_quiz2</a></li>
<li>[X] <a>018_functions</a></li>
<li>[X] <a>019_functions2</a></li>
<li>[X] <a>020_quiz3</a></li>
<li>[X] <a>021_errors</a></li>
<li>[X] <a>022_errors2</a></li>
<li>[X] <a>023_errors3</a></li>
<li>[X] <a>024_errors4</a></li>
<li>[X] <a>025_errors5</a></li>
<li>[X] <a>026_hello2</a></li>
<li>[X] <a>027_defer</a></li>
<li>[X] <a>028_defer2</a></li>
<li>[X] <a>029_errdefer</a></li>
<li>[X] <a>030_switch</a></li>
<li>[X] <a>031_switch2</a></li>
<li>[X] <a>032_unreachable</a></li>
<li>[X] <a>033_iferror</a></li>
<li>[X] <a>034_quiz4</a></li>
<li>[X] <a>035_enums</a></li>
<li>[X] <a>036_enums2</a></li>
<li>[X] <a>037_structs</a></li>
<li>[X] <a>038_structs2</a></li>
<li>[X] <a>039_pointers</a></li>
<li>[X] <a>040_pointers2</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> 041_pointers3
<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> 042_pointers4
<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> 043_pointers5
<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> 044_quiz5
<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> 045_optionals
<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> 046_optionals2
<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> 047_methods
<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> 048_methods2
<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> 049_quiz6
<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> 050_no_value
<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> 051_values
<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> 052_slices
<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> 053_slices2
<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> 054_manypointers
<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> 055_unions
<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> 056_unions2
<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> 057_unions3
<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> 058_quiz7
<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> 059_integers
<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> 060_floats
<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> 061_coercions
<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> 062_loop_expressions
<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> 063_labels
<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> 064_builtins
<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> 065_builtins2
<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> 066_comptime
<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> 067_comptime2
<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> 068_comptime3
<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> 069_comptime4
<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> 070_comptime5
<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> 071_comptime6
<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> 072_comptime7
<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> 073_comptime8
<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> 074_comptime9
<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> 075_quiz8
<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> 076_sentinels
<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> 077_sentinels2
<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> 078_sentinels3
<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> 079_quoted_identifiers
<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> 080_anonymous_structs
<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> 081_anonymous_structs2
<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> 082_anonymous_structs3
<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> 083_anonymous_lists
<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> 084_async
<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> 085_async2
<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> 086_async3
<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> 087_async4
<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> 088_async5
<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> 089_async6
<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> 090_async7
<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> 091_async8
<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> 092_interfaces
<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> 093_hello_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> 094_c_math
<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> 095_for3
<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> 096_memory_allocation
<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> 097_bit_manipulation
<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> 098_bit_manipulation2
<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> 099_formatting
<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> 100_for4
<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> 101_for5
<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> 102_testing
<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> 103_tokenization
<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> 104_threading
<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> 105_threading2
<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> 106_files
<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> 107_files2
<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> 108_labeled_switch
<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> 109_vectors
<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> 110_quiz9
<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> 999_the_end</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/20770505?v=4 | delti | Jafagervik/delti | 2025-03-28T06:26:12Z | Delti prog language | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Jafagervik/delti/tags | - | [
"hobby-project",
"programming-language",
"zig",
"zig-package"
] | 15 | false | 2025-04-01T23:27:14Z | true | true | 0.14.0 | github | [] | Delti - like jai and odin, but for me
Datatypes
usize, isize
u8, u16, u32, u64, u128
i8, i16, i32, i64, i128
f8, f16, f32, f64, f128
str = []u8
Project Layout
<code>src
-- compy.zig # compiler
-- lexer.zig # lexer
-- compy.zig # compiler
-- compy.zig # compiler
-- compy.zig # compiler
-- compy.zig # compiler</code> | [] |
https://avatars.githubusercontent.com/u/110578011?v=4 | krpg | CodeOnARaft/krpg | 2025-02-12T02:41:18Z | 2.5D Old School RPG | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/CodeOnARaft/krpg/tags | MIT | [
"gamedev",
"gamedevelopment",
"learning-zig",
"raylib",
"zig"
] | 52,751 | false | 2025-05-14T02:04:56Z | false | false | unknown | github | [] | krpg
Overview
krpg is a simple old school rpg, imagined in the vein of Daggerfall.
Very early development.
The main purpose of this project is to teach myself zig. Because of this, do not expect great zig code.
Building
Project currently uses zig v0.14
The game project is in the <a>game</a> folder, do a <strong>zig build run</strong> there.
The editor project is in the <a>editor</a> folder, do a <strong>zig build run</strong> there.
Game Controls
|Control| Function|
|--|--|
|WASD|Walking|
|Mouse|Look|
| e| interact|
| i| inventory|
|~|Console|
|F5|Turn on/off Debug|
|F10| Quit/Exit |
Console comands
|Control| Function|
|--|--|
|LOCATION X Y| WARP to X,Y position|
Credits
See <a>credits file</a>
Game Library
<a>raylib</a> | [] |
https://avatars.githubusercontent.com/u/4605603?v=4 | zidl | tiehuis/zidl | 2025-05-16T06:59:18Z | MIDL compiler in Zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/tiehuis/zidl/tags | MIT | [
"zig"
] | 118 | false | 2025-05-19T07:27:23Z | true | true | 0.15.0-dev.355+206bd1ced | github | [
{
"commit": "f954ddd40b43ec6fd4d349a13ba7ceff3c4e1055",
"name": "aro",
"tar_url": "https://github.com/Vexu/arocc/archive/f954ddd40b43ec6fd4d349a13ba7ceff3c4e1055.tar.gz",
"type": "remote",
"url": "https://github.com/Vexu/arocc"
}
] | zidl
An IDL Compiler written in Zig.
This is intended as an alternative to more mature projects such as WIDL, for use directly in
the zig compiler.
Compatibility
The goal of this compiler is to have output parity with WIDL for the mingw-64 header files. Anything
more is not intended to be supported at this stage.
Usage
<code>zig build
./zig-out/bin/zidl --help</code>
```
Usage ./zig-out/bin/zidl: [options] file..
General options:
-h, --help Print this message.
-v, --version Print zidl version.
Compile options:
--winrt Use midl3.0 (default midl2.0)
--skip-imports Don't parse imported files
--stacktrace Render a stacktrace on parse error
--log-level debug|info|warn|err Print all log messages less than requested level
-D= Define a macro for the C preprocessor
Debug options:
--tokens Print a list of tokens produced by the tokenizer
--codegen Perform codegen step (default: true)
--show-failed-optional-parses Render all parsing failures for optional rules
```
License
MIT Licensed.
This is a clean-room implementation. The PEG grammar has created with help from
WIDL BNF grammar as a reference. | [] |
https://avatars.githubusercontent.com/u/24943868?v=4 | dsa | jethrodaniel/dsa | 2025-02-15T20:54:52Z | Data structures and algorithms practice (in Ruby and Zig) | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/jethrodaniel/dsa/tags | - | [
"ruby",
"zig"
] | 95 | false | 2025-03-03T05:26:31Z | false | false | unknown | github | [] | dsa
Data structures and algorithms practice. | [] |
https://avatars.githubusercontent.com/u/71237005?v=4 | zig_sandbox | permalik/zig_sandbox | 2025-03-11T00:11:17Z | sandbox:Zig Programming and Turnkey Ecosystem | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/permalik/zig_sandbox/tags | - | [
"dsa",
"nix",
"systems",
"zig"
] | 19 | false | 2025-04-10T18:11:35Z | true | false | unknown | github | [] | zig_sandbox
sandbox:Zig Programming and Turnkey Ecosystem
<a>Environment</a>
- <a>Configuration</a>
- <a>Development</a>
- <a>CI</a>
- <a>Production</a>
- <a>Nuke</a>
<a>Curricula</a>
- <a>Fundamental</a>
- <a>Construct</a>
- <a>DataStructure</a>
- <a>Algorithm</a>
Environment
Development
Getting Started
Clone the repo
<code>sh
git clone git@github.com:permalik/zig_sandbox.git</code>
<a>Install Nix</a>
Enter Nix shell
<code>sh
nix develop</code>
Tooling
Format and Lint
Nix Format
<code>sh
alejandra <target></code>
Pre-Commit
Various Pre-Commit hooks.
Initialize
```sh
Make script executable
sudo chmod +x precommit.sh
Execute script
sudo ./precommit.sh
```
Testing
Configuration
Shell
The root <code>.bashrc</code> will be sourced within the shell.
If changes are needed, update <code>.bashrc</code> and restart the shell with <code>nix develop</code>
CI
GitHub Actions on Push and Pull Request using Ubuntu x86_64-Linux Self-Hosted Runner
Production
```sh
Restart Docker
orb restart docker
Create image
docker-build-dev
Build ephemeral container
docker-run-dev
Destroy image
docker rmi zig_sandbox:dev
```
Nuke
Follow instructions to purge curricula and launch a somewhat opinionated turnkey ecosystem.
Initialize purge
```sh
Make script executable
sudo chmod +x nuke.sh
Execute script
sudo ./nuke.sh
```
Update project/repository naming in various places and update the README:
- <code>./.bashrc</code>
- <code>Dockerfile</code>
- <code>README.md</code>
- <code>flake.nix</code>
Nuking the environment will only recreate an executable-producing build.
If a library or combination combination of the two is required, that will need to be created manually.
Curricula
Fundamental
Construct
DataStructure
Algorithm | [] |
https://avatars.githubusercontent.com/u/96265823?v=4 | zig-tokenizer | ifonso/zig-tokenizer | 2025-04-27T04:48:53Z | just messing with tokenizers for the sake of learning | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ifonso/zig-tokenizer/tags | MIT | [
"llm",
"tokenizer",
"zig"
] | 5 | false | 2025-04-27T04:57:48Z | true | true | 0.14.0 | github | [] | Zig Tokenizer
Um projeto de teste para criaรงรฃo de um tokenizer para LLMs, atualmente implementa dois modos: quebra conservadora, e quebra agressiva.
<ul>
<li><strong>Conservative</strong>: preserva palavras compostas (e.g., "co-working", "Let's") e separa apenas em pontuaรงรตes pesadas e espaรงos.</li>
<li><strong>Aggressive</strong>: separa sรญmbolos intermediรกrios como hรญfens, apรณstrofes e barras, para gerar tokens mais fragmentados, ideal para prรฉ-processamento de LLMs.</li>
</ul>
<blockquote>
Nรฃo รฉ uma lib. (atรฉ o momento)
</blockquote>
Como usar
Inicialize o tokenizer informando as opรงรตes desejadas:
```zig
const Tokenizer = @import("tokenizer.zig").Tokenizer;
const tokenizer = Tokenizer.init(true, .Agressive);
const input = "Olรก, Mundo!";
const tokens = try tokenizer.tokenize(allocator, input);
```
Status
<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> Tokenizaรงรฃo de palavras, pontuaรงรฃo e sรญmbolos intermediรกrios.
<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> Suporte a modos Conservative e Aggressive.
<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> Offsets para reconstruรงรฃo reversรญvel.
<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> Lowercasing opcional.
<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> BPE (Byte-Pair Encoding) apรณs tokenizaรงรฃo.
<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> Suporte completo a Unicode (caracteres acentuados, scripts orientais, etc).
<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> Tratamento especial para emojis e sรญmbolos complexos. | [] |
https://avatars.githubusercontent.com/u/29165327?v=4 | pqc-zig | OnlyF0uR/pqc-zig | 2025-04-30T08:38:33Z | Post-Quantum Cryptography for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/OnlyF0uR/pqc-zig/tags | Apache-2.0 | [
"cryptography",
"post-quantum-cryptography",
"pqc",
"pqcrypto",
"zig",
"zig-library",
"zig-package"
] | 40 | false | 2025-05-01T14:20:14Z | false | false | unknown | github | [] | pqc-zig
Zig bindings to the <a>PQClean</a> C implementations of cryptographic algorithms proposed during the <a>NIST Post-Quantum Cryptography Competition</a>. Additionally, there are light abstractions for convenient use present in the crypto.zig files.
Requirements
<ul>
<li>Make</li>
<li>GCC</li>
<li>Zig 0.15+</li>
</ul>
Supported schemes (KEM, and signature)
<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> hqc-128 (Clean)
<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> hqc-192 (Clean)
<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> hqc-256 (Clean)
<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> ml-kem-1024 (Clean, AVX2, AARCH64)
<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> ml-kem-512 (Clean, AVX2, AARCH64)
<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> ml-kem-768 (Clean, AVX2, AARCH64)
<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> falcon-1024 (Clean, AVX2, AARCH64)
<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> falcon-512 (Clean, AVX2, AARCH64)
<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> falcon-padded-1024 (Clean, AVX2, AARCH64)
<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> falcon-padded-512 (Clean, AVX2, AARCH64)
<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> ml-dsa-44 (Clean, AVX2, AARCH64)
<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> ml-dsa-65 (Clean, AVX2, AARCH64)
<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> ml-dsa-87 (Clean, AVX2, AARCH64)
<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> sphincs-sha2-128s-simple (Clean, AVX2)
<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> sphincs-sha2-192f-simple (Clean, AVX2)
<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> sphincs-sha2-192s-simple (Clean, AVX2)
<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> sphincs-sha2-256f-simple (Clean, AVX2)
<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> sphincs-sha2-256s-simple (Clean, AVX2)
<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> sphincs-shake-128f-simple (Clean, AVX2, AARCH64)
<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> sphincs-shake-128s-simple (Clean, AVX2, AARCH64)
<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> sphincs-shake-192f-simple (Clean, AVX2, AARCH64)
<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> sphincs-shake-192s-simple (Clean, AVX2, AARCH64)
<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> sphincs-shake-256f-simple (Clean, AVX2, AARCH64)
<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> sphincs-shake-256s-simple (Clean, AVX2, AARCH64)
Tests
While more rigorous testing is to be implemented, you can run tests by navigating to the desired module and using:
<code>bash
zig build test</code> | [] |
https://avatars.githubusercontent.com/u/22438427?v=4 | zvips | bernardassan/zvips | 2025-04-05T13:03:18Z | A blazingly fast image processing library in Zig using libvips | main | 4 | 0 | 0 | 0 | https://api.github.com/repos/bernardassan/zvips/tags | MIT | [
"bindings",
"gir",
"gobject",
"libvips",
"zig",
"zig-package"
] | 1,994 | false | 2025-05-15T12:00:12Z | true | true | 0.15.0-dev.208+8acedfd5b | github | [
{
"commit": "9500e7f21eb6858f78ea5eda26c90b0cc2ccdbbd.tar.gz",
"name": "gobject",
"tar_url": "https://github.com/ianprime0509/zig-gobject/archive/9500e7f21eb6858f78ea5eda26c90b0cc2ccdbbd.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/ianprime0509/zig-gobject"
},
{
"commit":... | Zivips
Libvips bindings for Zig using GObject Introspection
System Dependencies
Arch Linux
Runtime dependencies
<code>elvish
sudo pacman -S libvips libheif glib2</code>
Build time dependencies
<code>elvish
sudo pacman -S libxslt</code> | [] |
https://avatars.githubusercontent.com/u/76426234?v=4 | simpleble | RoadRoller01/simpleble | 2025-04-22T19:10:09Z | Simpleble packaged for Zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/RoadRoller01/simpleble/tags | MIT | [
"zig",
"zig-package"
] | 444 | false | 2025-05-17T16:45:43Z | true | true | 0.14.0 | github | [
{
"commit": "72f037c03fc78dc615628959fafce03000086777",
"name": "fmt",
"tar_url": "https://github.com/allyourcodebase/fmt-zig/archive/72f037c03fc78dc615628959fafce03000086777.tar.gz",
"type": "remote",
"url": "https://github.com/allyourcodebase/fmt-zig"
}
] | Note: Until someone wrap dbus in build.zig...
You must install dbus on your system before using.
Simpleble
Simpleble with build.zig | [] |
https://avatars.githubusercontent.com/u/206474604?v=4 | rapto | raptodb/rapto | 2025-04-25T16:13:04Z | ๐ A next-gen database with CAS model and SIMD operations | unstable | 0 | 1 | 0 | 1 | https://api.github.com/repos/raptodb/rapto/tags | BSD-3-Clause | [
"cache",
"cas",
"database",
"high-performance",
"key-value",
"simd",
"zig"
] | 12 | false | 2025-04-26T09:24:41Z | false | false | unknown | github | [] |
<strong>Rapto</strong> is a next-gen database with CAS model and SIMD operations.
Overview
The project is work in progress.
CAS
<strong>CAS</strong> (<strong>Cache As Storage</strong>) is a system in which storage is utilized and managed as a cache. Rather than maintaining two separate layers, CAS merges storage and caching into a single, unified layer.
The cache is organized through a priority-based sorting mechanism, supported by intelligent swapping strategies, to accelerate linear search while minimizing computational costs. | [] |
https://avatars.githubusercontent.com/u/152291607?v=4 | tatamios | kouosi/tatamios | 2025-03-29T17:25:09Z | A hobby osdev effort from scratch in zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/kouosi/tatamios/tags | ISC | [
"osdev",
"x86-64",
"zig"
] | 223 | false | 2025-05-11T22:33:20Z | true | false | unknown | github | [] | TatamiOS
Yet another hobby operating system maybe?
Building
You only need <a>zig master</a> to build.
<code>sh
zig build</code>
Running
To run you need <a>qemu</a>.
<code>sh
zig build run</code> | [] |
https://avatars.githubusercontent.com/u/110308379?v=4 | game-engine | nukkeldev/game-engine | 2025-05-07T01:17:58Z | A generically-named game engine written in Zig | main | 1 | 1 | 0 | 1 | https://api.github.com/repos/nukkeldev/game-engine/tags | - | [
"game-engine",
"sokol",
"zig"
] | 58 | false | 2025-05-13T09:43:19Z | true | true | 0.14.0 | github | [
{
"commit": "01bde5a6cf5d934948a1c6e60483e4ab75524891",
"name": "sokol",
"tar_url": "https://github.com/floooh/sokol-zig/archive/01bde5a6cf5d934948a1c6e60483e4ab75524891.tar.gz",
"type": "remote",
"url": "https://github.com/floooh/sokol-zig"
},
{
"commit": "716dae9c6a03eec642a4fb2ac28ebc... | Garden Engine
A multimedia engine with a focus on atmosphere and performance.
Allows the creation of both developer and user-interactable environments (gardens)
that may use the various systems provided. | [] |
https://avatars.githubusercontent.com/u/138317632?v=4 | color-picker-tui | BasileBux/color-picker-tui | 2025-02-13T10:32:39Z | A terminal color picker | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/BasileBux/color-picker-tui/tags | - | [
"terminal",
"tui",
"tui-zig",
"zig"
] | 4,638 | false | 2025-04-19T10:19:43Z | true | true | 0.11.0 | github | [] | Terminal color picker
This is a terminal based color picker. It is a little tool to help you choose
pick colors and translate them from / to different formats. It is linux only but
a macos version could happen as it really similar to linux. It is highly
inspired by <a>this website</a>.
<a>https://github.com/user-attachments/assets/063aa337-312d-4ef6-986d-950d8a76b35e</a>
The TUI draws a big square for color selection. This square could not appear
completely square depending on your font. For better looking squares, I
recommend using a font which has a 1:2 ratio such as
<a>FiraCode</a>.
It is mainly a way to learn Zig and do a nice TUI. I don't use any
libraries or external dependencies so all you need to compile it is Zig.
Installation
I don't do packaging or releases. If you want to use it, you will need to build
it from source.
You need to have <code>zig</code> installed on your system. Then clone this repo, <code>cd</code> into
it and run <code>zig build</code> which will compile the program. You can find the output
in <code>./zig-out/bin/color-picker-tui</code>. Then move it to your path or use it as you
wish.
Usage
Just drag your mouse over the gradients to select a color. You can also give the
colors in the input fields on the right. To validate the input, just press <code>enter</code>.
You can also paste in the input fields with <code>Ctrl + Shift + V</code> or <code>p</code>. To copy the
color, click on the relevant format at the top.
To quit the program, you can do <code>Ctrl + C</code>, <code>escape</code> or <code>q</code>.
<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>
The clipboard features only work in Wayland. X11 sucks and I don't
want to support it.
</blockquote>
Note
This is a project I did to learn and explore many things at once. The codebase
is really messy and for some parts a disaster. I most likely won't fix it as
it is not the purpose. If you are interested, the things I explored are:
- Terminal UI
- Zig general concepts
- Zig comptime (really powerful)
- Buffers
- OOP composition (I now know that I don't like OOP)
I tried to make as little heap allocations as possible which isn't always the best
solution. But the allocators concept in Zig is really strong and I should probably
explore it more. I also don't use any other dependencies than zig's standard library. | [] |
https://avatars.githubusercontent.com/u/146390816?v=4 | zfp | allyourcodebase/zfp | 2025-04-19T03:55:30Z | A Zig build wrapper for the ZFP C compression library | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/allyourcodebase/zfp/tags | BSD-3-Clause | [
"compression",
"compressor",
"zfp",
"zig",
"zig-library",
"ziglang"
] | 12 | false | 2025-05-09T15:13:53Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "zfp",
"tar_url": "https://github.com/LLNL/zfp/releases/download/1.0.1/zfp-1.0.1.tar.gz/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/LLNL/zfp/releases/download/1.0.1/zfp-1.0.1.tar.gz"
}
] | <a></a>
zfp-zig: zfp packaged for the Zig programming language
This is the <a>ZFP C compression library</a> for the <a>Zig</a> programming language. Currently does not wrap the C++ compressed array classes.
How do I include it in my Zig program?
If you are starting a new package:
```bash
mkdir my_project; cd my_project
zig init
add the package to 'build.zig.zon'
zig fetch --save=zfp git+https://github.com/allyourcodebase/zfp.git
<code>This will add the zig C library as a dependency to your project.
Next, if you are linking it to a library or executable, add the following to **build.zig**:</code>Zig
pub fn build(b: *std.Build) !void {
const target = b.standardTargetOptions(.{});
<code>const optimize = b.standardOptimizeOption(.{});
const zfp_dep = b.dependency("zfp", .{
.target = target,
.optimize = optimize,
});
// if you are linking it to a library...
const lib_mod = b.createModule(.{
.root_source_file = b.path("src/root.zig"),
.target = target,
.optimize = optimize,
});
lib_mod.linkLibrary(zfp_dep.artifact("zfp"));
// or, if you are linking it to an executable...
const exe_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe_mod.linkLibrary(zfp_dep.artifact("zfp"));
</code>
}
```
Requirements
The target version of Zig is <code>0.14</code>. It may work with earlier versions, but has not been tested. | [
"https://github.com/allyourcodebase/zfp"
] |
https://avatars.githubusercontent.com/u/36035180?v=4 | lc3-zig | Azkel1/lc3-zig | 2025-05-07T19:16:46Z | A LC3 emulator in Zig based on the guide of Justin Meiners and Ryan Pendleton | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Azkel1/lc3-zig/tags | - | [
"lc3",
"zig",
"ziglang"
] | 6 | false | 2025-05-07T19:26:41Z | true | true | 0.14.0 | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/14991225?v=4 | cargo-zigbuild-action | hominsu/cargo-zigbuild-action | 2025-02-23T15:06:55Z | Github Action to build Cargo project with cargo-zigbuild | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/hominsu/cargo-zigbuild-action/tags | GPL-3.0 | [
"actions",
"build",
"build-tools",
"cargo",
"rust",
"zig"
] | 2,614 | false | 2025-03-05T05:02:48Z | false | false | unknown | github | [] | About
Github Action to build Cargo project with
<a>cargo-zigbuild</a>
<ul>
<li><a>About</a></li>
<li><a>Usage</a></li>
<li><a>Customizing</a></li>
<li><a>inputs</a></li>
</ul>
Usage
```yaml
name: ci
on:
push:
tags: ['v*']
jobs:
build:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
<code>steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
uses: hominsu/cargo-zigbuild-action@v1
with:
name: jproxy
args: |
target=x86_64-unknown-linux-musl,release,features=mimalloc
target=aarch64-unknown-linux-musl,release,features=mimalloc
target=armv7-unknown-linux-musleabihf,release,features=jemalloc
target=arm-unknown-linux-musleabihf,release,features=jemalloc
target=i686-unknown-linux-musl,release,features=jemalloc
target=x86_64-apple-darwin,release
target=aarch64-apple-darwin,release
target=x86_64-pc-windows-gnu,release
target=i686-pc-windows-gnu,release
</code>
```
Customizing
inputs
The following inputs can be used as <code>step.with</code> keys
<blockquote>
<code>List</code> type is a newline-delimited string
<code>yaml
set: target.args.mybuildarg=value</code>
<code>yaml
set: |
target.args.mybuildarg=value
foo*.args.mybuildarg=value</code>
<code>CSV</code> type is a comma-delimited string
<code>yaml
targets: default,release</code>
</blockquote>
| Name | Type | Description |
| -------------- | -------- | ------------------------------------------------------------------------- |
| <code>workdir</code> | String | Working directory of cargo/cargo-zigbuild execution |
| <code>outdir</code> | String | Output directory for the build artifacts |
| <code>name</code> | String | Name of binary to compile |
| <code>args</code> | List/CSV | Arguments to pass to cargo/cargo-zigbuild |
| <code>github-token</code> | String | API token used to authenticate to a Git repository for remote definitions | | [] |
https://avatars.githubusercontent.com/u/998922?v=4 | zun | dbushell/zun | 2025-04-17T08:00:38Z | โก Zig daemon and CLI to turn on my dumb lights | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/dbushell/zun/tags | MIT | [
"zig",
"ziglang"
] | 50 | false | 2025-04-25T00:24:56Z | true | true | 0.14.0 | github | [] | โก ZUN
<blockquote>
<em>Fiat lux</em> โ๏ธ
</blockquote>
From the blog:
<ul>
<li><a>"Zig Smart Lights"</a></li>
</ul>
This is a hobby project for me to learn Zig software development.
Configuration
There is no auto-discovery (yet/ever). Subject to change.
Zonfig location: <code>~/.config/zun/zun.zon</code>
<code>zon
.{
.lights = .{
.{
.label = "Disco Light",
.addr = "192.168.1.10",
},
},
}</code>
<a>MIT License</a> | Copyright ยฉ 2025 <a>David Bushell</a> | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.