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/828651?v=4 | kw-policy-zig | fabriziosestito/kw-policy-zig | 2023-04-27T08:37:09Z | Kubewarden policy in Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/fabriziosestito/kw-policy-zig/tags | Apache-2.0 | [
"kubewarden",
"kubewarden-policy",
"wapc",
"wasm",
"zig"
] | 23 | false | 2024-11-06T17:18:22Z | true | false | unknown | github | [] | Kubewarden policy written in Zig
This is a simple <a>Kubewarden</a> policy that acts as an example of how to write a policy in Zig.
The policy looks at the name of a Kubernetes Pod and rejects the request if the name is on a deny list.
A major inspiration was taken from <a>this tutorial</a>.
Since Zig uses LLVM, the wasm32 target architecture is officially supported.
This project uses an updated fork of the <a>waPC Guest Library for Zig</a>.
Usage
Settings
Settings containing a list of invalid names are required.
<code>json
{ "invalid_names": ["bad-name", "another-bad-name"] }</code>
Example
Create a policy:
```bash
$ kubectl apply -f - <<EOF
apiVersion: policies.kubewarden.io/v1
kind: ClusterAdmissionPolicy
metadata:
name: kw-policy-zig
spec:
module: registry://ghcr.io/fabriziosestito/kw-policy-zig:v0.1.0
settings:
invalid_names:
- bad-name
- another-bad-name
rules:
- apiGroups:
- ""
apiVersions:
- v1
resources:
- pods
operations:
- CREATE
- UPDATE
mutating: false
EOF
```
Create a Pod with a valid name:
<code>$ kubectl apply -f examples/pod.yaml
pod/nginx created</code>
Create a Pod with an invalid name:
<code>$ kubectl apply -f examples/bad_pod.yaml
Error from server: error when creating "examples/bad_pod.yaml": admission webhook "clusterwide-kw-policy-zig
.kubewarden.admission" denied the request: Pod name: bad-name is not accepted.</code>
Bulding
This project is built using Zig <a>0.10.1</a>.
Zig is still young, so expect the build to break when newer versions are released.
<a>kwctl</a> is required to annotate and push the policy to a registry.
Since Zig doesn't have an official package manager, dependencies are provided as git submodules.
Clone the project:
<code>git clone git@github.com:fabriziosestito/kw-policy-zig
cd kw-policy-zig
git submodule update --init --recursive</code>
Build the policy:
<code>make</code>
Annotate the policy:
<code>make annotated-policy.wasm</code>
Push the policy to a registry:
<code>kwctl push annotated-policy.wasm ghcr.io/fabriziosestito/kw-policy-zig:v0.1.0</code>
Testing
Run tests:
<code>make test</code>
Install <a>bats-core</a> to run end-to-end tests.
Run E2E tests:
<code>make e2e-tests</code> | [] |
https://avatars.githubusercontent.com/u/109542784?v=4 | aws-lambda-zig | by-nir/aws-lambda-zig | 2024-02-26T22:31:14Z | 🟠 Write AWS Lambda functions in Zig programming language | main | 1 | 7 | 2 | 7 | https://api.github.com/repos/by-nir/aws-lambda-zig/tags | MIT | [
"aws",
"cloud",
"lambda",
"server",
"serverless",
"zig",
"zig-package"
] | 203 | false | 2025-04-20T17:28:05Z | true | true | 0.14.0 | github | [] | AWS Lambda Runtime for Zig
<a></a>
Write <em>AWS Lambda</em> functions in the Zig programming language to achieve blazing fast invocations and cold starts!
<a>🐣 Quick Start</a> ·
<a>📒 Documentation</a> ·
<a>💽 Demos</a>
Features
<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> Runtime API
<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> Extensions API
<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> Telemetry API
<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> Response streaming
<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> CloudWatch & X-Ray integration
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Lifecycle hooks
<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> Dependency injection
<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> Build system target configuration
<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> Managed build step
<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> Testing utilities
Services Events
<em>Feel free to open an issue for additional integrations, or better contribute a pull request.</em>
<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> Unified HTTP
<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> Lambda URLs
<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> API Gateway
<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> S3
<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> SQS
<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> SNS
<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> DynamoDB
<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> Data Firehose
Benchmark
Using zig allows creating small and fast functions.
Minimal <a>Hello World demo</a> (arm64, 256 MiB, Amazon Linux 2023):
<ul>
<li>❄️ <code>~11ms</code> cold start invocation duration</li>
<li>⚡ <code>~1.5ms</code> warm invocation duration</li>
<li>💾 <code>12 MiB</code> max memory consumption</li>
<li>⚖️ <code>0.36 MiB</code> function size (zip)</li>
</ul>
<blockquote>
[!TIP]
Check out <a>AWS SDK for Zig</a> for a
comprehensive Zig-based AWS cloud solution.
</blockquote>
Quick Start
<ol>
<li>Add a dependency to your project (replace <code>VERSION</code> with the desired version tag):
<code>console
zig fetch --save git+https://github.com/by-nir/aws-lambda-zig#VERSION</code></li>
<li>Configure the build script.</li>
<li>Implement a handler function (either an event handler or a streaming handler).</li>
<li>Build a handler executable for the preferred target architecture:
<code>console
zig build --release -Darch=x86
zig build --release -Darch=arm</code></li>
<li>Archive the executable into a zip:
<code>console
zip -qj lambda.zip zig-out/bin/bootstrap</code></li>
<li>Deploy the zip archive to a Lambda function:<ul>
<li>Configure it with <em>Amazon Linux 2023</em> or other <strong>OS-only runtime</strong>.</li>
<li>Use you prefered deployment method: console, CLI, SAM or any CI solution.</li>
</ul>
</li>
</ol>
Build Script
```zig
const std = @import("std");
const lambda = @import("aws-lambda");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{
.preferred_optimize_mode = .ReleaseFast,
});
<code>// Add an architecture confuration option and resolves a target query
const target = lambda.resolveTargetQuery(b, lambda.archOption(b));
// Add the handler executable
const exe = b.addExecutable(.{
.name = "bootstrap", // The executable name must be "bootstrap"!
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
// .link_libc = true, // Uncomment if glibc is required.
// .strip = true, // Uncomment if no stack traces are needed.
});
b.installArtifact(exe);
// Import the runtime module
const runtime = b.dependency("aws-lambda", .{}).module("lambda");
exe.root_module.addImport("aws-lambda", runtime);
</code>
}
```
Event Handler
```zig
const lambda = @import("aws-lambda");
// Entry point for the Lambda function.
pub fn main() void {
// Bind the handler to the runtime:
lambda.handle(handler, .{});
}
// Eeach event is processed separetly the handler function.
// The function must have the following signature:
fn handler(
ctx: lambda.Context, // Metadata and utilities
event: []const u8, // Raw event payload (JSON)
) ![]const u8 {
return "Hello, world!";
}
```
Documentation
Build
This library provides a runtime module that handles the Lambda lifecycle and communication with the execution environment.
To use it, follow the following requirements:
- Import the Lambda Runtime module this library provides and wrap a handler function with it.
- Build an executable named <em>bootstrap</em> and archive it in a Zip file.
- Use <em>Amazon Linux 2023</em> runtime.
Managed Target
AWS Lambda supports two architectures: <em>x86_64</em> and <em>arm64</em> based on <em>Graviton2</em>. In order to build the event handler correctly and to squeeze the best performance, the build target must be configured accordingly.
The mananged target resolver sets the optimal operating system, architecture and specific CPU supported features. Call <code>lambda.resolveTargetQuery(*std.Build, arch)</code> to resolve the target for the given architecture (either <code>.x86</code> or <code>.arm</code>).
To add a CLI configuration option call <code>lambda.archOption(*std.Build)</code> the following and pass the result to <code>lambda.resolveTargetQuery</code>.
It can then by set through <code>-Darch=x86</code> or <code>-Darch=arm</code> (defaults to <em>x86</em> when to manualy used).
Example Build Script
```zig
const std = @import("std");
const lambda = @import("aws-lambda");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{
.preferred_optimize_mode = .ReleaseFast,
});
<code>// Add an architecture CLI option (or hard code either `.x86` or `.arm`)
const arch: lambda.Arch = lambda.archOption(b);
// Managed architecture target resolver
const target = lambda.resolveTargetQuery(b, arch);
// Add the handler’s executable
const exe = b.addExecutable(.{
.name = "bootstrap", // The executable name must be "bootstrap"!
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
// .link_libc = true, // Uncomment if glibc is required.
// .strip = true, // Uncomment if no stack traces are needed.
});
b.installArtifact(exe);
// Import the runtime module
const runtime = b.dependency("aws-lambda", .{}).module("lambda");
exe.root_module.addImport("aws-lambda", runtime);
</code>
}
```
Event Handler
The event handler is the entry point for the Lambda function.
The library provides a runtime that handles the event lifecycle and communication with the Lambda’s execution environment. With it, you can focus on imlementing only the meaningful part of processing and responding to the event.
Since the library manages the lifecycle, it expects the handler to have a specific signature. <em>Note that <a>response streaming</a> has a dedicated lifecycle and handler signature.</em>
```zig
const lambda = @import("aws-lambda");
// Entry point for the Lambda function.
// Eeach event is processed separetly the handler function.
pub fn main() void {
// Bind the handler to the runtime:
lambda.handle(handlerSync, .{});
<code>// Alternatively, for asynchronous handlers:
lambda.handleAsync(handlerAsync, .{});
</code>
}
fn handlerSync(
ctx: lambda.Context, // Metadata and utilities
event: []const u8, // Raw event payload (JSON)
) ![]const u8 {
// Process the <code>event</code> payload and return a response payload.
return switch(payload.len) {
0 => "Empty payload.",
else => event,
};
}
fn handlerAsync(
ctx: lambda.Context, // Metadata and utilities
event: []const u8, // Raw event payload (JSON)
) !void {
// Process the <code>event</code> payload...
}
```
Errors & Logging
When a handler returns an error, the runtime will log it to <em>CloudWatch</em> and return an error response to the client.
The runtime exposes a static logging function that can be used to manually log messages to <em>CloudWatch</em>. The function follows Zig’s standard logging conventions.
```zig
const lambda = @import("aws-lambda");
lambda.log.err("This error is logged to {s}.", .{"CloudWatch"});
```
<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>
In release mode only <em>error</em> level is preserved, other levels are removed at compile time. This behavior may be overriden at build.
</blockquote>
Handler Context
The handler signature includes the parameter <code>ctx: lambda.Context</code>, it provides metadata and utilities to assist with the processing the event.
The following sections describe the context...
Memory Allocation
Since the runtime manages the function and invocation lifecycle, it also owns the memory. The <em>handler context</em> provides two allocators:
| Allocator | Behavior |
| --------- | -------- |
| <code>ctx.gpa</code> | You own the memory and <strong>must deallocate it</strong> by the end of the invocation. |
| <code>ctx.arena</code> | The memory is tied to the invocation’s lifetime. The runtime will deallocate it on your behalf after the invocation resolves. |
<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>
While <code>ctx.gpa</code> may be used to persist data and services between invocations, for such cases consider using <a>dependency injection</a> or <a>extensions</a>.
</blockquote>
Environment Variables
The functions’ environment variables are mapped by the <em>handler context</em>, they can be accesed using the <code>env(key)</code> method:
<code>zig
const foo_value = ctx.env("FOO_KEY") orelse "some_default_value";</code>
Invocation Metadata
Per-invocation metadata is provided by the <em>handler context</em> <code>ctx.request</code> field. It contains the following fields:
| Field | Type | Description |
| ----- | ---- | ----------- |
| <code>request_id</code> | <code>[]const u8</code> | AWS request ID associated with the request. |
| <code>xray_trace</code> | <code>[]const u8</code> | X-Ray tracing id. |
| <code>invoked_arn</code> | <code>[]const u8</code> | The function ARN requested. It may be different in <strong>each invoke</strong> that executes the same version. |
| <code>deadline_ms</code> | <code>u64</code> | Function execution deadline counted in milliseconds since the <em>Unix epoch</em>. |
| <code>client_context</code> | <code>[]const u8</code> | Information about the client application and device when invoked through the AWS Mobile SDK. |
| <code>cognito_identity</code> | <code>[]const u8</code> | Information about the Amazon Cognito identity provider when invoked through the AWS Mobile SDK. |
Configuration Metadata
Static config metadata is provided by the <em>handler context</em> <code>ctx.config</code> field. It contains the following fields:
| Field | Type | Description |
| ----- | ---- | ----------- |
| <code>aws_region</code> | <code>[]const u8</code> | AWS Region where the Lambda function is executed. |
| <code>aws_access_id</code> | <code>[]const u8</code> | Access key obtained from the function's <a>execution role</a>. |
| <code>aws_access_secret</code> | <code>[]const u8</code> | Access key obtained from the function's <a>execution role</a>. |
| <code>aws_session_token</code> | <code>[]const u8</code> | Access key obtained from the function's <a>execution role</a>. |
| <code>func_name</code> | <code>[]const u8</code> | Name of the function. |
| <code>func_version</code> | <code>[]const u8</code> | Version of the function being executed. |
| <code>func_size</code> | <code>u16</code> | Amount of memory available to the function in MB. |
| <code>func_init</code> | <code>InitType</code> | Initialization type of the function. |
| <code>func_handler</code> | <code>[]const u8</code> | Handler location configured on the function. |
| <code>log_group</code> | <code>[]const u8</code> | Name of the Amazon CloudWatch Logs group for the function. |
| <code>log_stream</code> | <code>[]const u8</code> | Name of the Amazon CloudWatch Logs stream for the function. |
Force Termination
Request the Lambda execution crash the runtime <strong>AFTER</strong> returning the response to the client.
<code>zig
ctx.forceTerminateAfterResponse();</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>
Use with caution! Only use this method when you assume the function won’t behave
as expected in the following invocation.
</blockquote>
Response Streaming
The runtime supports streaming responses to the client; though implementing a streaming handler differs from the standard handler.
```zig
const lambda = @import("aws-lambda");
// Entry point for the Lambda function.
pub fn main() void {
// Bind the handler to the runtime:
lambda.handleStream(handler, .{});
}
// Eeach event is processed separetly the handler function.
// The function must have the following signature:
fn handler(
ctx: lambda.Context, // Metadata and utilities
event: []const u8, // Raw event payload (JSON)
stream: lambda.Stream, // Stream delegate
) !void {
// Start streaming the response for a given content type.
try stream.open("text/event-stream");
<code>// Append to the streaming buffer.
try stream.write("data: Message");
try stream.writeFmt(" number {d}\n\n", .{1});
// Publish the buffer to the client.
try stream.flush();
// Wait for half a second.
std.time.sleep(500_000_000);
// Append to streaming buffer and immediatly publish to the client.
try stream.publish("data: Message number 2\n\n");
std.time.sleep(100_000_000);
// Publish also supports formatting.
try stream.publishFmt("data: Message number {d}\n\n", .{3});
// Optionally close the stream.
try stream.close();
</code>
}
```
Stream Delegate
Instead of resolving payload by returning from the handler we use the <em>stream delegate</em>.
Once a content type is known, the handler should call <code>stream.open(content_type)</code> to open the response stream. After the stream is opened you may incrementally append to the response.
<em>Closing the stream is not required.</em>
| Method | Description |
| ------ | ----------- |
| <code>stream.open(content_type)</code> | Opens the response stream for a provided HTTP content type. |
| <code>stream.openWith(content_type, raw_http_format, args)</code> | Opens the response stream for a provided HTTP content type and initial body payload. The user MUST format the payload with proper HTTP semantics (or use a Event Encoder). |
| <code>stream.writer()</code> | Writer for appending to the response buffer. |
| <code>stream.write(message)</code> | Appends a message to the response buffer. |
| <code>stream.flush()</code> | Publish the response buffer to the client. |
| <code>stream.publish(message)</code> | Appends a message to the buffer and <strong>immediatly</strong> publish it to the client. |
| <code>stream.close()</code> | Optionally conclude the response stream while continuing to process the event. |
Lifecycle Hooks
Not yet implemented.
Dependency Injection
Not yet implemented.
Extensions
Not yet implemented.
Demos
Hello World
Returns a short message.
<code>console
zig build demo:hello --release -Darch=ARCH_OPTION</code>
Debug
🛑 <em>Deploy with caution! May expose sensitive data to the public.</em>
Returns the raw payload as-is:
<code>console
zig build demo:echo --release -Darch=ARCH_OPTION</code>
Returns the function’s metadata, environment variables and the event’s raw payload:
<code>console
zig build demo:debug --release -Darch=ARCH_OPTION</code>
Errors
Immediatly returns an error; the runtime logs the error to <em>CloudWatch</em>:
<code>console
zig build demo:fail --release -Darch=ARCH_OPTION</code>
Returns an output larger than the Lambda limit; the runtime logs an error to <em>CloudWatch</em>:
<code>console
zig build demo:oversize --release -Darch=ARCH_OPTION</code>
Force the Lambda function instance the terminate after returning a response:
<code>console
zig build demo:terminate --release -Darch=ARCH_OPTION</code>
🛑 Use with caution!
<em>Only use this method when you assume the function won’t behave as expected in the following invocation.</em>
Response Streaming
👉 <em>Be sure to configure the Lambda function with URL enabled and RESPONSE_STREAM invoke mode.</em>
Stream a response to the client and continue execution of the response conclusion:
<code>console
zig build demo:stream --release -Darch=ARCH_OPTION</code>
Lambda URLs
Use Lambda URLs buffered invoke to serve dynamic web pages:
<code>console
zig build demo:url --release -Darch=ARCH_OPTION</code>
Use Lambda URLs response streaming to serve dynamic updates:
<code>console
zig build demo:url_stream --release -Darch=ARCH_OPTION</code>
License
The author and contributors are not responsible for any issues or damages caused
by the use of this software, part of it, or its derivatives. See <a>LICENSE</a>
for the complete terms of use.
<strong><em>AWS Lambda Runtime for Zig</em> is not an official <em>Amazon Web Services</em> software,
nor is it affiliated with <em>Amazon Web Services, Inc</em>.</strong> | [] |
https://avatars.githubusercontent.com/u/51542168?v=4 | terminal | mostik/terminal | 2024-02-09T10:06:20Z | Terminal tools written in Zig | main | 0 | 6 | 0 | 6 | https://api.github.com/repos/mostik/terminal/tags | - | [
"colors",
"terminal",
"zig"
] | 17 | false | 2024-08-25T18:50:58Z | true | true | unknown | github | [] | Terminal utilities
<a></a>
Install
<code>zig fetch --save https://github.com/Mostik/terminal/archive/v0.0.2.tar.gz</code>
```zig
//build.zig
const terminal = b.dependency("terminal", .{}).module("terminal");
exe.root_module.addImport("terminal", terminal);
<code></code>zig
const std = @import("std");
const terminal = @import("terminal");
pub fn main() !void {
...
}
```
ANSI Colors
```zig
const std = @import("std");
const Color = @import("terminal").Color;
pub fn main() !void {
const mystring = std.fmt.comptimePrint("{s} My text {s}", .{
Color(null).underline(),
Color(null).reset(),
});
std.debug.print("{s}\n", .{mystring});
<code>std.debug.print("{s}{s}\n", .{ Color(.fg).bit(3), "0-7" });
std.debug.print("{s}{s}\n", .{ Color(.fg).byte(213), "0-255" });
std.debug.print("{s}{s}\n", .{ Color(.fg).rgb(255, 255, 255), "rgb" });
std.debug.print("{s}{s}\n", .{ Color(.fg).hex(0xab23f2), "hex" });
std.debug.print("{s}{s}\n", .{ Color(.fg).enm(.red), "Colors.0-7" });
</code>
}
```
Terminal Size
<code>zig
std.debug.print("{any}", .{terminal.size()});
// Size{ .rows = 47, .columns = 95, .x_pixels = 950, .y_pixels = 987 }</code>
Cursor Position
```zig
const row = 10;
const col = 10;
try terminal.cursorPos(row, col);
```
getch
```zig
const std = @import("std");
const terminal = @import("terminal");
pub fn main() !void {
while (true) {
const ch: u8 = try terminal.getch();
<code> std.debug.print("{any}", .{ch});
}
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/109492796?v=4 | zig-milestone | zigcc/zig-milestone | 2024-03-28T12:31:17Z | Zig milstone monitor | main | 1 | 6 | 0 | 6 | https://api.github.com/repos/zigcc/zig-milestone/tags | MIT | [
"monitor",
"monitoring",
"turso",
"zig",
"ziglang"
] | 75 | false | 2025-03-24T19:23:11Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/80766200?v=4 | stl-loader-zig | Catniped/stl-loader-zig | 2024-07-15T20:45:49Z | A tiny simple zig library for loading STL files with binary and ASCII support | main | 0 | 6 | 2 | 6 | https://api.github.com/repos/Catniped/stl-loader-zig/tags | MIT | [
"zig",
"zig-gamedev",
"zig-package"
] | 7 | false | 2025-04-23T16:15:55Z | true | true | unknown | github | [] | stl-loader-zig
A tiny simple zig library for loading STL files with support for both ASCII and binary representations.
Usage
Example usage provided in <a>example.zig</a>:
```c
const stlLoader = @import("stl-loader");
...
const filepath: []const u8 = "file.stl";
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const allocator = gpa.allocator();
defer _ = gpa.deinit();
const mesh = try stlLoader.load_stl(allocator, filepath);
defer allocator.free(mesh);
// do stuff with mesh
```
Loading by default should be done thru dispatcher function, which takes a path for the file <strong>relative to the cwd</strong> and automatically chooses which implementation of the reader to use. If the type of the STL file is known at compile time, or you wish to dispatch the functions manually, <strong>note the offsets for the reader required before calling the functions.</strong>
Notes
<ul>
<li>Apparently normals may sometimes be left blank by the software that generates the stl files, so you may wanna recalculate them (i have not encountered this in the wild yet however)!</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/38372270?v=4 | zmpv | hasanpasha/zmpv | 2024-05-10T17:32:55Z | libmpv bindings in zig | main | 2 | 6 | 0 | 6 | https://api.github.com/repos/hasanpasha/zmpv/tags | LGPL-2.1 | [
"libmpv",
"mpv",
"video",
"zig",
"zig-package"
] | 2,857 | false | 2025-04-14T18:45:40Z | true | true | 0.12.0 | github | [] | zmpv
<code>libmpv</code> bindings in zig.
Usage
<ul>
<li>first fetch the package into your project:</li>
</ul>
<code>bash
zig fetch --save https://github.com/hasanpasha/zmpv/archive/${DESIRED_COMMOT_HASH}.tar.gz</code>
- import the package in your <code>build.zig</code> file:
<code>zig
const zmpv_dep = b.dependency("zmpv", .{ .target = target, .optimize = optimize });
exe.root_module.addImport("zmpv", zmpv_dep.module("zmpv"));
exe.linkSystemLibrary("mpv"); # in linux
exe.linkLibC();</code>
Example
```zig
const std = @import("std");
const zmpv = @import("zmpv");
const Mpv = zmpv.Mpv;
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{ .verbose_log = true }){};
defer {
if (gpa.deinit() == .leak) @panic("detected memory leak");
}
const allocator = gpa.allocator();
<code>const args = try std.process.argsAlloc(allocator);
defer std.process.argsFree(allocator, args);
if (args.len < 2) {
std.debug.print("usage: {s} [filename]\n", .{args[0]});
return;
}
const filename = args[1];
const mpv = try Mpv.create(allocator);
try mpv.set_option("osc",.{ .Flag = true });
try mpv.set_option("input-default-bindings",.{ .Flag = true });
try mpv.set_option("input-vo-keyboard",.{ .Flag = true });
try mpv.initialize();
defer mpv.terminate_destroy();
try mpv.command_async(0, &.{ "loadfile", filename });
try mpv.request_log_messages(.Error);
try mpv.observe_property(1, "fullscreen", .Flag);
try mpv.observe_property(2, "time-pos", .INT64);
try mpv.set_property("fullscreen", .{ .Flag = true });
while (true) {
const event = mpv.wait_event(-1);
const event_id = event.event_id;
switch (event_id) {
.Shutdown, .EndFile => break,
.LogMessage => {
const log = event.data.LogMessage;
std.log.debug("[{s}] \"{s}\"", .{ log.prefix, log.text });
},
.PropertyChange, .GetPropertyReply => {
const property = event.data.PropertyChange;
if (std.mem.eql(u8, property.name, "fullscreen")) {
std.log.debug("[fullscreen] {}", .{property.data.Flag});
} else if (std.mem.eql(u8, property.name, "time-pos")) {
switch (property.data) {
.INT64 => |time_pos| {
std.log.debug("[time-pos] {}", .{time_pos});
},
else => {},
}
}
},
else => {},
}
}
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/24578855?v=4 | zig-time | deatil/zig-time | 2024-05-18T05:20:20Z | A date and time parse and format library for Zig | main | 0 | 6 | 2 | 6 | https://api.github.com/repos/deatil/zig-time/tags | Apache-2.0 | [
"date",
"datetime",
"time",
"zig",
"zig-time"
] | 48 | false | 2025-04-03T12:35:22Z | true | true | 0.14.0-dev.3451+d8d2aa9af | github | [] | Zig-time
A date and time parse and format library for Zig.
Env
<ul>
<li>Zig >= 0.14.0-dev.3451+d8d2aa9af</li>
</ul>
Adding zig-time as a dependency
Add the dependency to your project:
<code>sh
zig fetch --save=zig-time git+https://github.com/deatil/zig-time#main</code>
or use local path to add dependency at <code>build.zig.zon</code> file
<code>zig
.{
.dependencies = .{
.@"zig-time" = .{
.path = "./lib/zig-time",
},
...
},
...
}</code>
And the following to your <code>build.zig</code> file:
<code>zig
const zig_time_dep = b.dependency("zig-time", .{});
exe.root_module.addImport("zig-time", zig_time_dep.module("zig-time"));</code>
The <code>zig-time</code> structure can be imported in your application with:
<code>zig
const zig_time = @import("zig-time");</code>
Get Starting
~~~zig
const std = @import("std");
const time = @import("zig-time");
pub fn main() !void {
const time_0 = time.now().timestamp();
std.debug.print("now time: {d} \n", .{time_0});
<code>// ==========
const seed: i64 = 1691879007;
const fmt: []const u8 = "YYYY-MM-DD HH:mm:ss z";
const alloc = std.heap.page_allocator;
const instant = time.Time.fromTimestamp(seed).setLoc(time.UTC);
const fmtRes = try instant.formatAlloc(alloc, fmt);
defer alloc.free(fmtRes);
// output:
// format time: 2023-08-12 22:23:27 UTC
std.debug.print("format time: {s} \n", .{fmtRes});
</code>
}
~~~
LICENSE
<ul>
<li>The library LICENSE is <code>Apache2</code>, using the library need keep the LICENSE.</li>
</ul>
Copyright
<ul>
<li>Copyright deatil(https://github.com/deatil).</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/113083639?v=4 | system_sdk | zig-gamedev/system_sdk | 2024-06-10T19:57:32Z | System libraries and headers for cross-compiling zig-gamedev libs & sample apps | main | 0 | 6 | 6 | 6 | https://api.github.com/repos/zig-gamedev/system_sdk/tags | MIT | [
"cross-platform",
"gamedev",
"sdk",
"zig"
] | 8,965 | false | 2025-04-23T23:58:26Z | true | true | unknown | github | [] | <a>zig-gamedev system_sdk</a>
System libraries and headers for cross-compiling <a>zig-gamedev</a> libs and sample applications.
Usage
build.zig
<code>zig
switch (target.os.tag) {
.windows => {
if (target.cpu.arch.isX86()) {
if (target.abi.isGnu() or target.abi.isMusl()) {
if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
compile_step.addLibraryPath(system_sdk.path("windows/lib/x86_64-windows-gnu"));
}
}
}
},
.macos => {
if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
compile_step.addLibraryPath(system_sdk.path("macos12/usr/lib"));
compile_step.addFrameworkPath(system_sdk.path("macos12/System/Library/Frameworks"));
}
},
.linux => {
if (target.cpu.arch.isX86()) {
if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
compile_step.addLibraryPath(system_sdk.path("linux/lib/x86_64-linux-gnu"));
}
} else if (target.cpu.arch == .aarch64) {
if (b.lazyDependency("system_sdk", .{})) |system_sdk| {
compile_step.addLibraryPath(system_sdk.path("linux/lib/aarch64-linux-gnu"));
}
}
},
else => {},
}</code> | [
"https://github.com/Aryvyo/zigClipboard",
"https://github.com/Senryoku/Deecy",
"https://github.com/azillion/gravitas",
"https://github.com/cyberegoorg/cetech1",
"https://github.com/jcalabro/uscope",
"https://github.com/yusdacra/levent",
"https://github.com/zig-gamedev/zglfw",
"https://github.com/zig-g... |
https://avatars.githubusercontent.com/u/34946442?v=4 | amazig | cryptocode/amazig | 2024-06-30T12:04:23Z | Maze generator based on the Origin Shift algorithm | main | 0 | 6 | 0 | 6 | https://api.github.com/repos/cryptocode/amazig/tags | MIT | [
"gamedev",
"maze",
"maze-generator",
"origin-shift",
"zig",
"zig-package"
] | 11 | false | 2025-05-09T14:20:17Z | true | true | unknown | github | [] | <strong>amazig</strong> is a non-allocating library for generating perfect mazes for games and puzzles, using the
Origin Shift algorithm. A perfect maze is one where you can pick any pair of positions and
be guaranteed that these two positions are joined by a unique path. Such a maze
is a minimum spanning tree, and it is thus free of loops and isolated areas.
You can still add such features using the generated maze as the starting point.
The Origin Shift algorithm
The Origin Shift algorithm was discussed in a January 2024 video by <a>CaptainLuma</a>, and
turns out to be a rediscovery of an algorithm described in a 1988 <a>paper</a>
on Markov chains by V. Anantharam. It's been noted that Origin Shift is essentially the Aldous-Broder algorithm in reverse.
The key property of Origin Shift is that the starting point is an already perfect maze, and every iteration produces a new perfect maze.
During the maze generation, we thus never have to ask if the maze is complete - it always is! However, since we usually start with a trivial
maze we still run the algorithm steps quite a few times to make the maze look good.
Seeding the maze
The fact that a perfect maze generator requires a perfect maze to begin with might be the reason
why it took so long for someone to consider this approach. However, a baseline perfect maze is trivial
to contruct programmatically, regardless of size.
The initial maze is by convention one with the origin at the lower-right corner. Every
node points to its right neighbor, except for the last one on each row, which points to
its neighbor below.
For a 25 by 12 maze, the initial state looks like this:
<code>→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → ↓
→ → → → → → → → → → → → → → → → → → → → → → → → O</code>
<em>Any initial perfect maze will do, and in some cases it may make sense to start off
with a pre-selected perfect maze, and then perhaps mutate it per some rules. This can
lead to some fun game ideas.</em>
You should be able to convince yourself that wherever you start navigating in this maze,
you'll end up at the origin. The simple maze mutation algorithm below maintains
this property no matter how often you iterate:
<ul>
<li>Point the current origin to a neighbor in any random direction</li>
<li>Make the selected neighbor point to nothing, thus also making it the new origin</li>
</ul>
The direction can be picked by any means, but a good PRNG is usually used.
After a number of iterations, the maze paths may look something like this:
<code>→ ↓ ← ↓ ↓ ← ↓ ← ← ↓ → → ↓ ← ← → → ↓ → ↓ ← ← ← ← ←
↓ → ↓ → ↓ ↓ ↓ ↑ → → ↓ ↑ ↓ ← ↓ ↑ ← ↓ ↓ ↓ ↑ ↑ ← ↑ ←
→ ↑ ↓ → → → → ↓ ↑ ← → ↑ → → ↓ ↑ ↑ ↓ ← ← ← ↓ ↑ ← ↑
→ ↓ → → → ↑ ↑ → ↓ → ↓ ↓ ← → → ↑ → ↓ ← ← ↓ ← ↑ ↑ ↑
↑ ↓ → → ↑ ↓ → ↑ O ↑ → ↓ ↑ ← ← ← ↓ ← ↓ ↑ ← ← → ↑ ←
↑ → ↓ ↑ ↑ ← → ↑ ↑ ← ← ← → ↑ ← → → → ↓ ← ↑ → ↑ ↑ ←
↑ ↑ ↓ → → ↑ ← ← ↑ → ↓ ↑ → ↑ ← ← ← ← ← ↓ → → → ↑ ↑
↑ ↓ ← ↑ ↑ ↓ ← ← ↑ ↓ ↓ ↑ ↑ ← ↓ ↑ → ↑ ← ↓ ↑ ↓ ↑ → ↑
↑ → → ↑ ← ↓ ← ← ↑ ← → ↓ ↑ ← → ↑ ↓ ↓ ← → → → → ↑ ←
→ → ↑ ↓ → ↓ → ↓ ↓ ↑ ↓ → ↓ ↑ → ↑ → ↓ → ↑ → ↓ ↑ ↑ ↓
↑ → ↑ ← ← ← ← ← ← ↑ ↓ ↓ → ↑ ← ← → → ↑ ↑ ← → → ↑ ←
→ ↑ ↑ ↑ ← ← ← ← ↑ ↑ ← → ↑ → ↑ ← ↑ ↑ ← ← ↑ ← ← ← ←</code>
Pick any arrow at random and follow the path. You'll eventually end up at the origin.
Note that we're generating the <em>paths</em> here, not the walls. The library does, however,
offer a "wallified API" to make it easy to render mazes for games and puzzles.
Origin Shift is not the most time-efficient maze generator, though for typical maze sizes used in
games and puzzles this is unlikely to be an issue. For mazes that don't change at runtime, you can also pre-generate
the maze either through tooling or at compile-time.
Origin Shift is a simple algorithm which allows for mazes to mutate at runtime.
This might be handy in certain games and puzzles.
Moreover, the generated maze have directed edges for every single position already pointing towards the
origin, which may represent an exit or a final destination on a level (or you can completely ignore the origin after maze generation)
Representation in memory
The maze is represented as a simple row-major u32 slice of size <code>rows * columns</code> where each item is the offset to
the neighbor it points to. This is all the memory ever needed by the library, and the buffer is provided by the library user.
If needed, you can convert this representation into whatever suits your project.
Using the library
The library requires Zig 0.14
Use <code>zig fetch --save <url></code> to update your zon file. Alternatively, just copy <code>lib-amazig.zig</code> to your
project, as it's self-contained.
A simple example is included which animates the generation. Simply run <code>zig build run</code>. This example also shows how
to use the wallified API, which makes it trivial to draw the walls and paths without additional memory.
The library does not allocate, so it's up to you to provide a backing buffer for the maze paths. This can
be heap allocated or a static buffer.
To generate a new maze, call <code>init</code>. Supply a random number generator of your choice, the number of rows and columns,
and optionally the initial number of iterations. If this is null, then a heuristic default is used. If you supply 0 iterations, then you
can can call <code>iterate</code> or <code>iterateOnce</code> yourself any number of times. | [] |
https://avatars.githubusercontent.com/u/86081585?v=4 | zig-function-overloading | fig-eater/zig-function-overloading | 2024-06-20T17:17:45Z | Explicit function overloading for the Zig programming language | main | 0 | 6 | 0 | 6 | https://api.github.com/repos/fig-eater/zig-function-overloading/tags | Unlicense | [
"zig",
"zig-package",
"ziglang"
] | 28 | false | 2025-03-05T09:21:19Z | true | true | 0.13.0 | github | [] | Explicit Function Overloading for Zig
Simple one-file, no-dependency, explicit function overloading for zig.
This all runs during compile time so running overloaded functions shouldn't have
any runtime overhead.
Install
Using Zig Package Manager
Run <code>zig fetch --save https://github.com/fig-eater/zig-function-overloading/archive/refs/heads/main.tar.gz</code>
within your project directory. Run this again if you ever want to update the dependency.
Then add an import to the module which needs overloading to your <code>build.zig</code>
This code is an example of how you might do this:
```zig
const overloading_dependency = b.dependency("overloading", .{
.target = target,
.optimize = optimize,
});
// in a default project <code>compile_step</code> might be <code>lib</code> or <code>exe</code>.
// replace the first "overloading" here to avoid namespace conflicts or to change the name of the import for your project.
compile_step.root_module.addImport("overloading", overloading_dependency.module("overloading"));
```
Manually
Download <a>src/overloading.zig</a> and save in your project.
Import directly using <code>@import("path/to/overloading.zig")</code>
<em>or</em>
See <a>build.zig</a> for an example of how to use this as a local
module.
Usage
<ul>
<li>Import the <code>overloading</code> module or <code>overloading.zig</code> if saved locally.</li>
<li>Call <code>overloading.make</code> with a tuple of functions, <code>make</code> will return a function which when
called will call a function in the tuple with corresponding argument types.</li>
<li>All functions passed in the tuple must have the same return type.</li>
<li>Functions in the tuple cannot have the same arguments as others in the tuple.</li>
<li>If a function takes no arguments, pass <code>{}</code> into the overloaded function to call it.</li>
<li>If a function takes multiple arguments pass the arguments in a tuple.</li>
<li>If a function takes void as it's only argument pass in <code>.{{}}</code> into the overloaded function to call it</li>
</ul>
Example:
```zig
const std = @import("std");
const overloading = @import("overloading");
fn addNoArgs() u32 {
return 0;
}
fn addU32(a: u32) u32 {
return a;
}
fn addU8Slice(as: []const u8) u32 {
var total: u32 = 0;
for (as) |a| total +|= a;
return total;
}
fn addOptionalU32(a: ?u32) u32 {
return if (a) |a_val| return a_val else 0;
}
fn addPtrU32(a_ptr: <em>u32) u32 {
return a_ptr.</em>;
}
fn addU32I32(a: u32, b: i32) u32 {
return a + @as(u32, @intCast(b));
}
fn printNoArgs() void {
std.debug.print("no args\n", .{});
}
fn printVoid(_: void) void {
std.debug.print("void\n", .{});
}
fn printU32(a: u32) void {
std.debug.print("{d}\n", .{a});
}
fn printU8Slice(a: []const u8) void {
std.debug.print("{s}\n", .{a});
}
fn printU32U32(a: u32, b: u32) void {
std.debug.print("{d} {d}\n", .{ a, b });
}
const myAdd = overloading.make(.{
addNoArgs,
addU32,
addU8Slice,
addOptionalU32,
addPtrU32,
addU32I32,
});
const myPrint = overloading.make(.{
printNoArgs,
printVoid,
printU32,
printU8Slice,
printU32U32,
});
pub fn main() void {
const optional_with_val: ?u32 = 555;
const optional_with_null: ?u32 = null;
var a: u32 = 5;
_ = myAdd({}); // returns 0
_ = myAdd(2); // returns 2
_ = myAdd("abc"); // returns 294
_ = myAdd(optional_with_val); // returns 555
_ = myAdd(optional_with_null); // returns 0
_ = myAdd(&a); // returns 5
_ = myAdd(.{ 5, 20 }); // returns 25
<code>myPrint({}); // prints "no args"
myPrint(.{{}}); // prints "void"
myPrint(2); // prints "2"
myPrint("hello"); // prints "hello"
myPrint(.{ 3, 4 }); // prints "3 4"
</code>
}
```
See <a>example.zig</a> for another example.
License
Licensed under the Unlicense see included <a>LICENSE</a> file or
https://unlicense.org
Attribution to fig / fig-eater / groakgames is appreciated but not required. | [] |
https://avatars.githubusercontent.com/u/672917?v=4 | zigosc | davidgranstrom/zigosc | 2024-04-08T12:04:14Z | OSC serialization library | main | 1 | 6 | 0 | 6 | https://api.github.com/repos/davidgranstrom/zigosc/tags | MIT | [
"opensoundcontrol",
"osc",
"zig"
] | 43 | false | 2025-02-20T07:23:49Z | true | true | unknown | github | [] | zigosc
<code>zigosc</code> is a <a>OSC 1.0</a> serialization library with no dynamic memory allocation.
Progress
<strong>Serialization</strong>
<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> Types
<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> Message
<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> Bundle
Build
See <code>zig build -h</code> for build options.
<code>zig build</code>
Testing
<code>zig build test --summary all</code>
Example usage
```zig
const std = @import("std");
const zigosc = @import("zigosc");
const Message = zigosc.Message;
const Value = zigosc.Value;
pub fn main() !void {
var buf: [128]u8 = undefined;
<code>// Encode message
const values = [_]Value{
.{ .i = 777 },
.{ .f = 3.14 },
.{ .s = "hi" },
.{ .b = &[_]u8{ 0x12, 0x00, 0x23 } },
};
var msg = Message.init("/addr", "ifsbTFNI", &values);
var num_bytes = try msg.encode(&buf);
const data = buf[0..num_bytes]; // serialized OSC data, suitable for transmission
// Decode message
var address: []const u8 = undefined;
var typetag: []const u8 = undefined;
var out_values: [8]Value = undefined;
var num_decoded_values: usize = 0;
num_bytes = try Message.decode(data, &address, &typetag, &out_values, &num_decoded_values);
// Inspect
std.debug.print("address = {s} typetag = {s}\n", .{ address, typetag });
for (num_decoded_values, 0..) |_, i| {
std.debug.print("value[{}] = {}\n", .{ i, out_values[i] });
}
</code>
}
```
License
```
MIT License
Copyright (c) 2024 David Granström
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
``` | [] |
https://avatars.githubusercontent.com/u/14016375?v=4 | zigpak | thislight/zigpak | 2024-05-24T11:22:25Z | Messagepack for zig | master | 0 | 5 | 0 | 5 | https://api.github.com/repos/thislight/zigpak/tags | Apache-2.0 | [
"messagepack",
"msgpack",
"zig",
"ziglang"
] | 276 | false | 2025-05-15T22:25:05Z | true | true | 0.12.0 | github | [] | Zigpak
Messagepack for Zig.
<a></a>
<ul>
<li><a>API References (latest release)</a></li>
<li><a>API References (master)</a></li>
</ul>
Supported:
<ul>
<li>Zig 0.12 (best effort)</li>
<li>Zig 0.13</li>
<li>Zig 0.14 (the master branch)</li>
</ul>
Use In Your Project
Use a tarball link with <code>zig fetch --save</code>. You can find it in the "Tags" page. Some versions of zig can only fetch "tar.gz" files, so you may prefer this type.
<code>sh
zig fetch --save https://link-to-tarball</code>
Assume the saved name is the default "zigpak". In the build script, refer the "zigpak" module.
```zig
// build.zig
pub fn build(b: <em>std.Build) void {
// ...
const exe: </em>std.Build.Compile;
<code>const zigpak = b.dependency("zigpak", .{
.target = target,
.optimize = optimize,
}).module("zigpak");
exe.root_module.addImport("zigpak", zigpak);
</code>
}
```
License
Apache-2.0 | [] |
https://avatars.githubusercontent.com/u/6756180?v=4 | zig-mos-examples | kassane/zig-mos-examples | 2024-05-01T16:41:32Z | Using zig + llvm-mos-sdk on some examples | main | 2 | 5 | 1 | 5 | https://api.github.com/repos/kassane/zig-mos-examples/tags | Apache-2.0 | [
"6502",
"c64",
"commodore64",
"hello-world",
"llvm-mos",
"neo6502",
"nes",
"nesdev",
"nesdoug",
"zig",
"zig-mos"
] | 45 | false | 2025-01-08T08:04:27Z | true | false | unknown | github | [] | Zig language & toolchain in MOS6502 examples
Using zig [LLVM 20] + LLVM-MOS-SDK on some examples
This repository contains examples showcasing the usage of the Zig programming language
with the LLVM-MOS backend in the Zig toolchain version 0.14.0-dev (LLVM 20). These examples
aim to provide a comprehensive reference for developers interested in leveraging Zig for
MOS 6502-based development.
Getting Started
To build and run these examples, ensure you have the Zig toolchain version 0.14.0-dev + LLVM-MOS-SDK installed.
Required
<ul>
<li><a>Zig-mos</a></li>
<li><a>LLVM-MOS-SDK</a></li>
</ul>
<strong>Clone this repository:</strong>
<code>bash
git clone https://github.com/kassane/zig-mos-examples.git
cd zig-mos-examples</code>
Choose the example to be built and have fun.
References
These examples draw inspiration from various sources:
<ul>
<li><a>LLVM-MOS-SDK Examples</a>: Borrowing concepts and methodologies from the official LLVM-MOS-SDK examples, adapt them to showcase Zig's capabilities.</li>
<li><a>Nesdoug (LLVM-MOS compat) Tutorial</a>: Leveraging insights and techniques from the Nesdoug tutorial, provide Zig-specific implementations for MOS 6502 development.</li>
<li>Rust-MOS Examples: Explore similar use cases and approaches in Zig for MOS 6502 development.<ul>
<li>https://github.com/mrk-its/rust-mos-hello-world</li>
<li>https://github.com/mrk-its/llvm-mos-ferris-demo</li>
</ul>
</li>
</ul>
Contributing
Contributions to this repository are welcome! Whether it's fixing bugs, adding new examples, or improving existing ones, your contributions help make this resource more valuable to the community. Please refer to the CONTRIBUTING.md file for guidelines on how to contribute.
License
This repository is licensed under the APACHE 2.0 License. See the LICENSE file for details.
Disclaimer
These examples are provided for educational and illustrative purposes. While efforts have been made to ensure accuracy and reliability, they may not be suitable for production use without further validation and testing. Use at your own risk. | [] |
https://avatars.githubusercontent.com/u/2567177?v=4 | qbe-zig | malcolmstill/qbe-zig | 2024-04-01T16:31:41Z | QBE (https://c9x.me/compile/) via zig | master | 0 | 5 | 1 | 5 | https://api.github.com/repos/malcolmstill/qbe-zig/tags | MIT | [
"compiler-backend",
"qbe",
"zig",
"zig-package"
] | 482 | false | 2025-03-19T13:55:51Z | true | true | unknown | github | [] | QBE via zig
This repo provides QBE installable / dependable on via the zig package manager. QBE
can be consumed either as a binary or a library
QBE binary
The <code>qbe-zig</code> provides an artifact <code>qbe</code> that some other module can depend on:
```zig
// Depend on qbe-zig via a build.zig.zon
const qbe = b.dependency("qbe-zig", .{ .target = target, .optimize = optimize });
// Extract the <code>qbe</code> binary artifact
const qbe_bin = qbe.artifact("qbe");
```
QBE library
The upstream QBE repository does not expose a anyway of using QBE as a library.
<code>qbe-zig</code> offers the ability to call QBE as library by more or less duplicating
the existing <code>main.c</code> as <code>lib.c</code> and replacing the <code>main</code> function with <code>libemit</code>.
A tiny wrapper around <code>libemit</code> is then provided via <code>src/qbe.zig</code>.
To use QBE as a library in a zig project, in your <code>build.zig</code> have something like:
```zig
// Depend on qbe-zig via a build.zig.zon
const qbe = b.dependency("qbe-zig", .{ .target = target, .optimize = optimize });
const exe = b.addExecutable(...);
// Link against the static library
exe.linkLibrary(qbe.artifact("qbe-lib"));
// Expose to your exe code
exe.root_module.addImport("qbe-zig", qbe.module("qbe-zig"));
```
In your zig code import the module:
<code>zig
const qbe = @import("qbe-zig");</code>
Call <code>emit</code> where you need:
<code>zig
qbe.emit("test.ssa", "test.s");</code>
See <code>example/</code> for full example of library usage. | [] |
https://avatars.githubusercontent.com/u/53529846?v=4 | zig-wasm-example | oltdaniel/zig-wasm-example | 2024-06-29T11:56:03Z | exploring wasm with zig | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/oltdaniel/zig-wasm-example/tags | MIT | [
"wasm",
"zig"
] | 60 | false | 2024-12-04T00:16:14Z | true | true | unknown | github | [] | Zig WASM Example
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
This project has been re-written as an actual library and can be found at <a>oltdaniel/zig-js-interplay</a>. This repo will probably be archived in the future.
</blockquote>
This repo is playing with Zig and WASM to see how easy or hard it is passing values between them, without an ready-to-go generator like in <code>wasm-pack</code> for Rust.
Example
This is an example which hides type handling behind a Helper class.
<blockquote>
See full example in <a><code>www/index.html</code></a> and <a><code>src/wasm.zig</code></a>.
</blockquote>
```js
import ZigWASMWrapper from './helper.js';
let wasm = await ZigWASMWrapper.initialize("./main.wasm");
console.log(wasm.greet("Daniel"));
// => prints "Hello Daniel!"
wasm.printJSON({message: "Greetings"});
// => prints "JSON = {"message":"Greetings"}!"
wasm.silence();
// => does nothing
wasm.testFunction((...args) => {
console.log('I got called from zig with these arguments=', args)
})
// => prints "I got called from zig with these arguments= ['Hello', 'World]"
```
And the zig code excluding the type hanlding is also straightforward:
```zig
// type definitions and imports
export fn greet(arg: String) String {
// Get the real value passed to us by javascript
const name = arg.value();
<code>// ... this ignores some code of the actual code to print a message in between
// Generate a new greet message that we can return
const greetMessage = std.fmt.allocPrint(gpa, "Hello {s}!", .{name}) catch @panic("Oops");
// Return the greet message as a compatible type
return String.init(greetMessage);
</code>
}
export fn printJSON(arg: JSON) void {
const message = std.fmt.allocPrint(gpa, "JSON = {s}!", .{arg.value()}) catch @panic("Oops");
js.log(String.init(message));
}
export fn testFunction(arg: Function) AnyType {
const args = Array.from(&.{ String.init("Hello").asAny(), String.init("World").asAny() });
return arg.call(args);
}
```
Documentation
<blockquote>
<strong>TODO</strong>: Write documentation on the encoding and examples for each type and scenario.
</blockquote>
Requirements
<ul>
<li>zig, I'm running the latest release <code>0.13</code></li>
<li>python, to serve the output</li>
<li>make, just as a command shortcut tool</li>
</ul>
Running
```bash
compile the wasm file
make
start the server
make server
```
Information
A small blog article on how I ended up writing this repo: <a>Playing with zig and wasm</a>
Known pitfalls
<ul>
<li>Introducing the dynamic and untyped nature of JS into Zig requires additional verification of types during runtime. Other libraries generate the JS interface to avoid pitfalls like this, but they require an additional compile step and delivery of the custom compiled WASM file as well as the JS file. Thereby, assuming types is ignorant just like in JS and you need to verify them "manually". <strong>NOTE</strong>: The Compatible Types built in Zig verify their type when a type specific action is executed (like calling <code>.value()</code> or <code>.call()</code>).</li>
<li>When Zig returns or accepts non-compatible types, the behavior is undefined or rather the same was with not using the library. This means, the built-in abstraction on the JS side won't work as it expects compatible types.</li>
<li>There is currently no abstraction for memory allocation. If something like a string of length zero is requested for allocation, it fails.</li>
</ul>
ToDo
<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> Memory abstraction for error handling
<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> Clean-up of 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> Documentation
License
<a>LICENSE MIT</a> | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | zig-sokol-imgui-wasm | fjebaker/zig-sokol-imgui-wasm | 2024-05-28T23:26:35Z | A floooh/sokol module with example app using ImGui and ImPlot that can compile to WASM. | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/fjebaker/zig-sokol-imgui-wasm/tags | GPL-3.0 | [
"gui",
"imgui",
"implot",
"sokol",
"wasm",
"zig"
] | 679 | false | 2025-03-06T00:04:26Z | true | true | unknown | github | [
{
"commit": "master.tar.gz",
"name": "sokol",
"tar_url": "https://github.com/floooh/sokol-zig/archive/master.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/floooh/sokol-zig"
},
{
"commit": "1f7a8c0314d838a76695bccebe0f66864f507bc0.tar.gz",
"name": "implot",
"tar_url... | A sokol ImGui + ImPlot example in Zig
Made with Zig 0.14.0-dev.2623+7aa95bc7f. Should work with a few versions either side of that quite alright.
<code>bash
zig build run</code>
WASM
View it live <a>here</a>.
Build it yourself with:
<code>bash
zig build run -Dtarget=wasm32-emscripten</code> | [] |
https://avatars.githubusercontent.com/u/69832658?v=4 | Pinc | bluesillybeard/Pinc | 2024-05-13T03:52:41Z | cross platform windowing / rendering library written in Zig and C | main | 1 | 5 | 0 | 5 | https://api.github.com/repos/bluesillybeard/Pinc/tags | MIT | [
"c",
"graphics",
"graphics-engine",
"window",
"x11",
"xlib",
"zig"
] | 1,850 | false | 2025-01-25T18:51:44Z | true | true | unknown | github | [] |
Pinc
Pinc is a cross platform windowing / rendering library written in Zig.
QUICK NOTE: this project has been somewhat abandoned. Contributions will be accepted, however a new version of this library written entirely in C is being worked on. The reason for ditching Zig is that it does not support old versions of Windows, among other concerns with the creators of the language. C also compiles from anywhere to everwhere, while Zig is still somewhat limited by LLVM and its standard library.
Pincs goals
<ul>
<li>Language agnostic - The external API is entirely in C, which makes binding to other languages relatively simple<ul>
<li>The header is written plain C, which can be loaded through any C compatible FFI system imaginable</li>
<li>the external API only makes used of <code>int</code>, and <code>char</code> (and <code>void</code> obviously) - it doesn't even need pointers!<ul>
<li>there will be versions of functions that make use of more specific types, for languages that can make use of that.</li>
</ul>
</li>
<li>TODO: need bindings</li>
</ul>
</li>
<li>ABSOLUTELY ZERO compile time dependencies, other than the Zig compiler<ul>
<li>This includes system libraries that are not included in Zig's cross-compile toolchain. They must be loaded at runtime.</li>
<li>All of the headers needed are included in the repository. The headers all have their individual licenses listed at the top of the file.</li>
<li>TODO: option to statically / directly link required libraries instead of loading them at runtime.</li>
</ul>
</li>
<li>Easy to use<ul>
<li>comparable to something like SDL or SFML, with the bonus of being a lot easier to compile and link</li>
<li>admittedly the API is a bit verbose</li>
</ul>
</li>
<li>Flexible<ul>
<li>can be linked statically or dynamically</li>
<li>determines the API to use at runtime, so fewer compilation targets are needed</li>
<li>cross-compiles from any platform to any platform (supported by the Zig compiler of course)</li>
<li>Can be made to work with any C ABI (Zig's compiler for the win!)<ul>
<li>Except for musl, since it doesn't allow loading libraries at runtime (sad)</li>
</ul>
</li>
<li>TODO: options to select the API visibility and calling convention</li>
</ul>
</li>
</ul>
Other things
<ul>
<li>Pinc does not take hold of the entry point.<ul>
<li>note: it's unclear how well this pans out with platforms like Android where the entry point is non-standard.</li>
</ul>
</li>
<li>Pinc does not provide a main loop<ul>
<li>note: it's unclear how this will effect platforms like the web where the main loop is supposed to be managed externally</li>
</ul>
</li>
</ul>
Windowing backends
<ul>
<li>SDL2</li>
</ul>
Graphics backends
<ul>
<li>OpenGL 2.1</li>
</ul>
Important notes
Pinc is a very new library, and is MASSIVELY out of scope for a single developer like myself. As such:
- Expect bugs / issues
- a large portion of the API is not implemented yet
- the API is highly variable for the forseeable future
- Give me your suggestions - the API is VERY incomplete and we don't know what's missing!
- the project desparately needs contributors - see <a>contribution guide</a>
Pinc's current API is fundamentally incompatible with multithreading. Sorry.
How to get started
<ul>
<li>Get Zig (this is tested on zig master but it might work on older versions)<ul>
<li>I suggest installing zigup or some kind of zig version manager.</li>
</ul>
</li>
<li>Clone the repository</li>
<li>Make sure it works by running <code>zig build window -Drun=true</code> in the root of the repository, which will build and run the window example.<ul>
<li>For now, you will need SDL2 on your system. Pinc doesn't need it to compile anything, but SDL2 is required to run programs made with Pinc. In the future, native backends for most supported platforms will be implemented so SDL2 is no longer required. But for now, SDL2 is a requirement.</li>
</ul>
</li>
</ul>
At this point, I suggest messing with the examples for a bit to get a feel for how the library works.
The easiest way to use Pinc would be to just compile it into a library with <code>zig build static</code> or <code>zig build dynamic</code>, copy the artifact and the header, and just add it to your linker flags. Automating that would be a good idea, especially for cross-compilation so you don't have a bajillion copies of the same library pre-compiled for different platforms.
This project does not integrate with any existing build systems other than Zig. That being said, contributions that add support for other build systems / package managers are accepted and celebrated! Once a build system is implemented, it shouldn't need much (or any) maintainence due to the fact that Pinc has all dependencies self-contained or loaded at runtime.
Hopefully the header is self-exaplanatory. If it's not clear what a function or type does, consider submitting an issue so we can improve documentation.
It's worth noting the Pinc makes heavy use of asserts that will not trigger in ReleaseFast mode. You should use Debug or ReleaseSafe to build the library. ReleaseFast is an option for those who absolutely need every tiny bit of performance.
Other notes
<ul>
<li>When cross-compiling, it is generally a good idea to specify the ABI (example: <code>x86_64-linux-gnu</code> instead of <code>x86_64-linux</code>) as it tends to default to the wrong ABI.<ul>
<li>In particular, compiling from Windows to Linux uses musl by default, which does not work as Pinc uses dynamic loading with libc on Linux</li>
</ul>
</li>
<li>The main branch is "stable" in the sense that it should always work. Before commiting to the main branch, We'll make sure everything still works.<ul>
<li>the library as a whole is NOT stable. DO not use Pinc unless you are willing to face the consequences!</li>
</ul>
</li>
</ul>
Q&A
<ul>
<li>Why make this when other libraries already exist?<ul>
<li>the state of low-level windowing / graphics libraries is not ideal. Kinc's build system is a mess, Raylib is too basic, V-EZ hasn't been updated in many years, bgfx is written in C++, SDL doesn't cross-compile easily, nicegraf and llgl don't provide a way to create a window, GLFW has no way to have multiple windows on a single OpenGL context, Jai is a programming language instead of a library, and the list goes on and on and on. They are all great, but they all suck in specific ways that are conveniently very bad for a certain group of programmers</li>
<li>Additionally, a library with an insanely wide net of supported backends is very useful. Admittedly, the only backend implemented at the moment is based on SDL2, but take a look at the <a>Planned Backends</a>,</li>
</ul>
</li>
<li>Why support OpenGL 2.1. It's so old! (and deprecated)<ul>
<li>I thought it would be cool to be able to run this on extremely ancient hardware and OS, for no other reason than to see it run. Partially inspired by <a>MattKC porting .NET framework 2 to Windows 95.</a></li>
<li>If a platform is capible of running OpenGL 2.1, someone has probably made an opengl driver for it</li>
</ul>
</li>
</ul>
Planned graphics backends (NOT FINAL)
<ul>
<li>Raw / framebuffer on the CPU / software rasterizer</li>
<li>SDL 1<ul>
<li>Is this even worth implementing despite the raw and opengl backends?</li>
</ul>
</li>
<li>SDL 2<ul>
<li>Is this even worth implementing despite the raw and opengl backends?</li>
</ul>
</li>
<li>SDL 3<ul>
<li>Is this even worth implementing despite the raw and opengl backends?</li>
</ul>
</li>
<li>OpenGL 1.x<ul>
<li>not sure which 1.x version(s) yet</li>
</ul>
</li>
<li>OpenGL 3.x<ul>
<li>not sure which 3.x verison yet</li>
</ul>
</li>
<li>OpenGL 4.x<ul>
<li>note sure which 4.x version(s) yet</li>
</ul>
</li>
<li>OpenGL 4.6 (last OpenGL release)</li>
<li>Vulkan 1.0 (first vulkan release)</li>
<li>Vulkan 1.2 (last Vulkan release that is very widely supported on older hardware)</li>
<li>Vulkan 1.3 (last Vulkan release)</li>
</ul>
Planned window backends (NOT FINAL)
<ul>
<li>SDL 1</li>
<li>SDL 3</li>
<li>X11 (Xlib)</li>
<li>win32</li>
<li>windows 9x (TODO: figure out what the API is called for this)</li>
<li>Cocoa</li>
<li>Wayland</li>
<li>GLFW</li>
<li>Haiku</li>
<li>Andriod</li>
<li>IOS</li>
</ul>
Planned backends / platforms in the VERY FAR future
None of these are going to be implemented any time soon - if ever.
- Playstation 4/5
- Nintendo DS
- Xbox
- It's basically just Windows (I think), should be pretty easy actually
- Nintendo switch
- There seems to be a lack of info on how this could be done.
- N64 would be funny
- Playstation would also be funny
- Microsoft DOS
- an msdos backend doesn't even make sense, as I don't think it has a universal way to draw pixels on the screen
- terminal text output
- haha ascii art go BRRR
- 3dfx's Glide graphics api
- The funny thing is, there are actual Glide drivers available for modern GPUS. I believe it's an implementation that uses Vulkan to emulate the original API.
backends that will NEVER be implemented
<ul>
<li>Raw X11 network packets<ul>
<li>are you crazy!? Also, good luck getting OpenGL or Vulkan to work.</li>
</ul>
</li>
<li>Xcb<ul>
<li>Not worth the effort. Xlib works fine for X11.</li>
</ul>
</li>
</ul>
Missing features (LOOKING FOR CONTRIBUTORS / API DESIGN IDEAS)
<ul>
<li>window position<ul>
<li>wayland be like:</li>
</ul>
</li>
<li>lots of events aren't implemented yet</li>
<li>ability get data from specific backends<ul>
<li>X display, X windows, SDL2 opengl context, Win32 window handle, etc etc etc</li>
</ul>
</li>
<li>backend-specific settings</li>
<li>ability to use backend objects to create Pinc objects<ul>
<li>example: init pinc's X backend with an X Display, or a window with an X window handle, etc.</li>
</ul>
</li>
<li>general input methods<ul>
<li>controller / gamepad</li>
<li>touch screen</li>
<li>drawing tablet</li>
<li>VR headsets<ul>
<li>every headset seems to have its own position / velocity system...</li>
</ul>
</li>
</ul>
</li>
<li>HDR support<ul>
<li>Admittedly, HDR support is still in the early stages on anything other than Windows...</li>
</ul>
</li>
<li>Ability to get system theme colors and name<ul>
<li>Probably pretty easy on Windows</li>
<li>Does MacOS even have themes?</li>
<li>good luck doing this on Linux lol<ul>
<li>GNOME</li>
<li>KDE Plasma</li>
<li>Cosmic</li>
<li>XFCE</li>
<li>AwesomeWM</li>
<li>Sway</li>
<li>Cinnamon</li>
<li>Budgeee</li>
<li>Mate</li>
<li>... and a billion more, although most of the current smaller ones will likely die along with X11</li>
<li>could probably just read the GTK and QT system themes and get 99% coverage</li>
<li>I think recently a portal and standard for cross-toolkit theming was created</li>
</ul>
</li>
</ul>
</li>
<li>Audio support<ul>
<li>audio playback to a default or specific device</li>
<li>software audio, or something like OpenAL which supports hardware acceleration</li>
<li>directly output samples</li>
<li>audio recording</li>
<li>arbitrary inputs and outputs for something like DAW software<ul>
<li>ability to check the system's ability to handle multiple inputs / multiple outputs</li>
<li>notify the application when the user edits the audio output through system settings or something like qpwgraph</li>
</ul>
</li>
<li>native implementations for OpenAL, ALSA, pipewire, and whatever else?<ul>
<li>SDL backend probably</li>
</ul>
</li>
</ul>
</li>
</ul>
Todo (NOT IN ORDER)
Note: Even if a feature/item you want is in here, make an issue anyway! Features are prioritized based on github issues.
- replace undefined behavior with an assert function
- ALL undefined behavior that could be caused by user input, including integer overflows/overflows, OOB array index, and null dereference.
- make that assert function have a bunch of extra information about what conditions can cause it to happen
- the purpose of this is to make debugging broken programs a lot easier without using a proper debugger or knowledge of Pinc's internals
- On-screen keyboard controls
- touch gestures
- Hopefully this is as simple as reporting multiple cursor positions
- Test zero-dependency compilation
- Set up github discussions thingy
- error callback function, instead of forcing everyone to manually get the error if a function returns a value indicating an error
- test on ALL zig tier 3 platforms, ideally using real hardware. As of right now, those are:
- Windows x86_64 (testing hardware is available)
- Windows x86 (testing hardware is available)
- Windows aarch64
- Macos aarch64
- Macos x86_64
- Linux x86_64 (testing hardware is available)
- Linux x86 (testing hardware is available)
- Linux aarch64
- Linux armv7a
- Linux riscv64
- Linux powerpc64le
- add functions that take advantage of pointers for performance
- particularily for 3D rendering with large meshes
- example / test for having multiple windows
- get the cursor movement within a specific window
- get cursor movement delta
- lock cursor
- properly implement and test scaling
- add a way to get the size of a window in real units (like inches or something)
- empty / "null" / mock window backend
- empty / "null" / mock graphics backend
- figure out how to get Pinc working on older operating systems
- This may be best accomplished by using Zig's C backend, or maybe even rewriting Pinc in C because Zig does not seem to have any intention of supporting EOL operating systems.
- Particularly Windows 7 which is still used for some reason, as well as older version of MacOS (I don't have older mac computers to test on though)
- This may be easier by avoiding libc wherever possible - It's basically impossible to do Linux without libc, but Windows and Macos may be a different story. | [] |
https://avatars.githubusercontent.com/u/88917554?v=4 | netfilez | mkashirin/netfilez | 2024-03-17T21:31:39Z | Netilez is a very simple file buffer written in Zig. | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/mkashirin/netfilez/tags | MIT | [
"filebuffer",
"networkprogramming",
"zig"
] | 115 | false | 2025-04-21T12:05:31Z | true | true | 0.14.1-dev.80+60922dbf3 | github | [] | Netfilez
Netfilez is a very simple file buffer files written in the Zig programming language. Is was built
to gain better understanding of low level languages and systems programming in general.
Building
Clone this repository onto your local machine using the Git Command Line Interface (CLI):
<code>shell
git clone https://github.com/mkashirin/netfilez</code>
Compile a binary using the Zig compiler (the sole valid version is 0.14.1) by running the following
command:
<code>shell
zig build -Doptimize=ReleaseSafe</code>
After completing the steps above, the binary will be located in the zig-out/bin/.
Usage
The information provided by the <code>netfilez help</code> options describes all the arguments in detail.
However, the following is an example of how to use the tool on your local machine only (make sure
to make Netfilez visible to your system first).
Open a terminal and execute the following command, specifying the path to the file that you wish to
process:
<code>shell
netfilez \
--action="dispatch" \
--filepath="/absolute/path/to/file.ext" \
--host="127.0.0.1" \
--port="8080" \</code>
Then, open a second terminal instance and execute the following command, specifying your own path
to the directory where you want to store the received file:
<code>shell
netfilez \
--action="receive" \
--filepath="/absolute/path/to/directory/" \
--host="127.0.0.1" \
--port="8080" \</code>
<strong>Remember</strong>, the file size must not exceed the maximum of 8 kilobytes.
Note
Devises to be communicating with files must have ability to ping each other. | [] |
https://avatars.githubusercontent.com/u/49950206?v=4 | ac-library-zig | Ryoga-exe/ac-library-zig | 2024-02-26T23:39:03Z | Zig implementation of AtCoder Library | main | 2 | 5 | 1 | 5 | https://api.github.com/repos/Ryoga-exe/ac-library-zig/tags | CC0-1.0 | [
"atcoder-library",
"competitive-programming",
"zig",
"zig-library",
"zig-package"
] | 111 | false | 2025-05-11T15:58:57Z | true | true | 0.14.0 | github | [] | ac-library-zig
ac-library-zig is a Zig implementation of AtCoder Library (ACL).
See below for ACL.
<ul>
<li><a>Original repository (implemented in C++)</a></li>
<li><a>AtCoder Library (ACL) - AtCoder</a></li>
<li><a>AtCoder Library - Codeforces</a></li>
</ul>
API Reference
Automatically generated API Reference for the project can be found at https://repos.ryoga.dev/ac-library-zig.
<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>
Zig autodoc is in beta;
the website may be broken or incomplete.
</blockquote> | [] |
https://avatars.githubusercontent.com/u/4424467?v=4 | zig-webgpu-compute-shader | ethanthoma/zig-webgpu-compute-shader | 2024-07-19T23:23:18Z | Example of running a compute shader in Zig using webgpu | main | 0 | 6 | 0 | 6 | https://api.github.com/repos/ethanthoma/zig-webgpu-compute-shader/tags | - | [
"shaders",
"webgpu",
"wgpu",
"zig"
] | 31 | false | 2025-01-26T00:29:18Z | true | true | unknown | github | [
{
"commit": null,
"name": "wgpu_native",
"tar_url": null,
"type": "relative",
"url": "wgpu_native"
}
] |
Zig WebGPU Compute Shader Example
This codebase uses WebGPU to run a really simple shader in zig. I use nix as the
build tool to fetch wgpu-native and compile the rust code. It should be pretty
easy to do without nix.
The compute shader is taken from <a>here</a>.
The flake.nix uses <a>zig2nix</a> for building
and running the code. I set it to use Vulkan but it is pretty easy to use any
other backend.
Running
To run the code, simply run:
<code>nix run github:ethanthoma/zig-webgpu-compute-shader</code>
Or clone the repo locally and run <code>nix run</code>.
Input and Output
The input to the compute shader is an array of 32 bit floats. The array is 64
elements long. The value of the elements start at 1 and count to 64. The code
below is how it is initalized:
<code>zig
var input_data: [64]f32 = undefined;
for (input_data, 0..) |_, i| {
input_data[i] = @floatFromInt(i + 1);
}</code>
The output from the shader is each element multipled by 2 and then added to it
by 1. The output is below:
<code>[0] = 3e0, [1] = 5e0, [2] = 7e0, [3] = 9e0, [4] = 1.1e1, [5] = 1.3e1,
[6] = 1.5e1, [7] = 1.7e1, [8] = 1.9e1, [9] = 2.1e1, [10] = 2.3e1, [11] = 2.5e1,
[12] = 2.7e1, [13] = 2.9e1, [14] = 3.1e1, [15] = 3.3e1, [16] = 3.5e1,
[17] = 3.7e1, [18] = 3.9e1, [19] = 4.1e1, [20] = 4.3e1, [21] = 4.5e1,
[22] = 4.7e1, [23] = 4.9e1, [24] = 5.1e1, [25] = 5.3e1, [26] = 5.5e1,
[27] = 5.7e1, [28] = 5.9e1, [29] = 6.1e1, [30] = 6.3e1, [31] = 6.5e1,
[32] = 6.7e1, [33] = 6.9e1, [34] = 7.1e1, [35] = 7.3e1, [36] = 7.5e1,
[37] = 7.7e1, [38] = 7.9e1, [39] = 8.1e1, [40] = 8.3e1, [41] = 8.5e1,
[42] = 8.7e1, [43] = 8.9e1, [44] = 9.1e1, [45] = 9.3e1, [46] = 9.5e1,
[47] = 9.7e1, [48] = 9.9e1, [49] = 1.01e2, [50] = 1.03e2, [51] = 1.05e2,
[52] = 1.07e2, [53] = 1.09e2, [54] = 1.11e2, [55] = 1.13e2, [56] = 1.15e2,
[57] = 1.17e2, [58] = 1.19e2, [59] = 1.21e2, [60] = 1.23e2, [61] = 1.25e2,
[62] = 1.27e2, [63] = 1.29e2,</code> | [] |
https://avatars.githubusercontent.com/u/91665686?v=4 | Zaytracer | Miou-zora/Zaytracer | 2024-04-15T18:35:15Z | Raytracer in Zig | main | 0 | 5 | 2 | 5 | https://api.github.com/repos/Miou-zora/Zaytracer/tags | MIT | [
"graphics-programming",
"nix",
"nix-flake",
"qoi",
"raytracing",
"zig"
] | 4,092 | false | 2025-04-23T13:48:21Z | true | true | 0.14.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": "b97be7d14fd7c421fe55f31a37c8... | Zaytracer (Raytracer in zig)
:bookmark_tabs: Requirements
<ul>
<li>:cherry_blossom: zig 0.14</li>
</ul>
:zap: Usage
:construction_worker: Building
Release
<code>sh
zig build -Doptimize=ReleaseFast</code>
Debug
<code>sh
zig build</code>
:rocket: Running
With <code>zig build</code> or <code>zig build -Doptimize=ReleaseFast</code>
```sh
It will build the project and run it. (do nothing if the project is already built)
zig build run
or you can run the executable directly
./zig-out/bin/Zaytracer
```
Perf
Performance measures
To take performance measures you can use th perf tool like this:
<code>sh
perf record -g ./Zaytracer
perf report -g 'graph,0.5,caller'</code>
You will need a debug build for that, else you won't have debug symbols.
Time measures
You can use the hyperfine tool to measure the time of execution of the program.
After <code>zig build -Doptimize=ReleaseFast</code>:
<code>sh
hyperfine "./zig-out/bin/Zaytracer" --warmup 10</code> | [] |
https://avatars.githubusercontent.com/u/72736082?v=4 | asciitecture | smallbraintime/asciitecture | 2024-06-06T13:29:44Z | terminal graphics game library for zig | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/smallbraintime/asciitecture/tags | MIT | [
"ascii",
"ascii-graphics",
"term",
"zig",
"zig-package"
] | 337 | false | 2025-04-25T11:16:20Z | true | true | 0.13.0 | github | [] | 🔺asciitecture
A simple text-based graphics game library for zig . Currently, it only supports Linux.
Dependencies
<ul>
<li>zig 0.13.0</li>
<li>libc</li>
<li>libx11-dev</li>
<li>libxrandr-dev</li>
</ul>
Run example
<code>zig build example</code>
Run tests
<code>zig build test</code>
Todo
<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> Add alpha blending
<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> Update Color struct
<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> Add more tests and docs
<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> Add Windows support
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Add grapheme clusters | [] |
https://avatars.githubusercontent.com/u/90096350?v=4 | zig-tools.nvim | Libsod/zig-tools.nvim | 2024-05-01T09:13:08Z | Improve your Zig experience in Neovim! A plugin that provides integration with the Zig development tools | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/Libsod/zig-tools.nvim/tags | GPL-3.0 | [
"lua",
"neovim",
"nix",
"nvim",
"nvim-plugin",
"plugin",
"zig",
"ziglang"
] | 23 | false | 2024-08-13T21:13:05Z | false | false | unknown | github | [] | zig-tools.nvim
This project is still in the early stage of development | [] |
https://avatars.githubusercontent.com/u/43412083?v=4 | zlox | tusharsadhwani/zlox | 2024-08-04T20:48:14Z | Lox bytecode interpreter, written in Zig 0.13.0. | main | 0 | 5 | 0 | 5 | https://api.github.com/repos/tusharsadhwani/zlox/tags | MIT | [
"lox-language",
"zig"
] | 90 | false | 2025-04-29T03:55:13Z | false | false | unknown | github | [] | zlox
Lox bytecode interpreter, written in Zig 0.13.0.
Usage
<code>bash
zig build-exe ./src/main.zig --name zlox
./zlox examples/math.lox</code> | [] |
https://avatars.githubusercontent.com/u/8881507?v=4 | strcompare | aalbacetef/strcompare | 2024-05-10T15:17:18Z | strcompare is a library for comparing strings using Hamming, Levenshtein, and Damerau-Levenshtein metrics. | master | 1 | 4 | 0 | 4 | https://api.github.com/repos/aalbacetef/strcompare/tags | BSD-3-Clause | [
"damerau-levenshtein",
"hamming-distance",
"levenshtein",
"levenshtein-distance",
"string-comparison",
"zig"
] | 32 | false | 2025-01-21T17:56:22Z | true | true | unknown | github | [] | <a></a>
strcompare
<code>strcompare</code> is a zig library implementing 3 of the most common string comparison algorithms:
<ul>
<li>Hamming distance</li>
<li>Levenshtein distance </li>
<li>Damerau-Levenshtein distance (specifically, the optimal string alignment distance)</li>
</ul>
Usage
The library provides two convenience functions: <code>similarity</code> and <code>distance</code>.
Both functions accept a <code>Metrics</code> argument, one of:
<code>zig
pub const Metrics = enum {
Damerau,
Hamming,
Levenshtein,
};</code>
distance
<code>distance</code> will return the edit distance, a <code>u64</code>.
It accepts the following arguments:
- alloc: an <code>std.mem.Allocator</code>
- metric: one of the <code>Metrics</code>
- a, b: strings to compare
Example:
```zig
const a = "kitten";
const b = "sitting";
const d = distance(alloc, Metrics.Levenshtein, a, b);
std.debug.print("distance: {d}\n", .{d});
//
// distance: 3
//
```
similarity
<code>similarity</code> returns a weighted distance, that is, an <code>f64</code> from <code>0.0</code> to <code>1.0</code>.
It will return <code>0.0</code> if the strings differ completely and <code>1.0</code> if they are identical.
It accepts the following arguments:
- alloc: an <code>std.mem.Allocator</code>
- metric: one of the <code>Metrics</code>
- a, b: strings to compare
Example:
```zig
const a = "kitten";
const b = "sitting";
const d = similarity(alloc, Metrics.Levenshtein, a, b);
std.debug.print("similarity: {d:.0}%\n", .{d*100.0});
//
// similarity: 57%
//
```
Installing
After acquiring the repo's code, run:
<code>bash
zig fetch --save ./path/to/strcompare</code>
then add the following to your <code>build.zig</code>
```zig
const pkg = b.dependency("strcompare", .{});
exe.root_module.addImport("strcompare", pkg.module("strcompare"));
```
Do the same for your tests:
```zig
<code>const exe_unit_tests = b.addTest(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
exe_unit_tests.root_module.addImport("strcompare", pkg.module("strcompare"));
</code>
```
You should now be able to import the module with:
```zig
const strcompare = @import("strcompare");
const Metrics = strcompare.Metrics;
const distance = strcompare.distance;
const similarity = strcompare.similarity;
fn dist() !void {
const a = "a";
const b = "bb";
const alloc = std.heap.page_allocator;
<code>const d = try distance(alloc, Metrics.Levenshtein, a, b);
std.debug.print("distance: {d}\n", .{d});
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/48453766?v=4 | sysfetch | pkwasniok/sysfetch | 2024-07-25T09:22:08Z | Neofetch alternative written in Zig | main | 1 | 4 | 1 | 4 | https://api.github.com/repos/pkwasniok/sysfetch/tags | - | [
"cli",
"linux",
"linux-app",
"neofetch",
"neofetch-clone",
"resources-monitoring",
"system",
"zig"
] | 740 | false | 2025-04-09T16:50:03Z | true | true | unknown | github | [] | Sysfetch
Neofetch alternative for Linux written in Zig.
Installation
This project is currently in very early stage of development so only option to install it is to build it from source.
Building from source
Dependencies
<ol>
<li><a>Zig compiler (0.13.0)</a></li>
</ol>
Steps
Follow those steps to build from source:
1. Clone this repository (<code>$ git clone https://github.com/pkwasniok/sysfetch</code>)
2. Build (<code>$ cd sysfetch && zig build</code>)
3. Install (<code># cp zig-out/bin/sysfetch /bin/</code>) | [] |
https://avatars.githubusercontent.com/u/499599?v=4 | tmpfile.zig | liyu1981/tmpfile.zig | 2024-03-13T04:29:41Z | a convenient util to use tmp files with zig | master | 1 | 4 | 4 | 4 | https://api.github.com/repos/liyu1981/tmpfile.zig/tags | - | [
"zig",
"zig-package"
] | 7 | false | 2024-12-31T00:02:23Z | true | true | unknown | github | [] | tmpfile.zig
why
So far as I found there is no good lib in <code>zig</code> for creating temp files, so I write one for myself. This util file provides methods to create temp dir or temp file in system temp folder less tedious and manageable.
see code for example
<code>zig
var tmp_file = try ThisModule.tmpFile(.{});
defer tmp_file.deinit(); // file will be deleted when deinit
try tmp_file.f.writeAll("hello, world!");
try tmp_file.f.seekTo(0);
var buf: [4096]u8 = undefined;
var read_count = try tmp_file.f.readAll(&buf);
try testing.expectEqual(read_count, "hello, world!".len);
try testing.expectEqualSlices(u8, buf[0..read_count], "hello, world!");</code>
or complexer
```zig
var tmp_dir = try ThisModule.tmpDirOwned(.{});
defer {
tmp_dir.deinit();
tmp_dir.allocator.destroy(tmp_dir);
}
var tmp_file = try ThisModule.tmpFile(.{ .tmp_dir = tmp_dir });
defer tmp_file.deinit();
try tmp_file.f.writeAll("hello, world!");
try tmp_file.f.seekTo(0);
var buf: [4096]u8 = undefined;
var read_count = try tmp_file.f.readAll(&buf);
try testing.expectEqual(read_count, "hello, world!".len);
try testing.expectEqualSlices(u8, buf[0..read_count], "hello, world!");
var tmp_file2 = try ThisModule.tmpFile(.{ .tmp_dir = tmp_dir });
defer tmp_file2.deinit();
try tmp_file2.f.writeAll("hello, world!2");
try tmp_file2.f.seekTo(0);
read_count = try tmp_file2.f.readAll(&buf);
try testing.expectEqual(read_count, "hello, world!2".len);
try testing.expectEqualSlices(u8, buf[0..read_count], "hello, world!2");
```
useage
use zig packager
<code>bash
zig fetch --save https://github.com/liyu1981/tmpfile.zig/archive/refs/heads/main.tar.gz</code>
(or lock on any commit as)
<code>bash
zig fetch --save zig fetch https://github.com/liyu1981/zcmd.zig/archive/<commit hash>.tar.gz</code>
this lib is also provided for <code>build.zig</code>, use like
<code>zig
// in build.zig
const tmpfile = @import("tmpfile").tmpfile;</code>
license
MIT | [] |
https://avatars.githubusercontent.com/u/48872998?v=4 | ziggy-with-it | getchoo/ziggy-with-it | 2024-05-30T11:19:22Z | A small example of a Nix flake for a Zig project | main | 3 | 4 | 0 | 4 | https://api.github.com/repos/getchoo/ziggy-with-it/tags | MIT | [
"nix",
"nix-flake",
"zig",
"ziglang"
] | 46 | false | 2024-11-16T22:06:40Z | true | true | unknown | github | [
{
"commit": "1cceeb70e77dec941a4178160ff6c8d05a74de6f.tar.gz",
"name": "known-folders",
"tar_url": "https://github.com/ziglibs/known-folders/archive/1cceeb70e77dec941a4178160ff6c8d05a74de6f.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/ziglibs/known-folders"
}
] | ziggy-with-it
A small example of a <a>Nix flake</a> for a <a>Zig</a> project!
Features
<ul>
<li>A <a>development shell</a></li>
<li><code>zig</code> from <code>master</code> via <a>mitchellh/zig-overlay</a></li>
<li>A package built with <a><code>zig.hook</code></a> and <a><code>nix-community/zon2nix</code></a></li>
</ul>
Thanks
<ul>
<li>@paperdave for teaching me how to use <code>zon</code> (...or just enough to make this flake work)</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/36482619?v=4 | zigqlite | jkoop/zigqlite | 2024-07-24T16:41:33Z | An SQLite binding for Zig. | master | 0 | 4 | 0 | 4 | https://api.github.com/repos/jkoop/zigqlite/tags | MIT | [
"sqlite",
"zig",
"zig-package"
] | 5,761 | false | 2025-02-22T21:27:25Z | true | true | 0.12.0 | github | [] | zigqlite
<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>
Forked from https://chiselapp.com/user/javier/repository/zigqlite
</blockquote>
An <a>SQLite</a> binding for <a>Zig</a>.
Install
<code>sh
zig fetch --save https://github.com/jkoop/zigqlite/archive/COMMIT.zip</code>
```zig
// build.zig before b.installArtifact(exe);
const zigqlite = b.dependency("zigqlite", .{
.target = target,
.optimize = optimize,
}).module("zigqlite");
exe.linkSystemLibrary("c");
exe.linkSystemLibrary("sqlite3"); // apt install libsqlite3-dev
exe.root_module.addImport("zigqlite", zigqlite);
```
Usage
See also, the <a>API documentation</a>.
To open a database file at the given path, creating it if needed:
<code>zig
var db = try sqlite.DB.open(allocator, "database.db");
defer db.close() catch unreachable; // @todo figure out if I can handle this error or not</code>
Create a statment:
<code>zig
var stmt = try db.prep("SELECT * FROM iguanas WHERE name = ?");</code>
The SQL can include positional arguments like <code>?</code> or named arguments like <code>:argname</code>.
Once prepared, the statement is executed with the <code>.exec()</code> function:
<code>zig
// var cursor = try stmt.exec(args, rowtype);
var cursor = try stmt.exec(.{"Zero"}, struct { name: []u8, photo_url: []u8 });</code>
Where <code>args</code> is a tuple or structure holding arguments to fill in the SQL command. If field names match named arguments, they are used regardless of order; otherwise the position in the tuple or struct determines the field it fills.
The <code>rowtype</code> parameter is a struct type. Each returned row will be a value of this type. Each field will hold a column from the row, in order. If there are more fields than columns, the extra fields would be filled with their respective default value, if declared in the struct.
The value returned by the <code>stmt.exec()</code> function is used to retrieve results row by row with the <code>.fetch()</code> function:
<code>zig
while (try cursor.fetch()) |iguana| {
std.debug.print("{s}'s picture is at {s}\n", .{ iguana.name, iguana.photo_url });
}</code> | [] |
https://avatars.githubusercontent.com/u/8929752?v=4 | ZigSdlGameTemplate | vbrusca/ZigSdlGameTemplate | 2024-04-12T14:09:32Z | An empty Zig project configured with the SDL library as a starting point for Zig game development. | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/vbrusca/ZigSdlGameTemplate/tags | GPL-3.0 | [
"game",
"sdl",
"template",
"zig"
] | 8,443 | false | 2025-02-06T13:38:29Z | true | true | unknown | github | [] | Zig SDL Game Template
An empty Zig project configured with the SDL library as a starting point for Zig game development. The full Zig project is included in this repo.
Zig Build Version
This project was built against Zig version "zig-windows-x86_64-0.14.0-dev.1588+2111f4c38" and SDL version "SDL2-2.30.2".
Developers
Victor Brusca
Carlo Bruscani
Based On
This template was based on an older tutorial, <a>Zig For Game Dev</a>, and updated to work with the current version of Zig.
Execution Example
Running the executable, "zig-out\bin," after a project build, "zig build," results in the following basic SDL demonstration window. Tested only on Windows 11.
| [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | shaderc.zig | tiawl/shaderc.zig | 2024-04-09T17:02:49Z | shaderc packaged for @ziglang | trunk | 0 | 4 | 2 | 4 | https://api.github.com/repos/tiawl/shaderc.zig/tags | Unlicense | [
"binding",
"shaderc",
"spaceporn",
"zig",
"zig-package",
"ziglang"
] | 239 | false | 2025-05-09T12:49:58Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "glslang_zig",
"tar_url": "https://github.com/tiawl/glslang.zig/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/glslang.zig"
},
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/m... | shaderc.zig
This is a fork of <a>google/shaderc</a> packaged for <a>Zig</a>
Why this fork ?
The intention under this fork is to package <a>google/shaderc</a> for <a>Zig</a>. So:
* Unnecessary files have been deleted,
* The build system has been replaced with <code>build.zig</code>,
* A cron runs every day to check <a>google/shaderc</a>. Then it updates this repository if a new release is available.
How to use it
The goal of this repository is not to provide a <a>Zig</a> binding for <a>google/shaderc</a>. There are at least as many legit ways as possible to make a binding as there are active accounts on Github. So you are not going to find an answer for this question here. The point of this repository is to abstract the <a>google/shaderc</a> compilation process with <a>Zig</a> (which is not new comers friendly and not easy to maintain) to let you focus on your application. So you can use <strong>shaderc.zig</strong>:
- as raw (no available example, open an issue if you are interested in, we will be happy to help you),
- as a daily updated interface for your <a>Zig</a> binding of <a>google/shaderc</a> (see <a>here</a> for a private usage).
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>google/shaderc</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/spaceporn</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>google/shaderc</a>
* <a>tiawl/toolbox</a>
* <a>tiawl/glslang.zig</a>
* <a>tiawl/spirv.zig</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/1970306?v=4 | zig-build-system--0.13.0-examples | rustkas/zig-build-system--0.13.0-examples | 2024-07-11T02:33:08Z | Exampels of Zig's tutorial | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/rustkas/zig-build-system--0.13.0-examples/tags | - | [
"build",
"zig",
"ziglang"
] | 15 | false | 2025-04-23T13:57:28Z | false | false | unknown | github | [] | Zig Build System
Exampels of Zig's tutorial
<ul>
<li>Getting Started</li>
<li><a>Simple Executable</a></li>
<li><a>Adding a Convenience Step for Running the Application</a></li>
<li>The Basics</li>
<li><a>User-Provided Options</a></li>
<li><a>Standard Configuration Options</a></li>
<li><a>Options for Conditional Compilation</a></li>
<li><a>Static Library</a></li>
<li><a>Dynamic Library</a></li>
<li><a>Testing</a></li>
<li><a>Linking to System Libraries</a></li>
<li>Generating Files</li>
<li><a>Running System Tools</a></li>
<li><a>Running the Project’s Tools</a></li>
<li><a>Producing Assets for @embedFile</a></li>
<li><a>Generating Zig Source Code</a></li>
<li><a>Dealing With One or More Generated Files</a></li>
<li><a>Mutating Source Files in Place</a></li>
<li>Handy Examples</li>
<li><a>Build for multiple targets to make a release</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/184591186?v=4 | ava | charlottia/ava | 2024-07-22T17:20:01Z | Ava BASIC | main | 11 | 4 | 3 | 4 | https://api.github.com/repos/charlottia/ava/tags | 0BSD | [
"amaranth",
"basic",
"qbasic",
"zig"
] | 1,416 | false | 2025-03-30T00:52:51Z | false | false | unknown | github | [] | Ava BASIC
Note: probably done for now.
Wayfinding
<ul>
<li><a><code>basic/</code></a> — Compiler and stack machine interpreter.</li>
<li><a><code>core/</code></a> — RISC-V stack machine core.</li>
<li><a><code>soc/</code></a> — SoC in Amaranth integrating <a>VexRiscv</a>.</li>
<li><a><code>adc/</code></a> — Amateur Development Client (IDE) and TextMode Designer.</li>
</ul>
But what does it all mean?
<a>Put as succinctly as I can for now</a>.
License
Ava is released under the <a>zero-clause BSD license</a>. | [] |
https://avatars.githubusercontent.com/u/146390816?v=4 | picolibc-zig | allyourcodebase/picolibc-zig | 2024-03-06T16:49:02Z | picolibc - using build.zig | zig-pkg | 1 | 4 | 4 | 4 | https://api.github.com/repos/allyourcodebase/picolibc-zig/tags | GPL-2.0 | [
"embedded-c",
"libc",
"zig"
] | 121,656 | true | 2024-12-24T13:28:38Z | true | false | unknown | github | [] | Picolibc
Copyright © 2018-2023 Keith Packard
Picolibc is library offering standard C library APIs that targets
small embedded systems with limited RAM. Picolibc was formed by blending
code from <a>Newlib</a> and
<a>AVR Libc</a>.
Build status:
<ul>
<li></li>
<li></li>
<li></li>
</ul>
License
Picolibc source comes from a variety of places and has a huge variety
of copyright holders and license texts. While much of the code comes
from Newlib, none of the GPL-related bits used to build the library
are left in the repository, so all of the source code uses BSD-like
licenses, a mixture of 2- and 3- clause BSD itself and a variety of
other (mostly older) licenses with similar terms.
There are two files used for testing printf, test/printf-tests.c and
test/testcases.c which are licensed under the GPL version 2 or
later. There is also a shell script, GeneratePicolibcCrossFile.sh
which is licensed under the AGPL version 3 or later which is provided
as a helper for people building the library, but not used by picolibc
otherwise.
The file COPYING.picolibc contains all of the current copyright and
license information in the Debian standard machine-readable format. It
was generated using the make-copyrights and find-copyright
scripts.
Supported Architectures
Picolibc has integrated testing support for many architectures which
is used to validate the code for all patch integration:
<ul>
<li>ARC (32- and 64- bit)</li>
<li>ARM (32- and 64- bit)</li>
<li>i386 (Native and Linux hosted, for testing)</li>
<li>Motorola 68000 (m68k)</li>
<li>MIPS</li>
<li>MSP430</li>
<li>Nios II</li>
<li>Power9</li>
<li>RISC-V (both 32- and 64- bit)</li>
<li>SparcV8 (32 bit)</li>
<li>x86_64 (Native and Linux hosted, for testing)</li>
</ul>
There is also build infrastructure and continuous build validation,
but no integrated testing available for additional architectures:
<ul>
<li>Microblaze (32-bit, big and little endian)</li>
<li>PowerPC (big and little endian)</li>
<li>Sparc64</li>
<li>Xtensa (ESP8266, ESP32)</li>
</ul>
Supporting architectures that already have Newlib code requires:
<ol>
<li>
newlib/libc/machine/<em>architecture</em>/meson.build to build the
architecture-specific libc bits. This should at least include
setjmp/longjmp support as these cannot be performed in
architecture independent code and are needed by libstdc++.
</li>
<li>
Checking for atomic support for tinystdio. Tinystdio requires
atomics for ungetc to work correctly in a reentrant
environment. By default, it stores them in 16-bit values, but
some architectures only have 32-bit atomics. To avoid ABI
issues, the size selected isn't detected automatically, instead
it must be configured in newlib/libc/tinystdio/stdio.h.
</li>
<li>
newlib/libm/machine/<em>architecture</em>/meson.build to build any
architecture-specific libm bits
</li>
<li>
picocrt/machine/<em>architecture</em> source code and build bits
for startup code needed for the architecture. Useful in all
cases, but this is necessary to run tests under qemu if your
platform can do that.
</li>
<li>
cross-<em>gcc-triple</em>.txt to configure the meson cross-compilation
mechanism to use the right tools
</li>
<li>
do-<em>architecture</em>-configure to make testing the cross-compilation
setup easier.
</li>
<li>
newlib/libc/picolib support. This should include whatever startup
helpers are required (like ARM interrupt vector) and TLS support
(if your compiler includes this).
</li>
<li>
run-<em>architecture</em> script to run tests under QEMU. Look at the ARM
and RISC-V examples to get a sense of what this needs to do and
how it gets invoked from the cross-<em>gcc-triple</em>.txt configuration
file.
</li>
</ol>
Relation to newlib
Picolibc is mostly built from pieces of newlib, and retains the
directory structure of that project. While there have been a lot of
changes in the build system and per-thread data storage, the bulk of
the source code remains unchanged.
To keep picolibc and newlib code in sync, newlib changes will be
regularly incorporated. To ease integration of these changes into
picolibc, some care needs to be taken while editing the code:
<ul>
<li>Files should not be renamed.</li>
<li>Fixes that also benefit users of newlib should also be sent to the
newlib project</li>
<li>Changes, where possible, should be made in a way compatible with
newlib design. For example, instead of using 'errno' (which is
valid in picolibc), use __errno_r(r), even when 'r' is not defined
in the local context.</li>
</ul>
The bulk of newlib changes over the last several years have been in
areas unrelated to the code used by picolibc, so keeping things in
sync has not been difficult so far.
Documentation
Introductory documentation. Read these first:
<ul>
<li><a>Building Picolibc</a>. Explains how to compile picolibc yourself.</li>
<li><a>Using Picolibc</a>. Shows how to compile and link
applications once you have picolibc built and installed.</li>
<li><a>Linking with Picolibc.ld</a>. Provides more details
about the linking process.</li>
<li><a>Hello World</a>. Build and run a stand-alone C
application by following step-by-step instructions</li>
</ul>
Detailed documentation. Use these to learn more details about how to
use Picolibc:
<ul>
<li><a>Picolibc initialization</a></li>
<li><a>Operating System Support</a>.</li>
<li><a>Printf and Scanf in Picolibc</a></li>
<li><a>Thread Local Storage</a></li>
<li><a>Re-entrancy and Locking</a></li>
<li><a>Selecting ctype implementation</a></li>
<li><a>Picolibc as embedded source</a></li>
<li><a>Releasing Picolibc</a></li>
<li><a>Copyright and license information</a></li>
</ul>
Releases
Picolibc release 1.8.next
<ul>
<li>
Support ARM v8.1-m BTI and PAC features
</li>
<li>
Fix stdio buffered backend automatic flushing of stdout when
reading stdin.
</li>
<li>
Support _FORTIFY_SOURCE=3
</li>
<li>
Fix several fesetround implementations to return an error when
passed an invalid argument. Thanks to Abdallah Abdelhafeez.
</li>
<li>
Document headers which the compiler must provide. Thanks to Alexey
Brodkin.
</li>
<li>
Generate mktemp/tmpnam filenames using random() so they don't
repeat even if they aren't used before another name is generated.
</li>
<li>
Set error flag when fgetc is called on an file without read
mode. Thanks to Mohamed Moawad.
</li>
<li>
Add type casting to CMPLX, CMPLXF and CMPLXL macros (as glibc
does). Thanks to Mostafa Salman.
</li>
<li>
Add mips64 support and build the library during CI.
</li>
<li>
Make fgets return any accumulated string on EOF instead of
always returning NULL. Thanks to Hana Ashour.
</li>
<li>
Use C99 minimum array size in asctime_r and ctime_r API
declarations ('[static 26]'). Bounds check the generated value and
return NULL/EOVERFLOW on overflow.
</li>
<li>
Make Zephyr's -Oz cmake option enable
PREFER_SIZE_OVER_SPEED. Thanks to Jonathon Penix.
</li>
<li>
Add funopen to tinystdio.
</li>
<li>
Validate all public headers with a C++ compiler to make sure they
at least compile successfully. Fix time.h.
</li>
<li>
Stop using -include picolibc.h during library build.
</li>
<li>
Add -Wmissing-declarations and -Wmissing-prototypes to library
build flags. Fix a rather large pile of missing prototypes caused
by source files failing to add _GNU_SOURCE or _DEFAULT_SOURCE
definitions.
</li>
<li>
Add POSIX "unlocked" I/O functions to tinystdio. These don't
actually do anything because tinystdio doesn't do any
locking. However, flockfile/funlockfile grab the global C library
lock so applications synchronizing with that API will "work".
</li>
<li>
Fix wide orientation handling in tinystdio. Thanks to Ahmed Shehab.
</li>
<li>
Add aarch64 soft float support for armv8. Clang allows this with
-march=armv8-a+nofp -mabi=aapcs-soft. This required building a
custom toolchain that included a compiler-rt library built with the
right options.
</li>
<li>
Add fgetpos and fsetpos to tinystdio. Thanks to Hana Ashour.
</li>
<li>
Restore missing members of 'struct sigevent'. Over eager removal of
_POSIX_THREADS support caused these to be accidentally deleted some
time ago.
</li>
<li>
Test on i386 native target.
</li>
<li>
Fix hex float scanning and printing. Thanks to Hana Ashour and
Ahmed Shehab.
</li>
<li>
Fix double rounding in %f printf. Thanks to Ahmed Shehab for
constructing a test case that identified the issue.
</li>
<li>
Add mem_align to the "big" malloc version. Thanks to Simon Tatham.
</li>
<li>
Adjust POSIX and C headers to limit symbol exposure to that
specified in the standards.
</li>
<li>
Fix rounding in float scanf. This does round twice for input longer
than the required number of digits, but that's permitted by the C
specification.
</li>
<li>
Support %a/%A in scanf. Support arbitrary precision in %a/%A
printf. Fix NaN/INF formatting in %a/%A printf. Thanks to Ahmed
Shehab.
</li>
<li>
Provide a build-time option to enable %n in printf. This is
disabled by default for security concerns, but supported in case
someone needs strict C conformance. Thanks to Ahmed Shehab.
</li>
<li>
Make freopen clear the unget buffer. Thanks to Mostafa Salman.
</li>
<li>
Fix wide and multi-byte character support in printf and scanf. For
strict standards conformance, there's now an option that enables
%lc/%ls in printf even if multi-byte support is not enabled.
</li>
</ul>
Picolibc version 1.8.6
<ul>
<li>
Fix some FORTITY_SOURCE issues with tinystdio
</li>
<li>
Add __eh_* symbols to picolibc.ld for LLVM libunwind. Thanks Alex
Richardson.
</li>
<li>
Merge in newlib annual release (4.4.0). Some minor updates to
aarch64 assembly code formatting (thanks to Sebastian Huber) and a
few other fixes.
</li>
<li>
Enable 32-bit SPARC for testing.
</li>
<li>
Fix a bunch of fmemopen bugs and add some tests. Thanks to Alex
Richardson.
</li>
<li>
Finish support for targets with unusual float types, mapping
target types to 32-, 64-, 80- and 128- bit picolibc code.
</li>
<li>
Add SuperH support, including testing infrastructure. Thanks to
Adrian Siekierka for help with this.
</li>
<li>
Improve debugger stack trace in risc-v exception code. Thanks to
Alex Richardson.
</li>
<li>
Add an option (-Dfast-bufio=true) for more efficient fread/fwrite
implementations when layered atop bufio. Thanks for the suggestion
from Zachary Yedidia.
</li>
<li>
Fix cmake usage of FORMAT_ variables (note the lack of a leading
underscore).
</li>
<li>
Remove explicit _POSIX_C_SOURCE definition in zephyr/zephr.cmake.
</li>
<li>
Clean up public inline functions to share a common mechanism for
using gnu_inline semantics. Fix isblank. This ensures that no
static inline declarations exist in public API headers which are
required to be external linkage ("real") symbols.
</li>
<li>
Create an alternate ctype implementation that avoids using the
<em>ctype</em> array and just does direct value comparisons. This only
works when picolibc is limited to ASCII. Applications can select
whether they want this behavior at application compilation time
without needing to rebuild the C library. Thanks to P. Frost for
the suggestion.
</li>
<li>
Unify most fenv implementations to use gnu_inline instead of
regular functions to improve performance. x86 was left out because
those fenv functions are complicated by the mix of 8087 and modern
FPU support.
</li>
<li>
Add a separate FILE for stderr when using POSIX I/O. Split
stdin/stdout/stderr into three files to avoid pulling in
those which aren't used. Thanks to Zachary Yedidia.
</li>
</ul>
Picolibc version 1.8.5
<ul>
<li>
Detect clang multi-lib support correctly by passing compiler flags.
Thanks to xbjfk for identifying the problem.
</li>
<li>
Create a new 'long-long' printf variant. This provides enough
variety to satisfy the Zephyr cbprintf options without needing to
build the library from scratch.
</li>
<li>
Adjust use of custom binary to decimal conversion code so that it
is only enabled for types beyond the register size of the
target. This avoids the cost of this code when the application is
already likely to be using the soft division routines.
</li>
</ul>
Picolibc version 1.8.4
<ul>
<li>
Make math overflow and underflow handlers respect rounding modes.
</li>
<li>
Add full precision fma/fmaf fallbacks by adapting the long-double
code which uses two floats/doubles and some careful exponent
management to ensure that only a single rounding operation occurs.
</li>
<li>
Fix more m68k 80-bit float bugs
</li>
<li>
Fix m68k asm ABI by returning pointers in %a0 and %d0
</li>
<li>
Use an m68k-unknown-elf toolchain for m68k testing, including
multi-lib to check various FPU configurations on older and more
modern 68k targets.
</li>
<li>
Improve CI speed by using ccache on zephyr and mac tests,
compressing the docker images and automatically canceling jobs when
the related PR is updated. Thanks to Peter Jonsson.
</li>
<li>
Move a bunch of read-only data out of RAM and into flash by adding
'const' attributes in various places.
</li>
<li>
Add a new linker symbol, <code>__heap_size_min</code>, which specifies a
minimum heap size. The linker will emit an error if this much space
is not available between the end of static data and the stack.
</li>
<li>
Fix a bunch of bugs on targets with 16-bit int type. Thanks to
Peter Jonsson for many of these.
</li>
<li>
Work around a handful of platform bugs on MSP430. I think these are
compiler bugs as they occur using both the binutils simulator and
mspsim.
</li>
<li>
Run tests on MSP430 using the simulator that comes with gdb. Thanks to
Peter Jonsson for spliting tests apart to make them small enough to
link in under 1MB. This requires a patch adding primitive
semihosting to the simulator.
</li>
<li>
Provide a division-free binary to decimal conversion option for
printf at friends. This is useful on targets without hardware
divide as it avoids pulling in a (usually large) software
implementation. This is controlled with the 'printf-small-ultoa'
meson option and is 'false' by default.
</li>
<li>
Add 'minimal' printf and scanf variants. These reduce functionality
by removing code that acts on most data modifers including width
and precision fields and alternate presentation modes. A new config
variable, minimal-io-long-long, controls whether that code supports
long long types.
</li>
<li>
Add a 'assert-verbose' option which controls whether the assert
macro is chatty by default. It is 'true' by default, which
preserves the existing code, but when set to 'false', then a
failing assert calls __assert_no_msg with no arguments, saving the
memory usually occupied by the filename, function name and
expression.
</li>
<li>
Fix arm asm syntax for mrc/mcr instructions to make clang happy.
Thanks to Radovan Blažek for this patch.
</li>
</ul>
Picolibc version 1.8.3
<ul>
<li>
Fix bugs in floor and ceil implementations.
</li>
<li>
Use -fanalyzer to find and fix a range of issues.
</li>
<li>
Add __ubsan_handle_out_of_bounds implementation. This enables
building applications with -fsanitize=bounds and
-fno-sanitize-undefined-trap-on-error.
</li>
<li>
Validate exception configuration on targets with mixed exception
support where some types have exceptions and others don't. Right
now, that's only arm platforms where any soft float implementations
don't build with exception support.
</li>
<li>
Fix bugs in nexttowards/nextafter on clang caused by the compiler
re-ordering code and causing incorrect exception generation.
</li>
<li>
Use the small/slow string code when -fsanitize=address is used
while building the library. This avoids reading beyond the end of
strings and triggering faults.
</li>
<li>
Handle soft float on x86 and sparc targets. That mostly required
disabling the hardware exception API, along with a few other minor
bug fixes.
</li>
<li>
Add runtime support for arc, mips, nios2 and m68k. This enables CI
testing on these architectures using qemu.
</li>
<li>
Fix 80-bit floating math library support for m68k targets.
</li>
<li>
Fix arm testing infra to use various qemu models that expand
testing to all standard multi-lib configurations.
</li>
<li>
Adjust floating exception stubs to return success when appropriate,
instead of always returning ENOSYS.
</li>
<li>
Make sure sNaN raises FE_INVALID and is converted to qNaN in
truncl, frexpl and roundl
</li>
<li>
Avoid NaN result from fmal caused by multiply overflow when
addend is infinity (-inf + inf results in NaN in that case).
</li>
</ul>
Picolibc version 1.8.2
<ul>
<li>
Support <em>ZEPHYR_SOURCE macro which, like _POSIX_SOURCE et al,
controls whether the library expresses the Zephyr C library API.
This is also automatically selected when the __ZEPHYR__ macro is
defined and no other </em>*_SOURCE macro is defined.
</li>
<li>
Add another cross compile property, 'libgcc', which specifies the
library containing soft float and other compiler support routines.
</li>
<li>
Fix a couple of minor imprecisions in pow and 80-bit powl.
</li>
<li>
Merge newlib changes that included an update to the ARM assembly
code.
</li>
<li>
Replace inexact float/string conversion code with smaller code that
doesn't use floating point operations to save additional space on
soft float targets.
</li>
<li>
More cmake fixes, including making the inexact printf and locale
options work.
</li>
</ul>
Picolibc version 1.8.1
<ul>
<li>
Fix cmake build system to auto-detect compiler characteristics
instead of assuming the compiler is a recent version of GCC. This
allows building using cmake with clang.
</li>
<li>
Fix cmake build system to leave out TLS support when TLS is
disabled on the cmake command line.
</li>
<li>
Replace inline asm with attributes for __weak_reference macro
</li>
<li>
Add allocation attributes to malloc and stdio functions. This
allows the compiler to detect allocation related mistakes as well
as perform some additional optimizations. Bugs found by this change
were also addressed.
</li>
<li>
Add wchar_t support to tinystdio, eliminating the last missing
feature compared with the legacy stdio bits from newlib. With this,
libstdc++ can be built with wide char I/O support, eliminating the
last missing feature there as well.
</li>
<li>
Eliminate use of command line tools when building with a new enough
version of meson. Thanks to Michael Platings.
</li>
<li>
Add Microblaze support. Thanks to Alp Sayin.
</li>
<li>
Switch semihosting to use binary mode when opening files. Thanks to
Hardy Griech.
</li>
<li>
Build and install static library versions of the crt0 startup
code. These allows developers to reference them as libraries on the
command line instead of needing special compiler support to locate
the different variants, which is useful when using clang. Thanks to
Simon Tatham.
</li>
<li>
Simplify the signal/raise implementation to use a single global
array of signal handlers and to not use getpid and kill, instead
raise now directly invokes _exit. This makes using assert and abort
simpler and doesn't cause a large TLS block to be allocated. Thanks
to Joe Nelson for discovering the use of a TLS variable here.
</li>
</ul>
Picolibc version 1.8
With the addition of nearly complete long double support in the math
library, it seems like it's time to declare a larger version increment
than usual.
<ul>
<li>
Improve arc and xtensa support, adding TLS helpers and other build fixes
</li>
<li>
Fix FPSCR state for Arm8.1-M low overhead loops (thanks to David
Green)
</li>
<li>
Add -Werror=double-promotion to default error set and fix related
errors. (thanks to Ryan McClelland)
</li>
<li>
Fix locking bug in malloc out-of-memory path and freeing a locked
mutex in the tinystdio bufio code. These were found with lock
debugging code in Zephyr.
</li>
<li>
Add some missing functions in tinystdio, strto*l_l, remove,
tmpname/tmpfile which were published in stdio.h but not included in
the library.
</li>
<li>
Switch read/write functions to use POSIX types instead of legacy
cygwin types. This makes mapping to existing an POSIX api work
right.
</li>
<li>
Add %b support to tinystdio printf and scanf. These are disabled by
default as they aren't yet standardized.
</li>
<li>
Fix avr math function support. The avr version of gcc has modes
where double and long double are 32 or 64 bits, so the math library
code now detects all of that at compile time rather than build time
and reconfigures the functions to match the compiler types.
</li>
<li>
Add nearly complete long double support from openlibm for 80-bit
Intel and 128-bit IEEE values (in addition to supporting 64-bit
long doubles). Still missing are Bessel functions and decimal
printf/scanf support.
</li>
<li>
Add limited long double support for IBM 'double double' form. This
is enough to run some simple tests, but doesn't have any
significant math functions yet.
</li>
<li>
Get Power9 code running under qemu with OPAL. This was mostly
needed to validate the big-endian and exception code for 128-bit
long doubles, but was also used to validate the double double
support.
</li>
<li>
Provide times() and sysconf() implementations in semihosting. You
can now build and run the dhrystone benchmark without any further
code.
</li>
<li>
Fix use of TLS variables with stricter alignment requirements in
the default linker script and startup code. (thanks to Joakim
Nohlgård and Alexander Richardson who found this issue while
working on lld support).
</li>
</ul>
Picolibc version 1.7.9
<ul>
<li>
Support all Zephyr SDK targets
</li>
<li>
Support relocating the toolchain by using GCC_EXEC_PREFIX for
sysroot-install when compiler doesn't use sysroot.
</li>
<li>
Add MIPS, SPARC and ARC support
</li>
<li>
Deal with RISC-V changes in gcc that don't reliably include zicsr
</li>
<li>
Support Picolibc as default C library with -Dsystem-libc option.
With this, you can use picolibc without any extra compiler options.
</li>
<li>
Merge current newlib bits to get code that doesn't use struct _reent
</li>
<li>
Get rid of struct _reent in legacy stdio code
</li>
<li>
Support 16-bit int targets by fixing a few places assuming
sizeof(int) == 4, object sizes not using size_t, wint_t for
ucs-4 values
</li>
<li>
Add MSP430 support
</li>
<li>
Fix a couple of clang bugs (one on Cortex M0)
</li>
<li>
Support libc++ by adding non-standard mbstate_t.h
</li>
<li>
Merge i686 and x86_64 code to allow x86 multilib builds
</li>
<li>
Merge Xtensa newlib bits
</li>
<li>
Support Xtensa ESP32 targets
</li>
<li>
Add Nios II support
</li>
</ul>
Picolibc version 1.7.8
<ol>
<li>
Fix el/ix level 4 code type errors
</li>
<li>
Fix out-of-source CMake build (thanks Max Behensky)
</li>
<li>
Improve build.md docs (thanks Kalle Raiskila)
</li>
<li>
Fix cmake build for various architectures
</li>
<li>
Initialize lock in fdopen
</li>
<li>
Remove %M from linker paths in single-arch builds
</li>
<li>
Shrink tinystdio vfprintf and vfscanf a bit
</li>
<li>
Use -fno-builtin-malloc -fno-builtin-free (GCC 12 compat)
</li>
<li>
Use -fno-builtin-copysignl (GCC 12 compat)
</li>
<li>
Add _zicsr to -march for risc-v picocrt (binutils 2.38 compat)
</li>
<li>
Add -no-warn-rwx-segments to link spec (binutils 2.38 compat)
</li>
</ol>
Picolibc version 1.7.7
<ol>
<li>
Fix semihost gettimeofday, add a test.
</li>
<li>
Fix config option documentation. (Thanks to rdiez)
</li>
<li>
Document how re-entrant locking APIs are used. (Thanks to rdiez)
</li>
<li>
Fix some 16-bit int issues in tinystdio. (Thanks to Ayke van
Laethem)
</li>
<li>
Make header files a bit more POSIX compliant, installing rpc
headers, moving byte swapping macros to arpa/inet.h
</li>
<li>
Fix some stdio bugs found by Zephyr test suite: snprintf return
value on buffer overflow, add ftello/fseeko, fputc return value,
%0a formatting, clear EOF status after ungetc/fseek.
</li>
<li>
Re-do buffered I/O support to handle mixed read/write files
correctly. This adds setbuf, setbuffer, setlinebuf, setvbuf.
</li>
<li>
Add fmemopen and freopen.
</li>
<li>
Add enough cmake support to allow Zephyr to build picolibc as a
module using that, rather than meson.
</li>
<li>
Merge current newlib bits
</li>
<li>
Fix %p printf/scanf on ILP64 targets.
</li>
</ol>
Picolibc version 1.7.6
<ol>
<li>
Fix use with C++ applications caused by a syntax error in
picolibc.specs
</li>
<li>
Automatically include '-nostdlib' to options used while
evaluating build rules to ensure tests work as expected.
</li>
<li>
Publish aarch64 inline math functions, ensure that inline fma
functions work in installed applications for arm and risc-v.
</li>
</ol>
Picolibc version 1.7.5
<ol>
<li>
Fix build on big-endian systems (thanks to Thomas Daede)
</li>
<li>
Add m68k support (thanks to Thomas Daede).
</li>
<li>
Fix build issues with ARM Cortex-a9 target (thanks to Ilia
Sergachev).
</li>
<li>
Fix fwrite(x,0,y,z) in both tinystdio and legacy stdio. tinystdio
returned the wrong value and legacy stdio caused a divide-by-zero
fault.
</li>
<li>
Update Ryu code to match upstream (minor fixes)
</li>
<li>
Fix various __NEWLIB and __PICOLIBC macros; they were using a
single leading underscore instead of two (thanks to Vincent
Palatin).
</li>
<li>
Fix tinystdio error-handling bugs
</li>
<li>
Merge recent newlib changes (fixed ltdoa in legacy stdio)
</li>
<li>
Speed improvements for github CI system
</li>
<li>
Big-endian PowerPC support
</li>
<li>
Fail builds if most 'run_command' uses fail (thanks to Johan de
Claville Christiansen)
</li>
<li>
Positional parameters in tinystdio. With this, I think tinystdio
is feature complete.
</li>
<li>
Support for multiple build-styles of picolibc (minsize/release)
in one binary package. This still requires separate meson runs.
</li>
<li>
Testing with glibc test code. This uncovered numerous bugs,
mostly math errno/exception mistakes, but also a few serious
bugs, including a couple of places where the nano-malloc failed
to check for out-of-memory. Picolibc now passes all of the glibc
math tests except for jn, yn, lgamma and tgamma. The picolibc
versions of those functions are too inaccurate. Picolibc also
passes most other relevant glibc tests, including stdio,
string and stdlib areas.
</li>
<li>
Tinystdio version of fcvt now has a static buffer large enough to
hold the maximum return size.
</li>
<li>
Tinystdio versions of ecvtbuf and fcvtbuf have been replaced
with ecvt_r and fcvt_r equivalents, which take a 'len' parameter
to prevent buffer overruns.
</li>
<li>
Add the GeneratePicolibcCrossFile.sh script which provides a way
to isolate picolibc build scripts from the vagaries of meson
version shifts (thanks to R. Diez).
</li>
<li>
Add 'semihost' version of crt0 that calls 'exit' after main
returns. The ARM and RISC-V versions of this also include trap
handlers for exceptions that print out information and exit when
an exception occurs.
</li>
</ol>
Picolibc version 1.7.4
<ol>
<li>
Clean up meson build bits, including use of 'fs module (thanks to
Yasushi Shoji).
</li>
<li>
Speed up github actions by sharing Debian docker image (thanks to
Yasushi Shoji).
</li>
<li>
Reduce use of intermediate static libraries during build
</li>
<li>
Use standard Meson architecture names everywhere (thanks to
Yasushi Shoji).
</li>
<li>
Support building with -D_FORTIFY_SOURCE enabled.
</li>
<li>
Clean up 32-bit arm assembly code, eliminating __aeabi wrappers
where possible.
</li>
<li>
Add basename, dirname and fnmatch back.
</li>
<li>
Fix all old-style (K&R) function definitions.
</li>
<li>
Enable lots more compiler warning flags.
</li>
<li>
Remove last uses of alloca in legacy stdio code.
</li>
<li>
Add tests from musl libc-testsuite. There aren't many tests, but
these identified a few bugs.
</li>
<li>
Add lots more exception and errno tests for the math functions.
</li>
<li>
Restructure math library to always use the <code>__math_err</code> functions
to raise exceptions and set errno. This removes the w_*.c wrapper
functions and eliminates the <code>__ieee names</code>. This centralizes
compiler work-arounds to ensure run-time evaluation of
expressions intended to raise exceptions. In the process, all of
the libm/math files were reformatted with clang-format.
</li>
<li>
Make tinystdio '%a' compatible with glibc, including supporting
rounding and trimming trailing zeros when possible.
</li>
<li>
Remove floating point exception generation code on targets
without floating point exception support. This reduces code size
on soft float machines without affecting results.
</li>
</ol>
Picolibc version 1.7.3
<ol>
<li>
Add -Wall -Wextra to default builds. Fixed warnings this raised.
</li>
<li>
Add htonl and friends (based on __htonl). Thanks to Johan de
Claville Christiansen
</li>
<li>
Set errno in scalbn and scalbnf (patch forwarded to newlib).
</li>
<li>
Merge newlib recent changes which includes a couple of libm fixes.
</li>
</ol>
Picolibc version 1.7.2
<ol>
<li>
Fix picolibc.ld to split C++ exceptions back apart (thanks to
Khalil Estell)
</li>
<li>
Add vsscanf to tinystdio (required for libstdc++).
</li>
<li>
Also stick -isystem in C++ compile command to try and get
picolibc headers to be used instead of newlib.
</li>
</ol>
Picolibc version 1.7.1
<ol>
<li>
Add __cxa_atexit implementation to 'picoexit' path as required by
C++
</li>
<li>
Fix lack of 'hh' support in integer-only tinystdio printf path.
</li>
<li>
Fix tinystdio __file flag initialization for C++ apps
</li>
</ol>
Picolibc version 1.7
<ol>
<li>
Merge libc and libm into a single library. Having them split
doesn't offer any advantages while requiring that applications add
'-lm' to link successfully. Having them merged allows use of libm
calls from libc code.
</li>
<li>
Add hex float format to <em>printf, </em>scanf and strto{d,f,ld}. This is
required for C99 support.
</li>
<li>
Unify strto{d,f,ld} and *scanf floating point parsing code. This
ensures that the library is consistent in how floats are parsed.
</li>
<li>
Make strto{d,f,ld} set errno to ERANGE on overflow/underflow,
including when the result is a subnormal number.
</li>
</ol>
Picolibc version 1.6.2
<ol>
<li>
Change <code>restrict</code> keyword in published headers to <code>__restrict</code> to
restore compatibility with applications building with --std=c18.
</li>
<li>
Additional cleanups in time conversion funcs (Thanks to R. Riez)
</li>
</ol>
Picolibc version 1.6.1
<ol>
<li>
Code cleanups for time conversion funcs (Thanks to R. Diez)
</li>
<li>
Add '-fno-stack-protector' when supported by the C compiler
to avoid trouble building with native Ubuntu GCC.
</li>
<li>
Bug fix for converting denorms with sscanf and strto{d,f,ld}.
</li>
<li>
Use <strong>asm</strong> for inline asm code to allow building applications
with --std=c18
</li>
<li>
Fix exit code for semihosting 'abort' call to make it visible
to the hosting system.
</li>
<li>
Add strfromf and strfromd implementations. These are simple
wrappers around sscanf, but strfromf handles float conversions
without requiring a pass through 'double' or special linker hacks.
</li>
</ol>
Picolibc version 1.6
<ol>
<li>
Bugfix for snprintf(buf, 0) and vsnprintf(buf, 0) to avoid
smashing memory
</li>
<li>
Support building libstdc++ on top of picolibc
</li>
<li>
Add 'hosted' crt0 variant that calls exit when main
returns. This makes testing easier without burdening embedded apps
with unused exit processing code.
</li>
<li>
Add 'minimal' crt0 variant that skips constructors to
save space on systems known to not use any.
</li>
<li>
Fix HW floating point initialization on 32-bit ARM processors to
perform 'dsb' and 'isb' instructions to ensure the FPU enabling
write is complete before executing any FPU instructions.
</li>
<li>
Create a new '--picolibc-prefix' GCC command line parameter that
sets the base of all picolibc file names.
</li>
<li>
Add bare-metal i386 and x86_64 initializatiton code (thanks to
Mike Haertel). These initalize the processor from power up to
running code without requiring any BIOS.
</li>
<li>
Merge newlib as of late April, 2021
</li>
<li>
Add 'timegm' function (thanks to R. Diez).
</li>
<li>
Fix a number of tinystdio bugs: handle fread with size==0, parse
'NAN' and 'INF' in fscanf in a case-insensitive manner, fix
negative precision to '*' arguments in printf, fix handling of
'j', 'z' and 't' argument size specifiers (thanks to Sebastian
Meyer).
</li>
<li>
Make the fenv API more consistent and more conformant with the
spec. All architectures now fall back to the default code
for soft float versions, which avoids having the various exception
and rounding modes get defined when not supported.
</li>
</ol>
Picolibc version 1.5.1
<ol>
<li>Make riscv crt0 '_exit' symbol 'weak' to allow linking without
this function.</li>
</ol>
Picolibc version 1.5
<ol>
<li>
Make picolibc more compatible with C++ compilers.
</li>
<li>
Add GCC specs file and linker script for building C++ applications
with G++ that enable exception handling by linking in call stack
information.
</li>
<li>
A few clang build fixes, including libm exception generation
</li>
<li>
Nano malloc fixes, especially for 'unusual' arguments
</li>
<li>
Merge in newlib 4.1.0 code
</li>
<li>
More libm exception/errno/infinity fixes, mostly in the gamma funcs.
</li>
<li>
Add tests for all semihost v2.0 functions.
</li>
<li>
A few RISC-V assembly fixes and new libm code.
</li>
<li>
Build fixes to reliably replace generic code with
architecture-specific implementations.
</li>
</ol>
With a patch which is pending for GCC 11, we'll be able to build C++
applications that use picolibc with exceptions and iostream.
Picolibc version 1.4.7
<ol>
<li>
Fix numerous libm exception and errno bugs. The math functions are
all now verified to match the C19 and Posix standards in this
area.
</li>
<li>
Change behavior of 'gamma' function to match glibc which returns
lgamma for this function. Applications should not use this
function, they should pick either lgamma or tgamma as appropriate.
</li>
<li>
Fix fma/fmaf on arm and RISC-V so that the machine-specific versions
are used when the hardware has support. Also fix the math library
to only use fma/fmaf when it is supported by the hardware.
</li>
<li>
Fix numerous nano-malloc bugs, especially with unusual parameters.
</li>
<li>
Change nano-malloc to always clear returned memory.
</li>
<li>
Improve nano-realloc to perform better in various ways, including
merging adjacent free blocks and expanding the heap.
</li>
<li>
Add malloc tests, both a basic functional test and a stress test.
</li>
<li>
Improve build portability to Windows. Picolibc should now build
using mingw.
</li>
<li>
Use hardware TLS register on ARM when available.
</li>
<li>
Support clang compiler. Thanks to Denis Feklushkin
<a>denis.feklushkin@gmail.com</a> and Joakim Nohlgård <a>joakim@nohlgard.se</a>.
</li>
<li>
Avoid implicit float/double conversions. Check this by having
clang builds use -Wdouble-promotion -Werror=double-promotion
flags
</li>
<li>
Have portable code check for machine-specific overrides by
matching filenames. This avoids building libraries with
duplicate symbols and retains compatibility with newlib (which
uses a different mechanism for this effect).
</li>
<li>
Patches to support building with <a>CompCert</a>, a
formally verified compiler. Thanks to Sebastian Meyer
<a>meyer@absint.com</a>.
</li>
</ol>
Picolibc version 1.4.6
<ol>
<li>
Install 'ssp' (stack smashing protection) header files. This fixes
compiling with -D_FORTIFY_SOURCE.
</li>
<li>
Make getc/ungetc re-entrant. This feature, which is enabled by
default, uses atomic instruction sequences that do not require
OS support.
</li>
<li>
Numerous iconv fixes, including enabling testing and switching
external CCS file loading to use stdio. By default, iconv provides
built-in CCS data for all of the supported encodings, which takes
a fairly large amount of read-only memory. Iconv is now always
included in picolibc as it isn't included in applications unless
explicitly referenced by them.
</li>
<li>
Add __getauxval stub implementation to make picolibc work with
GCC version 10 compiled for aarch64-linux-gnu.
</li>
<li>
Change how integer- and float- only versions of printf and scanf
are selected. Instead of re-defining the symbols using the C
preprocessor, picolibc now re-defines the symbols at link
time. This avoids having applications compiled with a mixture of
modes link in multiple versions of the underlying functions, while
still preserving the smallest possible integer-only
implementation.
</li>
<li>
Document how to use picolibc on a native POSIX system for
testing. Check out the <a>os.md</a> file for details.
</li>
<li>
Merge current newlib bits in. This includes better fenv support,
for which tests are now included in the picolibc test suite.
</li>
</ol>
Picolibc version 1.4.5
<ol>
<li>
Fix section order in picolibc.ld to give applications correct
control over the layout of .preserve, .init and .fini regions.
</li>
<li>
Add startup and TLS support for aarch64 and non Cortex-M 32-bit
arm.
</li>
</ol>
Picolibc version 1.4.4
<ol>
<li>
Fix floating point 'g' format output in tinystdio. (e.g.,
for 10.0, print '10' instead of '1e+01'). There are tests which
verify a range of 'g' cases like these now.
</li>
<li>
Merge current newlib bits. The only thing which affects picolibc
is the addition of fenv support for arm.
</li>
</ol>
Picolibc version 1.4.3
<ol>
<li>
Make fix for CVE 2019-14871 - CVE 2019-14878 in original newlib
stdio code not call 'abort'. Allocation failures are now reported
back to the application.
</li>
<li>
Add 'exact' floating point print/scan code to tinystdio. Thanks
to Sreepathi Pai for pointing me at the Ryu code by Ulf
Adams.
</li>
<li>
Add regular expression functions from newlib. These were removed
by accident while removing POSIX filesystem-specific code.
</li>
<li>
Make tinystdio versions of [efg]cvt functions. This means that the
default tinystdio version of picolibc no longer calls malloc from
these functions.
</li>
<li>
More clang-compatibility fixes. (Thanks to Denis Feklushkin)
</li>
<li>
Remove stdatomic.h and tgmath.h. (they should not be provide by picolibc)
</li>
</ol>
Picolibc version 1.4.2
<ol>
<li>
Clang source compatibility. Clang should now be able to compile
the library. Thanks to Denis Feklushkin for figuring out how
to make this work.
</li>
<li>
aarch64 support. This enables the existing aarch64 code and
provides an example configuration file for getting it
built. Thanks for Anthony Anderson for this feature.
</li>
<li>
Testing on github on push and pull-request. For now, this is
limited to building the library due to a bug in qemu.
</li>
<li>
Get newlib stdio working again. You can now usefully use Newlib's
stdio. This requires a working malloc and is substantially larger
than tinystdio, but has more accurate floating point input. This
requires POSIX functions including read, write and a few others.
</li>
<li>
Fix long double strtold. The working version is only available
when using tinystdio; if using newlib stdio, strtold is simply not
available.
</li>
<li>
Improve tinystdio support for C99 printf/scanf additions.
</li>
<li>
Check for correct prefix when sysroot-install option is
selected. The value of this option depends on how gcc was
configured, and (alas) meson won't let us set it at runtime, so
instead we complain if the wrong value was given and display the
correct value.
</li>
<li>
Sync up with current newlib head.
</li>
</ol>
Picolibc version 1.4.1
This release contains an important TLS fix for ARM along with a few
minor compatibility fixes
<ol>
<li>
Make __aeabi_read_tp respect ARM ABI register requirements to
avoid clobbering register contents during TLS variable use.
</li>
<li>
Use cpu_family instead of cpu in meson config, which is 'more
correct' when building for a single cpu instead of multilib.
</li>
<li>
Make arm sample interrupt vector work with clang
</li>
<li>
Use __inline instead of inline in published headers to allow
compiling with -ansi
</li>
<li>
Make 'naked' RISC-V _start function contain only asm
statements as required by clang (and recommended by gcc).
</li>
<li>
Use -msave-restore in sample RISC-V cross-compile
configuration. This saves text space.
</li>
</ol>
Picolibc version 1.4
This release was focused on cleaning up the copyright and license
information.
<ol>
<li>
Copyright information should now be present in every source file.
</li>
<li>
License information, where it could be inferred from the
repository, was added to many files.
</li>
<li>
4-clause BSD licenses were changed (with permission) to 3-clause
</li>
<li>
Fix RISC-V ieeefp.h exception bits
</li>
<li>
Merge past newlib 3.2.0
</li>
<li>
Add PICOLIBC_TLS preprocessor define when the library has TLS support
</li>
</ol>
Picolibc version 1.3
This release now includes tests, and fixes bugs found by them.
<ol>
<li>
ESP8266 support added, thanks to Jonathan McDowell.
</li>
<li>
Numerous test cases from newlib have been fixed, and
precision requirements adjusted so that the library now
passes its own test suite on x86, RISC-V and ARM.
</li>
<li>
String/number conversion bug fixes. This includes fcvt/ecvt/gcvt
shared with newlib and tinystdio printf/scanf
</li>
<li>
A few RISC-V ABI fixes, including setting the TLS base correctly,
compiling with -mcmodel=medany, and enabling the FPU for libraries
built to use it.
</li>
<li>
Semihosting updates, including adding unlink, kill and getpid
(which are used by some tests).
</li>
</ol>
Picolibc version 1.2
This release includes important fixes in picolibc.ld and more
semihosting support.
<ol>
<li>
File I/O and clock support for semihosting. This enables fopen/fdopen
support in tinystdio along with an API to fetch a real time clock
value.
</li>
<li>
Fix picolibc.ld to not attempt to use redefined symbols for memory
space definitions. These re-definitions would fail and the default
values be used for system memory definitions. Instead, just use
the ? : operators each place the values are needed. Linker scripts
continue to mystify.
</li>
<li>
Expose library definitions in 'picolibc.h', instead of 'newlib.h'
and '_newlib_version.h'
</li>
<li>
Define HAVE_SEMIHOST when semihosting support is available. This
lets the 'hello-world' example do some semihost specific things.
</li>
</ol>
Picolibc version 1.1
A minor update from 1.0, this release includes:
<ol>
<li>
semihost support. This adds console I/O and exit(3) support on ARM
and RISC-V hosts using the standard semihosting interfaces.
</li>
<li>
Posix I/O support in tinystdio. When -Dposix-io=true is included
in the meson command line (which is the default), tinystdio adds
support for fopen and fdopen by using malloc, open, close, read,
write and lseek. If -Dposix-console=true is also passed to meson,
then picolibc will direct stdin/stdout/stderr to the posix
standard file descriptors (0, 1, 2).
</li>
<li>
Merge recent upstream newlib code. This brings picolibc up to date
with current newlib sources.
</li>
<li>
Hello world example. This uses a simple Makefile to demonstrate
how to us picolibc when installed for ARM and RISC-V embedded
processors. The resulting executables can be run under qemu.
</li>
<li>
Remove newlib/libm/mathfp directory. This experimental code never
worked correctly anyways.
</li>
</ol>
Picolibc version 1.0
This is the first release of picolibc. Major changes from newlib
include:
<ol>
<li>
Remove all non-BSD licensed code. None of it was used in building
the embedded library, and removing it greatly simplifies the
license situation.
</li>
<li>
Move thread-local values to native TLS mechanism
</li>
<li>
Add smaller stdio from avr-libc, which is enabled by default
</li>
<li>
Switch build system to meson. This has two notable benefits; the first
is that building the library is much faster, the second is that
it isolates build system changes from newlib making merging of
newlib changes much easier.
</li>
<li>
Add simple startup code. This can be used in environments that
don't have complicated requirements, allowing small applications
to avoid needing to figure this out.
</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/16764864?v=4 | zigdeck | andy5995/zigdeck | 2024-03-11T08:10:46Z | A library that creates and shuffles a deck of cards from which you can draw | trunk | 0 | 4 | 0 | 4 | https://api.github.com/repos/andy5995/zigdeck/tags | MIT | [
"cards",
"library",
"mit-license",
"simulation",
"zig",
"zig-library",
"zig-package"
] | 27 | false | 2025-03-18T11:36:40Z | true | true | unknown | github | [] | <a></a>
zigdeck
A library that creates and shuffles a deck of cards from which you can draw
Tested with the the development version of <a>zig</a> (may
not build with the last release).
Example
```zig
// initialize the deck. This must be done before shuffle.
var deck = Deck.init();
<code>try std.testing.expectEqual(Suit.Clubs, deck.cards[0].suit);
try std.testing.expectEqual(Face.Ace, deck.cards[0].face);
try std.testing.expectEqual(Suit.Spades, deck.cards[48].suit);
try std.testing.expectEqual(Face.King, deck.cards[51].face);
// Seed the random number generator
var rng = std.rand.DefaultPrng.init(@as(u64, @intCast(std.time.milliTimestamp())));
// Shuffle
Deck.shuffle(&deck, &rng.random());
// Draw one card
const card = Deck.getTopCard(&deck) orelse return;
try std.testing.expectEqual(Suit.Clubs, card.suit);
try std.testing.expectEqual(Face.Queen, card.face);
std.debug.print("Top card: Suit = {}, Value = {}\n", .{ card.suit, card.face });
</code>
```
This library is used by <a>zigpokerhands</a>. | [
"https://github.com/andy5995/zigpokerhands"
] |
https://avatars.githubusercontent.com/u/910428?v=4 | Closure.zig | zhuyadong/Closure.zig | 2024-05-31T03:39:30Z | closure for zig. | main | 1 | 4 | 0 | 4 | https://api.github.com/repos/zhuyadong/Closure.zig/tags | MIT | [
"closure",
"zig",
"zig-package"
] | 21 | false | 2025-03-08T11:04:36Z | true | true | 0.11.0 | github | [] | Closure.zig
Now we can use closure in zig ;)
Example: up value support
```zig
const t = std.testing;
var a: i32 = 0;
// test upvalue.
// .{ &a, 1 } for: &a => p, 1 => v
var clo = Closure.init(t.allocator, struct {
pub fn func(p: <em>i32, v: i32) void {
p.</em> = v;
}
}, .{ &a, 1 });
clo.call(.{});
clo.deinit();
try t.expect(a == 1);
```
Example: up value + call argument
```zig
const t = std.testing;
<code>var a: i32 = 0;
var b: i64 = 0;
// note:arg must be the first parameter and the type must be std.meta.Tuple.
// parameter[1..] for upvalue (5 => va, 6 => vb).
clo = Closure.init(t.allocator, struct {
pub fn func(arg: std.meta.Tuple(&.{ *i32, *i64 }), va: i32, vb: i64) void {
arg[0].* = va;
arg[1].* = vb;
}
}, .{ 5, 6 });
clo.call(.{ &a, &b });
clo.deinit();
try t.expect(a == 5 and b == 6);
</code>
```
Example: up value on stack
<code>zig
//test upvalue on stack with call arg
//Note: don't need to call clo.deinit() here, but it's safe to call and it's just do nothing.
clo = Closure.make(struct {
pub fn func(arg: std.meta.Tuple(&.{ *i32, *i64 }), va: i32, vb: i64) void {
const pa, const pb = arg;
pa.* = va;
pb.* = vb;
}
}, &std.meta.Tuple(&.{ i32, i64 }){ 9, 10 });
clo.call(.{ &a, &b });
try t.expect(a == 9 and b == 10);</code>
Example: use invoke for return bool
```zig
a = 0;
clo = Closure.make(struct {
pub fn func(arg: Tuple(&.{<em>i32})) bool {
arg[0].</em> = 11;
return false;
}
}, &.{});
try t.expect(clo.invoke(.{&a}) == false);
try t.expect(a == 11);
<code>clo = Closure.make(struct {
pub fn func(arg: Tuple(&.{*i32})) void {
arg[0].* = 11;
}
}, &.{});
// invoke on void return function always return true
try t.expect(clo.invoke(.{&a}) == true);
try t.expect(a == 11);
</code>
```
Example: Make the parameters of the closure clearly readable
<code>zig
const Data = struct {
clo: Closure.Of(.{.arg32 = i32, .arg64 = i64, .ret = *i64}),
};
try std.testing.expect(@TypeOf(Data.clo) == Closure);</code>
More examples in source code: <a>here</a> | [] |
https://avatars.githubusercontent.com/u/14016168?v=4 | zik | silversquirl/zik | 2024-03-25T04:56:45Z | Source-level static instrumentation framework for Zig | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/silversquirl/zik/tags | MIT | [
"instrumentation",
"profiler",
"tracing",
"zig"
] | 15 | false | 2024-05-29T09:04:49Z | true | true | unknown | github | [] | Zig Instrumentation Kit
A slightly cursed library for source-level static instrumentation in Zig.
This repository also includes a simple function-level profiler that outputs to the <a>callgrind format</a>, which is readable by <a>KCacheGrind</a>.
Using the profiler
<strong>NOTE: This is currently proof-of-concept quality. Notably, multithreaded programs will not work at all</strong>
Build the profiler using <code>zig build zikprof</code>, then run the binary from <code>zig-out/bin/zikprof</code> with the same args you'd normally pass to <code>zig</code>. (TODO: this does not currently work with <code>zig build</code>. Stick to <code>zig build-exe</code>, <code>zig run</code>, etc)
This will copy your entire source tree, rooted at <code>build.zig</code>, into <code>zig-cache/tmp/zik/src</code>, instrument it, then run the Zig command as normal. (TODO: this should be more transparent to the user. Build output and program output should be placed in the locations one would expect from running Zig normally)
Here is an example usage:
<code>zig build zikprof
cd example
../zig-out/bin/zikprof run main.zig</code>
You can then open <code>example/zig-cache/tmp/zik/src/callgrind.out.zikprof.<PID></code> in KCacheGrind to inspect the call graph. | [] |
https://avatars.githubusercontent.com/u/14016168?v=4 | zig-ink | silversquirl/zig-ink | 2024-03-07T18:18:07Z | Ink narrative scripting runtime for Zig | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/silversquirl/zig-ink/tags | MIT | [
"ink",
"inkle",
"inky",
"narrative",
"zig"
] | 19 | false | 2024-12-10T05:44:20Z | true | true | unknown | github | [] | Zig Ink
A runtime for the <a>Ink narrative scripting language</a>, written in Zig.
Status
| [] |
https://avatars.githubusercontent.com/u/57322933?v=4 | zig-opengl-example | griush/zig-opengl-example | 2024-08-02T22:20:17Z | Minimal example using GFLW/OpenGL/zm made in Zig | master | 0 | 4 | 0 | 4 | https://api.github.com/repos/griush/zig-opengl-example/tags | Unlicense | [
"glfw",
"opengl",
"zig",
"zig-package"
] | 11 | false | 2025-04-26T10:27:48Z | true | true | 0.14.0-dev | github | [
{
"commit": "cb45317e26100aee505413be717da617f067911e",
"name": "zm",
"tar_url": "https://github.com/griush/zm/archive/cb45317e26100aee505413be717da617f067911e.tar.gz",
"type": "remote",
"url": "https://github.com/griush/zm"
},
{
"commit": "4086ec77f2180e285a260412fb4f10605dbb1625",
... | Triangle example
Simple OpenGL example in Zig using <code>zm</code>, <code>zig-glfw</code>, <code>zigglgen</code>.
Usage
Run in the root <code>zig build run</code>. | [] |
https://avatars.githubusercontent.com/u/6693837?v=4 | cspvm | thi-ng/cspvm | 2024-04-24T11:22:31Z | Experimental, polyglot, work-in-progress stack VM implementations around native cooperative multitasking and CSP channels to communicate and synchronize between tasks. | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/thi-ng/cspvm/tags | Apache-2.0 | [
"communicating-sequential-processes",
"cooperative-multitasking",
"csp",
"typescript",
"virtual-machine",
"vm",
"wasm",
"zig"
] | 315 | false | 2025-05-15T13:37:48Z | true | true | unknown | github | [] | @thi.ng/cspvm
Experimental, polyglot, work-in-progeess stack VM implementations around native
<a>cooperative
multitasking</a> and <a>CSP
channels</a> to
communicate and syncrhonize between tasks.
<a>Op code table</a>
Multiple (very incomplete) versions/experiments are in:
Zig
<a>Source</a> - most recent developments...
```bash
currently requires Zig v0.12.x
run tests/example
zig build test
[default] (info): task size 240
[default] (info): tasklist: dual-list.FixedBufferDualList(14,u8){ .active = 0, .available = 1, .slots = { 255, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 255 } }
[default] (debug): task: 0
[default] (debug): ip: 1000 op: vm.Op.push16 ds: { } rs: { }
[default] (debug): ip: 1003 op: vm.Op.call ds: { 16, 32 } rs: { }
[default] (debug): ip: 1009 op: vm.Op.push ds: { 16, 32 } rs: { 6, 16 }
[default] (debug): ip: 100b op: vm.Op.jump ds: { 16, 32, 48 } rs: { 6, 16 }
[default] (debug): ip: 1010 op: vm.Op.push ds: { 16, 32, 48 } rs: { 6, 16 }
[default] (debug): ip: 1012 op: vm.Op.trap ds: { 16, 32, 48, 64 } rs: { 6, 16 }
[default] (info): trap task 16 #85
[default] (debug): ip: 1014 op: vm.Op.add16 ds: { 16, 32, 48, 64 } rs: { 6, 16 }
[default] (debug): ip: 1015 op: vm.Op.ret ds: { 64, 96 } rs: { 6, 16 }
[default] (debug): ip: 1006 op: vm.Op.push ds: { 64, 96 } rs: { }
[default] (debug): ip: 1008 op: vm.Op.halt ds: { 64, 96, 80 } rs: { }
[default] (debug): task 0 halted
[default] (info): ds: { 64, 96, 80 } rs: { }
build optimized WASM binary & WAT disassembly
scripts/build-zig.sh
```
WebAssembly
<a>Source</a> - VM implementation in handwritten WASM
<code>bash
scripts/build-wasm.sh</code>
TypeScript
<a>Source</a> - Initial implementation & tests
```bash
yarn install
yarn test
```
License
© 2022 - 2024 Karsten Schmidt // Apache Software License 2.0 | [] |
https://avatars.githubusercontent.com/u/176920034?v=4 | talk-proposal | zigindia/talk-proposal | 2024-08-04T08:52:25Z | Propse a talk for future meetups. | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/zigindia/talk-proposal/tags | - | [
"systems-programming",
"zig"
] | 9 | false | 2025-05-14T19:12:55Z | false | false | unknown | github | [] | Talk Proposals
To propose a talk for a future meetup, <strong>open an issue</strong> on this repository.
Feel free to propose a talk even if there is no scheduled meetup.
We'll go over the proposals before each meetup and select the ones that best fit the schedule.
Everyone is welcome to comment on the proposals for feedback, or to express interest.
Guidelines
<ul>
<li><strong>Subject</strong>: We try to stick to Zig, but general talks about systems are welcome too :)</li>
<li><strong>Duration</strong><ul>
<li><strong>Talks about Zig</strong>: Ideally ≤ 30 minutes, but in-depth talks can take longer if needed.</li>
<li><strong>Talks about Systems</strong>: 20–25 minutes.</li>
<li><strong>Lightning talk</strong>: Between 10–15 minutes.</li>
</ul>
</li>
<li><strong>Content</strong>: No strict rules here. It can be a slide deck, a live-coding sprint, or both, or neither.</li>
</ul>
Talks that are shorter and on-topic are easier to fit within the schedule.
Relevant topics
<ul>
<li>Projects made with Zig.</li>
<li>Zig compiler internals, or present/upcoming language features.</li>
<li>Reverse engineering</li>
<li>Compilers</li>
<li>Databases</li>
<li>Operating systems</li>
<li>Game development</li>
<li>Graphics Programming</li>
<li>Computer networks</li>
<li>Webassembly</li>
<li>Embedded systems/firmware/Hardware</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/53529846?v=4 | zig-js-interplay | oltdaniel/zig-js-interplay | 2024-07-14T19:47:36Z | Seamless integration of Zig and JavaScript in WebAssembly | main | 0 | 4 | 0 | 4 | https://api.github.com/repos/oltdaniel/zig-js-interplay/tags | MIT | [
"js",
"wasm",
"zig"
] | 69 | false | 2024-12-03T06:25:43Z | true | true | unknown | github | [] | Zig JS Interplay
<blockquote>
<strong>DISCLAIMER</strong>: This is a project for fun. There will only be a loose versioning. There are no guarantees.
</blockquote>
Dealing with a low level environment like WebAssembly via JavaScript is not easy. Many concepts of low-level languages are being pulled into a very high-level JavaScript environment, reducing the suppleness of the code and interface between both environments.
This library avoids this by pulling high-level concepts into the low-level environment of the WebAssembly source and wrapping it in such fashion, that it can be called and treated like any other JavaScript interface.
The implementation is not necessarly restricted to Zig WebAssembly source, but rather the definition of the interfaces it exposes to the JavaScript environment. The concept can be adapted to any other language that compiles to WebAssembly and offers the necessary capabilities. Zig has been chosen for fun and exploration.
Example
```zig
const std = @import("std");
const ipl = @import("zig-js-interplay");
export fn greet(name: ipl.String) ipl.String {
// Generate a new greet message that we can return
const greetMessage = std.fmt.allocPrint(ipl.allocator, "Hello {s}!", .{name}) catch @panic("Oops");
// Return with Interplay String
return ipl.String.init(greetMessage);
}
export fn testFunction(arg: ipl.Function) ipl.AnyType {
// Construct function arguments to pass
const args = ipl.Array.from(&.{ ipl.String.init("Hello").asAny(), ipl.String.init("World").asAny() });
// Call the function and return its return value
return arg.call(args);
}
```
```js
import InterplayInstance from 'zig-js-interplay';
const inst = new InterplayInstance.initializeFromUrl('main.wasm');
console.log(inst.greet("Daniel"))
// => prints "Hello Daniel!"
console.log(inst.testFunction((...args) => {
console.log('I got called by reference from Zig with these arguments =', args)
return "JS says hello!"
}))
// => prints "I got called by reference from Zig with these arguments = ['Hello', 'World']"
// => prints "JS says hello!"
```
Installation
Requirements
The required browser versions can easily be extracted via <a>Browserlist</a> with the query <code>supports es6-module and supports wasm and supports wasm-bigint and supports bigint</code>. The support for <code>es6-modules</code> obviously only counts for the compiled JavaScript files this repo contains directly. All the other features must be supported in order to work correctly.
Supported browser versions (as of 2024-07-15):
- Chrome 85+
- Safari iOS 14.5+
- Safari 14.1+
- Firefox 78+
Zig
First, add this repo as an dependency to your Zon file with <code>zig fetch https://github.com/oltdaniel/zig-js-interplay/archive/COMMITSHA.tar.gz --save</code>.
And add the following code to add this repo as a module you can import to your <code>build.zig</code>:
```zig
// ...
// Load depdendency
const zigJsInterplay = b.dependency("zig-js-interplay", .{});
// Add dependency to root module
wasm.root_module.addImport("zig-js-interplay", zigJsInterplay.module("zig-js-interplay"));
// ...
```
<blockquote>
<strong>NOTE</strong>: I'm still new to zig, so if there is a better way, please let me know.
</blockquote>
The binary size of a full example using all types, including the builtin wasm allocator, a hash function and string formatting, can be seen above.
JavaScript
You can simply import the module within your source. The current bundle size can be seen above.
```html
import InterplayInstance from 'https://cdn.jsdelivr.net/gh/oltdaniel/zig-js-interplay/dist/interplay.min.js';
```
Right now we don't publish this package to an registry. But you can simply add this repo as a dependency via the package manager of your choice. We only rely on a single development dependency. Alternatively you can use a CDN like <a>jsdelivr</a> or <a>unpkg</a>.
Documentation
<blockquote>
<strong>TODO</strong>: Write documentation.
</blockquote>
Currently, there are a lot of technical comments in the source code itself and in the example. Please read those for now instead.
Articles
I've written two articles about my process to this library. Feel free to check them out:
<ul>
<li><a>Playing with zig and wasm</a></li>
<li><a>TODO</a></li>
</ul>
Development
This project consists of two programming languages. We require a JavaScript and Zig toolchain for full development on this project.
<ul>
<li><a>Node.js</a> for the JavaScript toolchain environment.</li>
<li><a>PNPM</a> as JavaScript package manage of choice for this project.</li>
<li><a>Zig</a> for the Zig toolchain (<code>v0.13</code> has been used during development by me).</li>
</ul>
```bash
Get the source code
git clone https://github.com/oltdaniel/zig-js-interplay
cd zig-js-interplay
Compile JavaScript and Zig
NOTE: This runs <code>pnpm build</code> and <code>zig build</code>
make
Compile JavaScript
pnpm build
Compile Zig
NOTE: There is no compile output for Interplay alone. But it checks if everything is ok.
zig build
Compile example
cd example
zig build
Serve example via HTTP server
http://localhost:8000/example
python -m http.server 8000
```
ToDo
<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> Comment the zig file correctly and in full form
<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> Maybe add some tests for the functionns on each side
<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> Write documentation for the encoding and how each type works
License
| [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | glfw.zig | tiawl/glfw.zig | 2024-02-28T21:20:50Z | @glfw packaged for @ziglang | trunk | 0 | 4 | 2 | 4 | https://api.github.com/repos/tiawl/glfw.zig/tags | Unlicense | [
"binding",
"glfw3",
"spaceporn",
"zig",
"zig-package",
"ziglang"
] | 517 | false | 2025-05-10T10:26:28Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
},
{
"commit": "master",
"name": "wayland_zig",
"tar_url": "https://github.com/tiawl/wayland.zig/archive/maste... | glfw.zig
This is a fork of <a>hexops/glfw</a> which is itself a fork of <a>glfw/glfw</a>.
Why this forkception ?
The intention under this fork is the same as <a>hexops</a> had when they forked <a>glfw/glfw</a>: package it for <a>Zig</a>. So:
* Unnecessary files have been deleted,
* The build system has been replaced with <code>build.zig</code>.
However this repository has subtle differences for maintainability tasks:
* No shell scripting,
* A cron runs every day to check <a>glfw/glfw</a>. Then it updates this repository if a new release is available,
* No support for macOS.
How to use it
The goal of this repository is not to provide a <a>Zig</a> binding for <a>glfw/glfw</a>. There are at least as many legit ways as possible to make a binding as there are active accounts on Github. So you are not going to find an answer for this question here. The point of this repository is to abstract the <a>glfw/glfw</a> compilation process with <a>Zig</a> (which is not new comers friendly and not easy to maintain) to let you focus on your application. So you can use <strong>glfw.zig</strong>:
- as raw (see GLFW examples <a>here</a>),
- as a daily updated interface for your <a>Zig</a> binding of <a>glfw/glfw</a> (see <a>here</a> for a private usage).
Important note
The current usage of this repository is centered around <a>tiawl/cimgui.zig</a> compilation. So for your usage it could break because some files have been filtered in the process. If it happens, open an issue: this repository is open to potential usage evolution.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>glfw/glfw</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/cimgui.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>glfw/glfw</a>
* <a>tiawl/toolbox</a>
* <a>tiawl/vulkan.zig</a>
* <a>tiawl/wayland.zig</a>
* <a>tiawl/X11.zig</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/119983202?v=4 | zig-cycleclock | spiraldb/zig-cycleclock | 2024-02-23T09:53:44Z | Cross-platform CPU cycle clock based on Google Benchmark | develop | 0 | 4 | 1 | 4 | https://api.github.com/repos/spiraldb/zig-cycleclock/tags | Apache-2.0 | [
"cpu",
"simd-programming",
"zig"
] | 14 | false | 2024-12-04T23:37:20Z | true | true | unknown | github | [] | Zig Cycle Clock
A cross-platform way to access the current time in "cycles".
Based on https://github.com/google/benchmark/blob/main/src/cycleclock.h
MacOS support based on https://lemire.me/blog/2023/03/21/counting-cycles-and-instructions-on-arm-based-apple-systems/
Supported Architectures:
* AArch64 running MacOS (i.e., Apple Silicon)
* x86_64 | [
"https://github.com/spiraldb/fastlanez"
] |
https://avatars.githubusercontent.com/u/3848910?v=4 | zig-rocksdb | jiacai2050/zig-rocksdb | 2024-04-27T03:26:42Z | RocksDB binding for Zig | main | 1 | 4 | 0 | 4 | https://api.github.com/repos/jiacai2050/zig-rocksdb/tags | MIT | [
"rocksdb",
"rocksdb-zig",
"zig",
"zig-lib",
"zig-library",
"zig-package"
] | 39 | false | 2025-05-01T05:10:29Z | true | true | 0.14.0 | github | [
{
"commit": "refs",
"name": "rocksdb",
"tar_url": "https://github.com/facebook/rocksdb/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/facebook/rocksdb"
}
] | 404 | [] |
https://avatars.githubusercontent.com/u/46907231?v=4 | uxn-zig | robbielyman/uxn-zig | 2024-05-06T12:42:30Z | WIP implementation of the Uxn system in Zig | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/robbielyman/uxn-zig/tags | MIT | [
"uxn",
"uxntal",
"zig"
] | 9 | false | 2025-02-02T22:38:42Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/49950206?v=4 | proconio-zig | Ryoga-exe/proconio-zig | 2024-02-26T21:09:56Z | proconio for the Zig programming language. useful and easy io library for programming contests. | main | 0 | 3 | 1 | 3 | https://api.github.com/repos/Ryoga-exe/proconio-zig/tags | MIT | [
"zig",
"zig-package"
] | 23 | false | 2025-05-20T14:52:07Z | true | true | 0.14.0 | github | [] | proconio-zig
proconio for the Zig programming language. useful and easy IO library for programming contests.
usage
```zig
const std = @import("std");
const proconio = @import("proconio");
pub fn main() !void {
const allocator = std.heap.page_allocator;
var io = try proconio.init(allocator);
defer io.deinit();
<code>const in = try io.input(struct {
n: u8,
m: u32,
l: i32,
});
std.debug.print("{}, {}, {}\n", .{in.n, in.m, in.l});
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/47703105?v=4 | ziggurat | RebelAndroid/ziggurat | 2024-05-24T16:05:28Z | null | trunk | 0 | 3 | 0 | 3 | https://api.github.com/repos/RebelAndroid/ziggurat/tags | AGPL-3.0 | [
"kernel",
"osdev",
"zig"
] | 2,810 | false | 2024-12-17T17:27:23Z | false | false | unknown | github | [] | Ziggurat
Ziggurat is a work-in-progress kernel for x86-64 machines. Currently, it can load a static elf file and run it in userspace.
Building
Ziggurat uses Nix to manage the build environment. Enter the nix environment with <code>nix develop</code> or use enable direnv for the Ziggurat directory.
Ziggurat uses make to build, use <code>make</code> with the appropriate target.
Build targets
<ul>
<li><code>ziggurat.iso</code> This target builds the ziggurat ISO image. This .iso can be used to boot on real hardware with <code>dd if=ziggurat.iso of=/dev/my_flash_drive_here</code>.</li>
<li><code>run-kvm-uefi</code> This target creates a qemu virtual machine using kvm to run Ziggurat.</li>
<li><code>run-gdb-uefi</code> This target creates a qemu virtual machine to run Ziggurat. The virtual machine waits for a connection from gdb before starting.</li>
<li><code>run-uefi</code> This target creates a qemu virtual machine to run Ziggurat.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/74946768?v=4 | zuid | KeithBrown39423/zuid | 2024-05-03T16:50:21Z | An RFC 9562 complient UUID library for ZIG | main | 0 | 3 | 2 | 3 | https://api.github.com/repos/KeithBrown39423/zuid/tags | MIT | [
"id",
"library",
"rfc",
"rfc-4122",
"rfc-9562",
"rfc4122",
"rfc9562",
"uuid",
"zig",
"zig-uuid",
"zuid"
] | 67 | false | 2024-12-29T02:34:03Z | true | true | unknown | github | [] |
ZUID
A simple UUID library for ZIG
<a>Features</a> •
<a>Installation</a> •
<a>Examples</a> •
<a>Contributing</a>
This library provides a simple and efficient way to generate and manipulate UUIDs (Universally Unique Identifiers) in Zig.
Features
<ul>
<li>Generate UUIDs of most versions (1, 3, 4, 5, 6, 7, and 8)</li>
<li>Parse UUIDs from strings</li>
<li>Create UUIDs from binary arrays</li>
<li>Convert UUIDs to strings, 128-bit integers, and byte-arrays</li>
<li>Access to parts of UUID (<code>set_1</code>, <code>version</code>, <code>variant</code>, etc.)</li>
</ul>
Installation
To install this library, add the following to your <code>build.zig</code> file:
```zig
pub fn build(b: *std.Build) void {
// ...
const zuid_dep = b.dependency("zuid", .{});
const zuid_mod = zuid_dep.module("zuid");
<code>exe.root_module.addImport("zuid", zuid_mod);
// ...
</code>
}
<code>Also make sure to add the following to your `build.zig.zon` file:</code>bash
zig fetch --save https://github.com/KeithBrown39423/zuid/archive/refs/tags/v2.0.0.tar.gz
```
Examples
Here is a simple example of how to generate a UUID:
```zig
const std = @import("std");
const zuid = @import("zuid");
pub fn main() !void {
const uuid = zuid.new.v4();
<code>std.debug.print("UUID: {s}\n", .{ uuid });
</code>
}
<code>If you are creating a v3 or v5 UUID, make sure to include the namespace and data.</code>zig
const std = @import("std");
const zuid = @import("zuid");
pub fn main() !void {
const uuid = zuid.new.v5(zuid.UuidNamespace.URL, "https://example.com");
<code>std.debug.print("UUID: {s}\n", .{ uuid });
</code>
}
<code>You can also get the UUID as an int through `@bitCast`.</code>zig
const std = @import("std");
const zuid = @import("zuid");
pub fn main() !void {
const uuid = zuid.new.v4();
<code>std.debug.print("UUID: {s}\n", .{ uuid });
const uuid_int = @as(u128, @bitCast(uuid));
std.debug.print("UUID as int: {d}\n", .{ uuid_int });
// or
std.debug.print("UUID: {d}\n", .{ uuid });
</code>
}
```
Contributing
Contributions are welcome! Please submit a pull request or create an issue to get started.
(<b>ZUID</b> is protected by the <a><i>MIT licence</i></a>)
| [
"https://github.com/Khitiara/imaginarium"
] |
https://avatars.githubusercontent.com/u/170101967?v=4 | zconway | CaliOn2/zconway | 2024-08-02T13:33:13Z | zConway is a Terminal Conway's game of life simulator written in zig | master | 0 | 3 | 0 | 3 | https://api.github.com/repos/CaliOn2/zconway/tags | AGPL-3.0 | [
"cli-app",
"lightweight",
"linux-app",
"zig"
] | 20,077 | false | 2025-02-19T09:43:46Z | true | true | unknown | github | [] | About
This Program simulates Conways Game of life in the terminal as a sort of screensaver.
To run it with different colors add the first tree letters of the main ansi colors after the program itself.
To get more info run the program with --help.
To build it you will need zig(Duh!) and libc, then run zig build --release=fast in the directory.
Example Picture
| [] |
https://avatars.githubusercontent.com/u/6199588?v=4 | waybar-wise-fx-rate | rlopzc/waybar-wise-fx-rate | 2024-07-03T04:29:26Z | Waybar module to display FX rate between two currencies using the Wise API. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/rlopzc/waybar-wise-fx-rate/tags | - | [
"cli",
"fx-rate",
"fx-rates",
"waybar",
"waybar-module",
"zig"
] | 47 | false | 2025-02-07T21:19:24Z | true | true | unknown | github | [
{
"commit": "c0193e9247335a6c1688b946325060289405de2a",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/c0193e9247335a6c1688b946325060289405de2a.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | Waybar Wise FX Rate
Waybar module to get the FX rate between two currencies using the Wise API.
Example output in Waybar:
<code>17.62 USD/MXN</code>
Getting Started
Get your Wise API Key
In order for this to work, you need to provide your Wise API Key.
<ol>
<li>Log in to wise.</li>
<li>Go to: Profile -> Settings -> Developer tools -> API tokens.</li>
<li>Add new token<ol>
<li><em>Name</em>: Waybar Wise FX Rate.</li>
<li><em>Token permissions</em>: <strong>Read only</strong> <- Very important!!</li>
<li>Click <em>Create token</em>.</li>
</ol>
</li>
<li>Copy your token</li>
</ol>
Compile and install the binary
```sh
Clone the repo
git clone https://github.com/rlopzc/waybar-wise-fx-rate.git
cd waybar-wise-fx-rate
Build the binary
zig build --release=fast
```
The binary will be in <code>zig-out/bin/waybar-wise-fx-rate</code>.
Symlink it to your <code>~/.local/bin</code>. Replace <code><your-path-to-project-dir></code> with the dir where you cloned the repository.
<code>sh
ln -s $HOME/<path-to-project-dir>/zig-out/bin/waybar-wise-fx-rate ~/.local/bin/waybar-wise-fx-rate</code>
Downloading binary from Releases
Currently built for:
- x86_64-linux
- aarch64-linux
- arm-linux
<ol>
<li>Check your architecture.</li>
<li>Download it with <code>curl -L https://github.com/rlopzc/waybar-wise-fx-rate/releases/latest/download/waybar-wise-fx-rate-x86_64-linux > waybar-wise-fx-rate</code>.</li>
<li>Make it executable <code>chmod +x ./waybar-wise-fx-rate</code>.</li>
<li>Symlink it with: <code>ln -s $HOME/<download-dir>/waybar-wise-fx-rate ~/.local/bin/waybar-wise-fx-rate</code>.</li>
</ol>
<blockquote>
Replace the architecture with yours.
</blockquote>
Using the Waybar module
<strong>CLI Arguments</strong>.
<ul>
<li><code>--apikey</code>. Wise API key.</li>
<li><code>--source</code>. Source Currency supported by Wise.</li>
<li><code>--target</code>. Target Currency supported by Wise.</li>
</ul>
Add a custom module to your waybar config:
<code>json
"custom/wise-fx-rate": {
"format": "{} {icon}",
"return-type": "json",
"format-icons": {
"default": "$"
},
"exec": "waybar-wise-fx-rate --apikey <wise-api-key> --source <source> --target <target>",
"interval": 60
}</code> | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | zigtex | fjebaker/zigtex | 2024-08-05T13:38:13Z | Embeddable LaTeX to SVG in Zig. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/fjebaker/zigtex/tags | GPL-3.0 | [
"latex",
"latex-to-svg",
"microtex",
"renderer",
"svg",
"zig"
] | 588 | false | 2025-05-12T21:43:06Z | true | true | unknown | github | [
{
"commit": "openmath.tar.gz",
"name": "microtex",
"tar_url": "https://github.com/fjebaker/MicroTeX/archive/openmath.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/fjebaker/MicroTeX"
}
] |
ZigTeX
ZigTeX is a wrapper around <a>MicroTeX</a> with a custom SVG renderer. ZigTeX principally gives you one function, which takes some LaTeX code and spits out an SVG:
```zig
const std = @import("std");
const ztex = @import("zigtex");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>var render = try ztex.TexSvgRender.init(allocator, .{});
defer render.deinit();
const tex =
\\\begin{equation}
\\ \hat{F}(\nu) = \int_{-\infty}^\infty e^{-i 2\pi t \nu} f(t) \text{d}t
\\\end{equation}
;
const output = try render.parseRender(allocator, tex, .{});
defer allocator.free(output);
var f = try std.fs.cwd().createFile("example.svg", .{});
defer f.close();
try f.writeAll(output);
</code>
}
```
This produces the title image on a transparent background.
Usage
To use in your Zig project, add this project as a dependency
<code>bash
zig fetch --save https://github.com/fjebaker/zigtex/archive/main.tar.gz</code>
Then modify your <code>build.zig</code> in the usual way:
```zig
const zigtex_dep = b.dependency(
"zigtex",
.{.optimize = optimize, .target = target},
);
// ...
exe.root_module.addImport("zigtex", zigtex_dep.module("zigtex"));
``` | [] |
https://avatars.githubusercontent.com/u/25912761?v=4 | zig-book | r4gus/zig-book | 2024-07-13T14:31:23Z | Zig Basiscs: Zig programmieren für Einsteiger | master | 0 | 3 | 0 | 3 | https://api.github.com/repos/r4gus/zig-book/tags | - | [
"book",
"books",
"buch",
"deutsch",
"programming",
"programming-language",
"zig",
"ziglang"
] | 24,982 | false | 2025-02-08T01:24:25Z | false | false | unknown | github | [] | Zig Basics
Das ist das offizielle Repository des Buchs "Zig Basics". Derzeit ist das Buch noch Work-in-Progress und daran wird sich so schnell auch nichts ändern. Von Zeit zu Zeit erweitere ich das Buch, jedoch kommt es immer darauf an wie viel Zeit und auch Lust ich habe. Da es schon genug Zig-Content in Englisch gibt, habe ich entschlossen das Buch auf Deutsch zu verfassen.
Falls jemand an diesem Buch mitarbeiten will oder es Verbesserungsvorschläge gibt empfiehlt sich das Eröffnen eines Issues. Alternativ bin ich auch über david (at) thesugar.de erreichbar.
Getting Started
Das Buch wurde mit <a>Typst</a> erstellt. Um das Buch zu bauen <a>installieren Sie zuerst Typst</a> und rufen dann <code>typst compile main.typ</code> über die Kommandozeile auf.
Über den Autor
Hi ich bin David. Vielleicht kennen wir uns von einer der <a>Software You Can Love</a> Konferenzen. Ich verwalte eine Reihe an Zig-Projekten, darunter <a>PassKeeZ</a>, <a>keylib</a>, <a>zbor</a> und <a>uuid-zig</a>. Außerdem veranstalte ich das <a>Zigtoberfest</a>, seit 2024, an der Hochschule München.
License
Copyright © David Pierre Sugar. This book is licensed by the <a>CC-BY 4.0</a> Creative Commons Attribution 4.0 International Public License. | [] |
https://avatars.githubusercontent.com/u/9214692?v=4 | zig-opengl-minimal-template | vsvsv/zig-opengl-minimal-template | 2024-04-22T23:39:43Z | Zig OpenGL template with minimum dependencies | master | 0 | 3 | 0 | 3 | https://api.github.com/repos/vsvsv/zig-opengl-minimal-template/tags | - | [
"glad",
"glfw3",
"opengl",
"zig"
] | 57 | false | 2025-04-06T00:58:00Z | true | true | unknown | github | [] |
Zig Minimal OpenGL Template
Minimalist cross-platform window with OpenGL context in Zig
<ul>
<li>Depends only on <a>GLFW</a> and <a>glad</a></li>
<li>Tested on Zig version <code>0.15.0-dev.247+95fdbc579</code> (see other branches for different Zig versions)</li>
<li>Cross-platform compilation for Linux, MacOS and Windows</li>
<li>Suitable for following OpenGL tutorials on <a>LearnOpenGL.com</a></li>
</ul>
Supported Zig versions
The <code>master</code> branch tries to support the most recent <a>Zig</a> version from <code>master</code> branch.
There are other branches named <code>zig-%vesion%</code> which has support for different older Zig versions.
How To Use
<blockquote>
<strong>Note</strong>
If you're building on Linux, ensure you have installed all required packages for GLFW. Please check "Dependencies for Wayland and X11" on <a>Compiling GLFW Guide</a>.
</blockquote>
```bash
Clone this repository
git clone https://github.com/vsvsv/zig-opengl-minimal-template
Go into the repository
cd zig-opengl-minimal-template
Fetch GLFW as submodule
git submodule update --init
Build program
zig build run
```
License
MIT | [] |
https://avatars.githubusercontent.com/u/13811862?v=4 | zure | thechampagne/zure | 2024-05-17T12:06:14Z | ⚡ Zig binding for rust regex engine. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/thechampagne/zure/tags | MIT | [
"library",
"regex",
"regex-engine",
"zig",
"ziglang"
] | 645 | false | 2025-05-05T23:36:09Z | true | true | unknown | github | [] | zure
<strong>Rust regex</strong>
This library provides routines for searching strings for matches of a <a>regular expression</a> (aka "regex").
The regex syntax supported by this library is similar to other regex engines, but it lacks several features that are not known how to implement efficiently.
This includes, but is not limited to, look-around and backreferences.
In exchange, all regex searches in this library have worst case <code>O(m * n)</code> time complexity, where <code>m</code> is proportional to the size of the regex and <code>n</code> is proportional to the size of the string being searched.
<a></a>
Zig binding for rust <strong>regex</strong> engine.
Usage
Build rust regex library:
<code>sh
$ git clone git://github.com/rust-lang/regex
$ cd regex/regex-capi
$ cargo build --release # it exist in ../target/release [librure.so, librure.a]</code>
build.zig.zon:
<code>zig
.{
.dependencies = .{
.zure = .{
.url = "https://github.com/thechampagne/zure/archive/refs/heads/main.tar.gz" ,
//.hash = "12208586373679a455aa8ef874112c93c1613196f60137878d90ce9d2ae8fb9cd511",
},
},
}</code>
build.zig:
<code>zig
const zure = b.dependency("zure", .{});
exe.root_module.addImport("zure", zure.module("zure"));
exe.addLibraryPath(b.path("regex/target/release"));
exe.linkSystemLibrary("rure");</code>
References
<ul>
<li><a>rust-regex</a></li>
</ul>
License
This repo is released under the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/89421445?v=4 | zix | alvaro17f/zix | 2024-04-06T11:10:23Z | Update your nixos system with a single command | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/alvaro17f/zix/tags | MIT | [
"zig"
] | 130 | false | 2025-05-18T09:51:06Z | true | true | 0.14.0 | github | [] | ZIX
ZIX is a command line tool for managing NixOS configuration.
<blockquote>
:warning: <strong>Work in Progress</strong>: This project is currently under development. Some features may not be complete and may change in the future.
</blockquote>
Installation
To install ZIX, you can clone the repository and compile the source code:
<code>sh
git clone https://github.com/alvaro17f/zix.git
cd zix
zig build run</code>
then move the binary to a directory in your PATH:
<code>sh
sudo mv zig-out/bin/zix <PATH></code>
NixOS
Run
To run ZIX, you can use the following command:
<code>sh
nix run github:alvaro17f/zix#target.x86_64-linux-musl</code>
Flake
Add zix to your flake.nix file:
<code>nix
{
inputs = {
zix.url = "github:alvaro17f/zix";
};
}</code>
then include it in your system configuration:
<code>nix
{ inputs, pkgs, ... }:
{
home.packages = [
inputs.zix.packages.${pkgs.system}.default
];
}</code>
Usage
```sh
ZIX - A simple CLI tool to update your nixos system
-r : set repo path (default is $HOME/.dotfiles)
-n : set hostname (default is OS hostname)
-k : set generations to keep (default is 10)
-u : set update to true (default is false)
-d : set diff to true (default is false)
-h, help : Display this help message
-v, version : Display the current version
```
License
ZIX is distributed under the MIT license. See the LICENSE file for more information. | [] |
https://avatars.githubusercontent.com/u/28966224?v=4 | mac_address | weskoerber/mac_address | 2024-05-17T01:52:16Z | A cross-platform library to retrieve the MAC address from your network interfaces without libc. | main | 5 | 3 | 1 | 3 | https://api.github.com/repos/weskoerber/mac_address/tags | MIT | [
"tools",
"zig",
"zig-package"
] | 38 | false | 2025-04-04T22:21:57Z | true | true | 0.14.0 | github | [
{
"commit": "d21b419d808215e1f82605fdaddc49750bfa3bca.tar.gz",
"name": "zigwin32",
"tar_url": "https://github.com/marlersoft/zigwin32/archive/d21b419d808215e1f82605fdaddc49750bfa3bca.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/marlersoft/zigwin32"
}
] | <a></a>
<a></a>
<code>mac_address</code>
A cross-platform library to retrieve the MAC address from your network
interfaces without <code>libc</code>.
Requirements
<ul>
<li><a>Zig</a> compiler (<code>0.14.0</code> or newer)[^1]<ul>
<li>If using Zig <code>0.12</code> and <code>0.13</code>, use the <a><code>zig-0.12</code></a> branch</li>
</ul>
</li>
</ul>
Install
First, add the dependency to your <code>build.zig.zon</code> using <code>zig fetch</code>:
<code>console
zig fetch --save git+https://github.com/weskoerber/mac_address#main</code>
Then, import <code>mac_address</code> into your <code>build.zig</code>:
```zig
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
<code>const mac_address = b.dependency("mac_address", .{
.target = target,
.optimize = optimize,
}).module("mac_address");
const my_exe = b.addExecutable(.{
.name = "my_exe",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
my_exe.root_module.addImport(mac_address);
</code>
}
```
Usage
See the <code>examples</code> directory for example usage. Example executables can be
built by setting the <code>examples</code> option to <code>true</code> (or <code>-Dexamples=true</code> on the
CLI):
<code>zig
const mac_address = b.dependency("mac_address", .{
.target = target,
.optimize = optimize,
.examples = true,
}).module("mac_address");</code>
<code>console
zig build -Dexamples=true</code>
Cross-platform support
| <code>mac_address</code> API | Linux | Windows |
| ------------------ | ----- | ------- |
| <code>getAll</code> | ✅ | ✅ |
| <code>getAllNoLoopback</code> | ✅ | ✅ |
<ul>
<li>✅ = supported</li>
<li>📝 = planned</li>
<li>❌ = not supported</li>
</ul>
[^1]: Shameless plug: if you're using a unix-like operating system or WSL on
Windows, consider using a Zig compiler version manager I wrote called
<a>zvm</a>. Once downloaded and in your
<code>PATH</code>, just run <code>zvm install 0.12.0</code> (or <code>zvm install master</code> to get the
latest nightly). | [] |
https://avatars.githubusercontent.com/u/5885545?v=4 | slidey | JacobCrabill/slidey | 2024-03-26T00:12:00Z | Simple, elegant slideshows in the terminal | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/JacobCrabill/slidey/tags | - | [
"markdown",
"presentation-tools",
"terminal",
"zig"
] | 82 | false | 2024-12-01T19:43:00Z | true | true | 0.12.0 | github | [
{
"commit": "d60f97252877e1eddf1d0d978f488c721cf3dad3.tar.gz",
"name": "zigdown",
"tar_url": "https://github.com/jacobcrabill/zigdown/archive/d60f97252877e1eddf1d0d978f488c721cf3dad3.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/jacobcrabill/zigdown"
}
] | Slidey: Elegant Slideshows in Zig
Use Markdown to create simple yet elegant slide shows
Test example:
<code>bash
zig build -Doptimize=ReleaseSafe
./zig-out/bin/slidey -s test/deck/slides.txt test/deck</code>
Demo
Note that rendering images requires a terminal with support for the
<a>Kitty Graphics Protocol</a>. Text-capture tools
like the <code>asciinema</code> cast below are unable to capture the RGB image data of the protocol.
<a></a> | [] |
https://avatars.githubusercontent.com/u/1910321?v=4 | gravitas | azillion/gravitas | 2024-06-02T02:58:58Z | A voxel engine in Zig and WebGPU | main | 0 | 3 | 1 | 3 | https://api.github.com/repos/azillion/gravitas/tags | MIT | [
"voxel-engine",
"webgpu",
"zig"
] | 162 | false | 2024-07-26T00:43:47Z | true | true | unknown | github | [
{
"commit": null,
"name": "zgpu",
"tar_url": null,
"type": "relative",
"url": "libs/zgpu"
},
{
"commit": null,
"name": "zpool",
"tar_url": null,
"type": "relative",
"url": "libs/zpool"
},
{
"commit": null,
"name": "zjobs",
"tar_url": null,
"type": "rel... | Gravitas Engine
A voxel engine written in zig and WebGPU.
Features
<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> Display a triangle
Dependencies
We use the following libraries:
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <a>Zig-Gamedev</a>
Building
<code>sh
zig build</code>
Should be as simple as that. No need to install any dependencies.
References
Molenaar, M. and Eisemann, E. (2023), Editing Compressed High-resolution Voxel Scenes with Attributes. Computer Graphics Forum, 42: 235-243. https://doi.org/10.1111/cgf.14757 | [] |
https://avatars.githubusercontent.com/u/49950206?v=4 | miniz | Ryoga-exe/miniz | 2024-02-14T11:30:26Z | Minimal scripting language in Zig. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/Ryoga-exe/miniz/tags | Apache-2.0 | [
"interpreter",
"zig"
] | 87 | false | 2024-02-26T22:08:54Z | true | false | unknown | github | [] | miniz
Minimal scripting language in Zig.
2023 年度筑波大学情報科学類で開講された <a>GB27001 ソフトウェアサイエンス特別講義 A</a> の講義内で紹介された <a>minis</a> の Zig による実装です。
実行
repl
```sh
zig build run
```
file
<code>text
hello = 2023;
world = 2024;
hello + world;</code>
<code>sh
zig build run -- file.mnz # 4047</code>
文法
miniz は以下の文法をサポートしています。
<ul>
<li>関数定義</li>
<li>関数呼び出し</li>
<li>if 式</li>
<li>while 式</li>
<li>連結</li>
<li>代入式</li>
<li>比較演算子</li>
<li>四則演算・モジュロ演算</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/161890530?v=4 | zpe | soheil-01/zpe | 2024-07-29T13:32:01Z | A Portable Executable parser in Zig | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/soheil-01/zpe/tags | - | [
"parser",
"portable-executable",
"windows",
"zig"
] | 512 | false | 2024-11-08T15:16:23Z | true | true | unknown | github | [
{
"commit": "master",
"name": "zig-datetime",
"tar_url": "https://github.com/frmdstryr/zig-datetime/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/frmdstryr/zig-datetime"
},
{
"commit": "9a94c4803a52e54c26b198096d63fb5bde752da2",
"name": "zig-cli",
"tar_url"... | ZPE - Zig Portable Executable Parser
ZPE is a library and a command-line tool that allows you to parse and inspect the structure of Portable Executable files.
Features
ZPE can parse and display the following components of a PE file:
<ul>
<li>DOS Header</li>
<li>Rich Header</li>
<li>NT Headers</li>
<li>Section Headers</li>
<li>Import Directory</li>
<li>Export Directory</li>
<li>Base Relocation Directory</li>
</ul>
Usage as a Command-Line Tool
<code>sh
$ zpe --file-path path/to/your/file</code>
You can also selectively display specific parts of the PE file:
<code>sh
$ zpe --file-path path/to/your/file --print-dos-header --print-nt-headers</code>
The Available command-line options are:
<ul>
<li><code>--file-path</code>: The path to the Portable Executable file you want to analyze.</li>
<li><code>--print-dos-header</code>: Print the contents of the DOS header.</li>
<li><code>--print-rich-header</code>: Print the contents of the Rich header.</li>
<li><code>--print-nt-headers</code>: Print the contents of the NT headers.</li>
<li><code>--print-section-headers</code>: Print the contents of the section headers.</li>
<li><code>--print-import-directory</code>: Print the contents of the import directory.</li>
<li><code>--print-export-directory</code>: Print the contents of the export directory.</li>
<li><code>--print-base-relocation-directory</code>: Print the contents of the base relocation directory.</li>
</ul>
Usage as a Library
```zig
const std = @import("std");
const PEParser = @import("zpe").PEParser;
fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
<code>var parser = try PEParser.init(allocator, "path/to/your/file");
defer parser.deinit();
try parser.parse();
// Access the parsed information
std.debug.print("DOS Header Magic: 0x{X}\n", .{parser.dos_header.?.e_magic});
// ...
</code>
}
```
Contributing
If you find any issues or want to contribute to the development of ZPE, feel free to open a new issue or submit a pull request on the ZPE GitHub repository. | [] |
https://avatars.githubusercontent.com/u/146390816?v=4 | libmaxminddb | allyourcodebase/libmaxminddb | 2024-07-19T10:01:19Z | Zig build of libmaxminddb library. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/allyourcodebase/libmaxminddb/tags | MIT | [
"libmaxminddb",
"maxmind",
"maxmind-db",
"maxminddb",
"zig",
"zig-",
"zig-build",
"zig-package",
"ziglang"
] | 5 | false | 2025-05-16T00:50:53Z | true | true | 0.13.0 | github | [
{
"commit": "a4fa79d.tar.gz",
"name": "libmaxminddb",
"tar_url": "https://github.com/maxmind/libmaxminddb/archive/a4fa79d.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/maxmind/libmaxminddb"
}
] | libmaxminddb
<a></a>
<a></a>
Zig build of <a>libmaxminddb library</a>.
:rocket: Usage
<ul>
<li>Add <code>libmaxminddb</code> dependency to <code>build.zig.zon</code>.</li>
</ul>
<code>sh
zig fetch --save https://github.com/allyourcodebase/libmaxminddb/archive/<git_tag_or_commit_hash>.tar.gz</code>
<ul>
<li>Use <code>libmaxminddb</code> dependency in <code>build.zig</code>.</li>
</ul>
<code>zig
const libmaxminddb_dep = b.dependency("libmaxminddb", .{
.target = target,
.optimize = optimize,
});
const maxminddb_mod = libmaxminddb_dep.module("maxminddb");
<compile>.root_module.addImport("maxminddb", maxminddb_mod);</code>
| [
"https://github.com/allyourcodebase/libmaxminddb"
] |
https://avatars.githubusercontent.com/u/56201308?v=4 | nrz | logotip4ik/nrz | 2024-06-29T18:46:28Z | Supa-Fast™ cross package manager scripts runner. Fastest `npm run dev` on wild west. | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/logotip4ik/nrz/tags | - | [
"nodejs",
"runner",
"zig"
] | 130 | false | 2025-03-23T13:37:07Z | true | true | 0.14.0 | github | [] | nrz
Same as <a>nrr</a> or <a>nrn</a>, but even faster.
Want to try out ?
Download latest build artifact from <a>build ci</a>.
To build `nrz` localy
1. Clone this repo
2. Build `nrz` with (you will need zig installed):
```sh
zig build --release=fast --summary all -Doptimize=ReleaseFast
```
3. Add `/zig-out/bin` to `PATH`
Usage
<code>sh
nrz dev --host</code>
This will run <code>dev</code> command from closest <code>package.json</code> and pass <code>--host</code> and option (it will forward
everything you handle it).
<code>sh
nrz eslint ./src</code>
This will run <code>eslint</code> from closest <code>node_modeules/.bin/</code> folder and pass <code>./src</code> as arg.
Completions
Nrz can also autocomplete scripts for you, to enable autocomplete, add to your shell config file:
```bash
For zsh
source <(nrz --cmp=Zsh)
Bash
source <(nrz --cmp=Bash)
Fish
source (nrz --cmp=Fish | psub)
```
<blockquote>
Note: i can't verify if Bash and Fish autocompletes are working, please let me know if they aren't
by creating an issue
</blockquote>
Benchmark
package.json
```json
{
"scripts": {
"start": "node index.js",
"log": "echo $PATH",
"empty": ""
}
}
```
```sh
$ hyperfine "./nrr empty" "./nrz empty" "npm run empty" "node --run empty" --shell=none --output=pipe
Benchmark 1: ./nrr empty
Time (mean ± σ): 5.2 ms ± 0.5 ms [User: 1.3 ms, System: 1.6 ms]
Range (min … max): 4.5 ms … 11.3 ms 264 runs
Benchmark 2: ./nrz empty
Time (mean ± σ): 3.6 ms ± 0.2 ms [User: 0.7 ms, System: 1.1 ms]
Range (min … max): 2.6 ms … 4.5 ms 828 runs
Benchmark 4: npm run empty
Time (mean ± σ): 108.3 ms ± 1.1 ms [User: 73.6 ms, System: 12.5 ms]
Range (min … max): 105.3 ms … 110.2 ms 27 runs
Benchmark 5: node --run empty
Time (mean ± σ): 32.8 ms ± 0.4 ms [User: 22.3 ms, System: 2.7 ms]
Range (min … max): 32.0 ms … 34.3 ms 87 runs
Summary
./nrz empty ran
1.42 ± 0.15 times faster than ./nrr empty
8.98 ± 0.46 times faster than node --run empty
29.68 ± 1.52 times faster than npm run empty
$ ./nrr --version
nrr 0.9.2
$ nrz --version
nrz 1.0.4
$ node --version
v22.11.0
$ npm --version
10.9.0
```
<blockquote>
Benched on MacBook M3 Pro, Sequoia 15.2
</blockquote> | [] |
https://avatars.githubusercontent.com/u/15897993?v=4 | zmongo | sugarme/zmongo | 2024-03-06T11:21:27Z | mongodb client ziglang | master | 0 | 3 | 0 | 3 | https://api.github.com/repos/sugarme/zmongo/tags | NOASSERTION | [
"mongoc",
"mongodb",
"mongodb-binding",
"mongodb-client",
"mongodb-driver",
"zig",
"zig-binding",
"ziglang"
] | 9,511 | false | 2025-01-09T12:49:05Z | true | true | unknown | github | [
{
"commit": null,
"name": "libmongoc",
"tar_url": null,
"type": "relative",
"url": "./libmongoc"
}
] | zmongo
What is it
<code>zmongo</code> is a wrapper to <a>official mongo-c-driver</a> - client <a>MongoDB</a> library.
It is meant to be a temporary solution to use <code>mongodb</code> database for ziglang until we have a native ziglang driver for mongodb.
<ul>
<li>Current <code>mongo-c-driver</code> version <strong>v1.26.1</strong>.</li>
<li>Current zig version <strong>0.12.0-dev.2711+f995c1b08</strong>.</li>
<li>Tested only on Linux Debian 11/12. Make sure the following packages available<ul>
<li>libssl-dev</li>
<li>openssl</li>
<li>libsasl2-dev</li>
<li>zstd-dev</li>
<li>libsnappy-dev</li>
</ul>
</li>
</ul>
<strong>NOTE</strong>: package <code>libresolv</code> somehow cannot pickup when doing system library linking, <a>similar issue here</a> so its static mode is packed in <code>zmongo</code> (copied from /usr/lib/x86_64-linux-gnu/libresolv.a from Debian 11 system library).
<strong>This is work in progress</strong>
How to use
See <code>example</code> for detail how to setup.
<code>example</code> can be run as following:
<ul>
<li>
Run mongodb server in docker: <code>bash ./libmongoc/mongodb-server.sh</code>.
</li>
<li>
Run the example in <code>example</code> folder:
</li>
</ul>
<code>bash
cd example
zig build run</code> | [] |
https://avatars.githubusercontent.com/u/20740760?v=4 | zigtor | duyquang6/zigtor | 2024-05-12T14:48:30Z | A torrent client written in Zig | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/duyquang6/zigtor/tags | MIT | [
"torrent",
"torrent-client",
"zig",
"ziglang"
] | 79 | false | 2024-06-12T16:47:43Z | true | true | unknown | github | [] | zigtor
A torrent client written in Zig | [] |
https://avatars.githubusercontent.com/u/72211350?v=4 | OBEd | Snikimonkd/OBEd | 2024-03-02T19:26:07Z | null | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/Snikimonkd/OBEd/tags | - | [
"april-fools",
"editor",
"text-editor",
"zig"
] | 1,561 | false | 2024-07-05T09:36:13Z | true | false | unknown | github | [] | OBEd
Keybindings
Movement: arrows (←,↑,→,↓)
Save: ctrl+s
Exit: ctrl+q
Preview
https://github.com/Snikimonkd/OBEd/assets/72211350/365e3657-f746-46cb-b523-017948344a00
How to build
Install zig:
<code>brew install zig</code>
Clone repo:
<code>https://github.com/Snikimonkd/OBEd.git</code>
Build:
<code>cd OBEd
make build</code>
Run:
<code>touch kek.txt
./zig-out/bin/OBEd kek.txt</code> | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | zig-percent-encoding | bcrist/zig-percent-encoding | 2024-06-09T23:53:14Z | Percent (URL) Encoding and Decoding for Zig | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/bcrist/zig-percent-encoding/tags | MIT | [
"encoding",
"percent-encoding",
"urlencode",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 34 | false | 2025-04-27T02:12:54Z | true | true | 0.12.0 | github | [] | Percent (URL) Encoding and Decoding for Zig
This library can be used in a variety of ways:
<ul>
<li>Use <code>encode()</code> or <code>decode()</code> directly as an iterator. They will return slices of the output until the whole input string has been encoded or decoded.</li>
<li>Use <code>encode_alloc()</code> or <code>decode_alloc()</code>. It will always return a single slice allocated from the provided allocator, even if the output is identical to the input.</li>
<li>Use <code>encode_append()</code> or <code>decode_append()</code>. Instead of an allocator, you can pass a <code>*std.ArrayList(u8)</code> and the result will be appended to it. The input string must not be owned by the ArrayList.</li>
<li>Use <code>encode_maybe_append()</code> or <code>decode_maybe_append()</code>. Similar to <code>*_append()</code>, except the ArrayList won't be modified if the input and output are identical. The input string must not be owned by the ArrayList. Returns either the input string, or a slice from the ArrayList. The ArrayList does not need to be empty and won't be cleared before appending.</li>
<li>Use <code>std.fmt.Formatter</code> aware APIs with <code>fmtEncoded()</code>.</li>
</ul>
<code>Encode_Options</code> can specify which kinds of bytes are encoded independently for:
* ASCII alphabetical characters (<code>[A-Za-z]</code>)
* Decimal digits (<code>[0-9]</code>)
* spaces
* ASCII symbols
* C0 control characters and bytes >= 0x80
The default <code>Encode_Options</code> is conservative; it will encode <code>application/x-www-form-urlencoded</code> data according to <a>HTML's rules</a>, except that spaces will be encoded as <code>%20</code> instead of <code>+</code>. Servers generally don't care if <code>%20</code> or <code>+</code> is used, so this shouldn't be a problem, and it means it can also be used safely to escape URI data. Encoding spaces as <code>+</code> can be enabled explicitly if desired.
When decoding, <code>+</code> <em>will</em> be treated as a space by default, so make sure you turn this off explicitly if you're processing data where <code>+</code> is meant to be an unencoded literal <code>+</code>.
Encoding with <code>std</code>
Consider using the standard library's <a><code>std.Uri.Component.percentEncode</code></a> when:
* You have a writer available
* You don't mind creating an <code>isValidChar</code> helper function to pass in
* You don't need to encode spaces as <code>+</code>
Decoding with <code>std</code>
The standard library provides <a><code>std.Uri.percentDecodeInPlace</code></a>/<a><code>std.Uri.percentDecodeBackwards</code></a> however these require a preallocated mutable output buffer. Additionally, they do not support decoding <code>+</code> as a space.
Performance comparison
It's highly unlikely that percent encoding/decoding will be a bottleneck for most applications, but some performance comparisons with the <code>std</code> implementations are provided in the <code>benchmark.zig</code> file and can be run with <code>zig build benchmark</code>. As with all microbenchmarks, take the results with several grains of salt.
Here are the results from my machine:
| | Debug | Release |
| -------------------------------- | --------- | --------- |
| percent_encoding.encode_append | 6.2 ns/B | 1.7 ns/B |
| percent_encoding.fmtEncoded | 7.8 ns/B | 1.9 ns/B |
| percent_encoding.encode_writer | 8.0 ns/B | 1.8 ns/B |
| std.Uri.Component.percentEncode | 12 ns/B | 2.4 ns/B |
| percent_encoding.decode_in_place | 7.7 ns/B | 0.84 ns/B |
| std.Uri.percentDecodeInPlace | 8.9 ns/B | 0.83 ns/B | | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | X11.zig | tiawl/X11.zig | 2024-03-15T07:42:03Z | X11 headers packaged for @ziglang | trunk | 1 | 3 | 1 | 3 | https://api.github.com/repos/tiawl/X11.zig/tags | Unlicense | [
"binding",
"spaceporn",
"x11",
"zig",
"zig-package",
"ziglang"
] | 1,020 | false | 2025-05-10T00:02:24Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
}
] | X11.zig
This is a fork of <a>hexops/x11-headers</a> which itself gather various <a>X11</a> headers <a>GLFW</a> needs.
Why this forkception ?
The intention under this fork is the same as <a>hexops</a> had when they opened their repository: gather <a>X11</a> headers and package them to compile <a>GLFW</a> with <a>Zig</a>.
However this repository has subtle differences for maintainability tasks:
* No shell scripting,
* A cron runs every day to check <a>X11</a> repositories. Then it updates this repository if a new release is available.
How to use it
The current usage of this repository is centered around <a>tiawl/glfw.zig</a> compilation. But you could use it for your own projects. Headers are here and there are no planned evolution to modify them. See <a>tiawl/glfw.zig</a> to see how you can use it. Maybe for your own need, some headers are missing. If it happens, open an issue: this repository is open to potential usage evolution.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>xorg/lib/libx11</a>
* <a>xorg/lib/libxcb</a>
* <a>xorg/proto/xcbproto</a>
* <a>xorg/lib/libxcursor</a>
* <a>xorg/lib/libxext</a>
* <a>xorg/lib/libxfixes</a>
* <a>xorg/lib/libxi</a>
* <a>xorg/lib/libxinerama</a>
* <a>xkbcommon/libxkbcommon</a>
* <a>xorg/proto/xorgproto</a>
* <a>xorg/lib/libxrandr</a>
* <a>xorg/lib/libxrender</a>
* <a>xorg/lib/libxscrnsaver</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/glfw.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>xorg/lib/libx11</a>
* <a>xorg/lib/libxcb</a>
* <a>xorg/proto/xcbproto</a>
* <a>xorg/lib/libxcursor</a>
* <a>xorg/lib/libxext</a>
* <a>xorg/lib/libxfixes</a>
* <a>xorg/lib/libxi</a>
* <a>xorg/lib/libxinerama</a>
* <a>xkbcommon/libxkbcommon</a>
* <a>xorg/proto/xorgproto</a>
* <a>xorg/lib/libxrandr</a>
* <a>xorg/lib/libxrender</a>
* <a>xorg/lib/libxscrnsaver</a>
* <a>tiawl/toolbox</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/91665686?v=4 | Raylib-Zig-Nix | Miou-zora/Raylib-Zig-Nix | 2024-04-13T16:29:31Z | Minimal project for Raylib + Zig (0.13.0) + Nix | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/Miou-zora/Raylib-Zig-Nix/tags | MIT | [
"nix",
"raylib",
"raylib-zig",
"wsl",
"zig"
] | 18 | false | 2025-04-10T16:31:20Z | true | false | unknown | github | [] | Nix Flake for Zig + Raylib
This repository is a Nix flake for building Zig projects with Raylib. It is currently based on the <code>master</code> branch of Zig with the <a>Zig-overlay</a>. It use the <code>raylib</code> package from the Nixpkgs repository.
This repository is meant to be used as a template for Zig projects that use Raylib. It provides a <code>flake.nix</code> file that create a development environment with Zig and Raylib. It also provides a <code>build.zig</code> file that can be used to build the project.
<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>
It's a direct raylib binding from C to Zig. It's not a wrapper around the C library.
</blockquote>
:bookmark_tabs: Requirements
<ul>
<li>:cherry_blossom: <a>Nix</a></li>
</ul>
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
You will need to enable <code>nix-command</code> and <code>flakes</code>experimental features
If you get an error about it, consider this command:
<code>mkdir -p ~/.config/nix && echo "experimental-features = nix-command flakes" | tee ~/.config/nix/nix.conf</code>
</blockquote>
:zap: Usage
:wrench: Setup
Clone this repository and run <code>nix develop</code> to enter the development environment
<code>shell
git clone https://github.com/Miou-zora/Raylib-Zig-Nix.git
cd Raylib-Zig-Nix
nix develop</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>
Don't forget to remove the <code>.git</code> folder if you want to use this repository for a project.
Rename every <code>name_of_your_project</code> in the project by the name of your project.
</blockquote>
:construction_worker: Building
<code>shell
zig build</code>
:rocket: Running
```shell
It will build the project and run it. (do nothing if the project is already built)
zig build run
or you can run the executable directly
./zig-out/bin/[name_of_your_project]
```
<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>
<code>nix build</code> is not supported yet. If you try to use it, it will create a <code>result</code> symlink that contain the executable BUT musl isn't linked correctly to binary. It would be appreciated if someone could help me to fix this issue.
</blockquote>
:heavy_plus_sign: Using direnv
You may load the devShell automatically using <a>direnv</a>
shell integration.
<code>echo "use flake" | tee .envrc
direnv allow</code> | [] |
https://avatars.githubusercontent.com/u/442455?v=4 | imguinz | dinau/imguinz | 2024-06-26T01:03:07Z | Examples project using Dear Imgui (CImGui), ImPlot (CImPlot) with Zig language zig-0.14 or later | main | 0 | 3 | 0 | 3 | https://api.github.com/repos/dinau/imguinz/tags | MIT | [
"cimgui",
"cimplot",
"font-awesome",
"glfw",
"imgui",
"imknobs",
"implot",
"implot3d",
"imspinner",
"imtoggle",
"sdl2",
"sdl3",
"zig",
"zig-lang",
"ziglang"
] | 58,096 | false | 2025-04-06T12:20:00Z | false | false | unknown | github | [] |
<ul>
<li><a>ImGuinZ</a></li>
<li><a>Prerequisites</a></li>
<li><a>Build and run</a></li>
<li><a>Examples screen shots</a><ul>
<li><a>ImGui-Toggle / CImGui-Toggle</a></li>
<li><a>ImGui-Knobs / CImGui-Knobs</a></li>
<li><a>ImSpinner / CImSpinner</a></li>
<li><a>Image load</a></li>
<li><a>Showing CJK multi byte fonts and input UTF-8 text</a></li>
<li><a>Icon font viewer</a></li>
<li><a>Image load / save</a></li>
<li><a>glfw_opengl3_implot</a></li>
</ul>
</li>
<li><a>ImPlot Demo written in Zig lang.</a><ul>
<li><a>Build and run</a></li>
<li><a>ImPlot demo source in Zig lang.</a></li>
<li><a>Plots Tab</a></li>
<li><a>LinePlots (Dynamic)</a></li>
<li><a>BarGroups</a></li>
<li><a>BarStacks</a></li>
<li><a>PieCharts</a></li>
<li><a>Heatmaps</a></li>
<li><a>Histogram2D</a></li>
<li><a>Images</a></li>
<li><a>Axes Tab</a></li>
<li><a>LogScale</a></li>
<li><a>Subplots Tab</a></li>
<li><a>Tables (Dynamic)</a></li>
<li><a>Tools Tab</a></li>
<li><a>DragRects</a></li>
</ul>
</li>
<li><a>Show / Hide console window</a></li>
<li><a>SDL libraries</a></li>
<li><a>My tools version</a><ul>
<li><a>Similar project ImGui / CImGui</a></li>
<li><a>SDL game tutorial Platfromer</a></li>
</ul>
</li>
</ul>
ImGuinZ
This project aims to simply and easily build <a>Dear ImGui</a>
<a>(CImGui)</a> / <a>ImPlot</a> <a>(CImPlot)</a>
examples in Zig language with less external dependencies.
<ul>
<li>ImGui / CImGui version <strong>1.91.8dock</strong> (2025/02)</li>
<li>OS: Windows and Linux</li>
<li>Frontends and Backends </li>
</ul>
| | GLFW | SDL2 | SDL3 |
| --- | :----: | :---- | :----: |
| OpenGL3backend | v | v | v |
<ul>
<li>Features </li>
<li>Included <a>Font Awesome</a> Icon fonts.
</li>
<li>Included GLFW 3.4.0 static library (for Windows)</li>
<li>Included SDL2/SDL3 libraries (for Windows)</li>
<li>Included STB libraries (only stb_image) for Load / Save images</li>
<li>Available <a>ImPlot</a> <a>(CImPlot)</a> with <code>ImDrawIdx="unsigned int"</code></li>
<li>Enabled Input method (IME) flag with <code>IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS</code></li>
</ul>
Prerequisites
<ul>
<li>Zig version confirmed (2025/03) </li>
<li>Windows: <a>zig-windows-x86_64-0.14.0.zip</a></li>
<li>
Linux: <a>zig-linux-x86_64-0.14.0.tar.xz</a>
</li>
<li>
WindowsOS
</li>
<li>Windows10 or later</li>
<li>MSys2/MinGW basic commands (make, rm, cp, strip ...)</li>
<li>Linux OS (Ubuntu / Debian families)</li>
</ul>
<code>sh
$ sudo apt install xorg-dev libopengl-dev libgl1-mesa-dev</code>
and for glfw3 and sdl2,
<code>sh
$ sudo apt install libglfw3 libglfw3-dev
$ sudo apt install libsdl2-dev</code>
Build and run
<ol>
<li>Download this project.</li>
</ol>
<code>sh
git clone --recurse-submodules https://github.com/dinau/imguinz</code>
1. Go to one of the examples folder,
<code>sh
cd imguinz/examples/glfw_opengl3</code>
<ol>
<li>Build and Run </li>
</ol>
<code>sh
make run # or zig build --release=fast run</code>
Examples screen shots
<a>ImGui-Toggle</a> / <a>CImGui-Toggle</a>
<a>glfw_opengl3_imgui_toggle.zig</a>
<a>ImGui-Knobs</a> / <a>CImGui-Knobs</a>
<a>glfw_opengl3_imknobs.zig</a>
<a>ImSpinner</a> / <a>CImSpinner</a>
<a>glfw_opengl3_imspinner.zig</a>
Image load
Image load and magnifying glass
<a>glfw_opengl3.zig</a>
<a>sdl2_opengl3.zig</a>
<a>sdl3_opengl3.zig</a>
Showing CJK multi byte fonts and input UTF-8 text
<a>glfw_opengl3_jp.zig</a>
Icon font viewer
<a>iconFontViewer.zig</a> and magnifying glass
Image load / save
Image load / save and magnifying glass.
Image file captured would be saved in .the folder <code>./zig-out/bin</code>.
Image can be saved as <code>JPEG / PNG / BMP / TGA</code> file.
<a>glfw_opengl3_image_load.zig</a>
glfw_opengl3_implot
<a>glfw_opengl3_implot.zig</a>
ImPlot Demo written in Zig lang.
Now work in progress.
Build and run
<code>sh
pwd
examples/imPlotDemo
make run # or zig build --release=fast run</code>
ImPlot demo source in Zig lang.
<a>demoAll.zig</a>
Plots Tab
LinePlots (Dynamic)
BarGroups
BarStacks
PieCharts
Heatmaps
Histogram2D
Images
Axes Tab
LogScale
Subplots Tab
Tables (Dynamic)
Tools Tab
DragRects
Show / Hide console window
Open <code>build.zig</code> in each example folder and
Hide console window: Default,
Show console window: Comment out this line as follows,
<code>zig
... snip ...
//exe.subsystem = .Windows; // Hide console window
... snip ...</code>
and rebuild example.
SDL libraries
<ul>
<li>
SDL3
https://github.com/libsdl-org/SDL/releases
</li>
<li>
SDL3 Build-SDL3
https://github.com/mmozeiko/build-sdl3/releases
https://github.com/mmozeiko/build-sdl3
</li>
<li>SDL3 Build-SDL3-Win32
https://github.com/JBetz/build-sdl3-win32/releases
https://github.com/JBetz/build-sdl3-win32</li>
</ul>
My tools version
<ul>
<li>Windows11 (main)</li>
<li>Make: GNU Make 4.4.1</li>
<li>SDL2 ver.2.32.0</li>
<li>SDL3 3.2.6</li>
<li>Git version 2.46.0.windows.1</li>
<li>Debian (sub)</li>
<li>Make: GNU Make 4.3</li>
<li>SDL2 ver.2.30.0</li>
<li>Git version 2.43.0</li>
</ul>
Similar project ImGui / CImGui
| Language [^order] | | Project |
| -------------------: | :---: | :----------------------------------------------------------------: |
| <strong>Lua</strong> | Script | <a>LuaJITImGui</a> |
| <strong>NeLua</strong> | Compiler | <a>NeLuaImGui</a> |
| <strong>Nim</strong> | Compiler | <a>ImGuin</a>, <a>Nimgl_test</a>, <a>Nim_implot</a> |
| <strong>Python</strong> | Script | <a>DearPyGui for 32bit WindowsOS Binary</a> |
| <strong>Ruby</strong> | Script | <a>igRuby_Examples</a> |
| <strong>Zig</strong>, C lang. | Compiler | <a>Dear_Bindings_Build</a> |
| <strong>Zig</strong> | Compiler | <a>ImGuinZ</a> |
SDL game tutorial Platfromer
| Language [^order] | | SDL | Project |
| -------------------: | :---: | :---: | :----------------------------------------------------------------: |
| <strong>LuaJIT</strong> | Script | SDL2 | <a>LuaJIT-Platformer</a>
| <strong>Nelua</strong> | Compiler | SDL2 | <a>NeLua-Platformer</a>
| <strong>Nim</strong> | Compiler | SDL3 / SDL2 | <a>Nim-Platformer-sdl2</a>/ <a>Nim-Platformer-sdl3</a> |
| <strong>Ruby</strong> | Script | SDL3 | <a>Ruby-Platformer</a> |
| <strong>Zig</strong> | Compiler | SDL2 | <a>Zig-Platformer</a> |
[^order]: Alphabectial order | [] |
https://avatars.githubusercontent.com/u/554766?v=4 | handmade-zig | zoeesilcock/handmade-zig | 2024-05-23T05:23:29Z | Learning Zig by following along with the Handmade Hero series of videos by Casey Muratori. | master | 0 | 2 | 1 | 2 | https://api.github.com/repos/zoeesilcock/handmade-zig/tags | - | [
"game-development",
"handmade-hero",
"zig"
] | 1,410 | false | 2025-05-22T04:05:09Z | true | true | 0.14.0 | github | [
{
"commit": "e8739b32a33ce48a3286aba31918b26a9dfc6ef0.tar.gz",
"name": "zigwin32",
"tar_url": "https://github.com/marlersoft/zigwin32/archive/e8739b32a33ce48a3286aba31918b26a9dfc6ef0.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/marlersoft/zigwin32"
},
{
"commit": "f75e8d1... | Handmade Zig
Learning Zig by following along with the <a>Handmade Hero</a> series of videos by Casey Muratori.
Assets
Graphical assets are not included as they are not created by me. They need to be added to the <code>data/</code> directory manually. We currently expect the assets found in this location of the pre-order data: <code>handmade_hero_legacy_art.zip/v0_hhas</code>.
Packing the assets
The asset files need to be packed using the asset packer before running the game. The current version of the asset builder doesn't produce files compatible with the game anymore since we made the reader compatible with asset files created by Casey, use the original files from <code>handmade_hero_legacy_art.zip/v0_hhas</code>.
<code>zig build build-assets</code>
Debugging
The included debugger config under <code>.vscode/launch.json</code> is compatible with the <a>nvim-dap plugin</a> in Neovim and the <a>C/C++ extension</a> in VS Code. Using Visual Studio with C/C++ tooling appears to give the most reliable results. Another alternative that works almost as well as Visual Studio is <a>Rad Debugger</a>.
When running outside of an IDE, <code>OutputDebugString</code> messages can be viewed using <a>DebugView</a>.
Build options
<ul>
<li>Timing: use the <code>-Dtiming</code> flag when building to enable printing timing (ms/frame, fps and cycles/frame) to the debug output.</li>
</ul>
Analyzing generated assembly
The build is setup to emit the generated assembly code which can be used to analyze the code for bottlenecks using <code>llvm-mca</code> which is bundled with LLVM version 18+.
<code>asm volatile("# LLVM-MCA-BEGIN ProcessPixel");
// Code to analyze.
// ...
asm volatile("# LLVM-MCA-END ProcessPixel");</code>
Analyze the emitted assembly code:
<code>llvm-mca .\zig-out\bin\handmade-dll.asm -bottleneck-analysis -o .\zig-out\bin\handmade-dll-mca.txt</code>
Reference
Intel
<ul>
<li>https://www.intel.com/content/www/us/en/docs/intrinsics-guide</li>
<li>https://www.intel.com/content/www/us/en/developer/articles/technical/intel-sdm.html</li>
</ul>
AMD
<ul>
<li>https://learn.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list?view=msvc-170</li>
<li>https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/programmer-references/24592.pdf</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/8929752?v=4 | ZigMatrixUtils | vbrusca/ZigMatrixUtils | 2024-03-14T12:32:39Z | A matrix utility library written in Zig. Provides functions and tools for manipulating matrices and solving linear algebra problems. A great source for leaning about the Zig programming language. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/vbrusca/ZigMatrixUtils/tags | GPL-3.0 | [
"matrices",
"matrix",
"zig"
] | 65,913 | false | 2024-09-20T15:45:41Z | true | false | unknown | github | [] | Zig Matrix Utils
An open source matrix utility library written in Zig.
The full Zig project is included in this repo.
Zig Build Version
This project was built against Zig version "zig-windows-x86_64-0.14.0-dev.1588+2111f4c38".
Developers
Victor Brusca
Carlo Bruscani
Documentation
I'll provide a viewable but not 100% usable link to the Zig Matrix Utils documentation here. Links don't work but you can browse the functions and their signature. For proper use clone or download the repo and view the documentation site locally.
<a>Zig Generated API Docs</a>
Source Material
This project was built using the following books as a basis.
1. Elementary Linear Algebra by Larson, Edwards
2. Mathematics for 3D Game Programming and Computer Graphics 3rd Edition by Eric Lengyel
Project Goals
Having worked on this project solo for a while I've almost reached my initial goal of porting the main body of material over to the Zig programming language.
After the completion of chapter 6's material I'm going to switch gears for a little while and work on another coding project. This library will receive long-term updates
in the interim period.
<ol>
<li>LT: Continuous development to complete the material regarding linear algebra and matrix manipulations.</li>
<li>LT: Normalize the use of const across all slice based function arguments, refine function arguments.</li>
<li>LT: To keep the project up to date with new versions of Zig as the language matures.</li>
<li>LT: To complete and refine the code documentation.</li>
<li>ST: Version 0.64 - 0.65: Complete base material for chapter 6 including the remaining sections 6.4 and 6.5.</li>
<li>ST: Add execution time tracking to the remaining theorem, problem, and unit tests.</li>
<li>ST: To complete all missing function documentation, unit tests, and extended tests.</li>
<li>LT: Revisit the project and apply needed material for chapter 7.</li>
</ol>
Running Unit Tests
You can run the full set of unit tests from inside the project with the following command.
zig test ./src/main.zig
There are over 350 test run to verify functionality. Feel free to think of them as demonstrations of the associated functions. You can also capture the test output with the following command on DOS terminals. You'll have to search around and find an equivalent command if you are on MacOS, Linux, or Unix for your respective shell.
zig test ./src/main.zig > all_test_output.txt 2>&1
Currently the library sets each module to use fast floating point math. This has already shown a positive impact in the performance of different functions in the function execution time list. If there is some instability in floating point math just comment out this line in the header of main.zig and XmtxUtils.zig.
comptime {
@setFloatMode(std.builtin.FloatMode.optimized); //Optimized);
}
Project Build Commands
How to build an exe (NOT USED). There is no real main code for this library currently.
zig build-exe -femit-docs ./src/main.zig -O ReleaseSmall -fstrip -fsingle-threaded -femit-bin="zig-out/bin/main.exe"
How to build a static library.
zig build-lib -femit-docs ./src/XmtxUtils.zig -O ReleaseSmall -fstrip -fsingle-threaded -femit-bin="zig-out/lib/XmtxUtils.lib"
How to build an object.
zig build-obj -femit-docs ./src/XmtxUtils.zig -O ReleaseSmall -fstrip -fsingle-threaded -femit-bin="zig-out/lib/XmtxUtils.obj"
How to build a dynamic library.
zig build-lib -femit-docs ./src/XmtxUtils.zig -lc -dynamic -isystem -fstrip -fsingle-threaded -femit-bin="zig-out/lib/XmtxUtils.dll"
Guides
You can look into specific use cases for the library in the "Guides" section.
**Please note that the guides may be slightly out of sync with regard to the latest version of the library as it develops. Those gaps will be closed periodically over time and as a better way of tracking the guides associated with code changes evolves. The guides associate library functions with vector and matrix actions etc. You can use them as a loose example of how to use the library. For more complex and comprehensive use cases check the unit tests for theorems, examples, and problems from the basis text books.
<a>Guides</a>
Rough Example of Usage
test "XMTX: MF3D - Lengyel: Theorem 3.21 test" {
prntNl();
//Let F be an n X n matrix and let the entries of n X n matrix G be defined as
//Gij = Cji(F) * (1 / detF)
//where Cji(F) is the cofactor of (F^Tij) then G = F^-1
//Gij = Cij(F^T) * (1 / detF)
//Cij(H) = (-1)^(i + j)detH
std.debug.print("Test 1:\n", .{});
const alloc: std.mem.Allocator = std.testing.allocator;
var F: [4]f32 = .{ 5, 6, 8, 9 };
var invF: [4]f32 = .{ 0, 0, 0, 0 };
var cols: usize = 2;
std.debug.print("F Matrix:\n", .{});
clnXmtx(&F);
prntXmtx(&F, cols);
const detF = try detXmtx(&F, cols, &alloc, 0);
std.debug.print("detF = {}\n", .{detF});
F = .{ 5, 6, 8, 9 };
var idtF: [4]f32 = .{ 1, 0, 0, 1 };
var sclr: f32 = 0.0;
var b: bool = rdcXmtxInl(&F, cols, false, true, &idtF, 2, false, &sclr);
try std.testing.expectEqual(true, b);
std.debug.print("Calculated inverse F (should be identity matrix):\n", .{});
clnXmtx(&F);
prntXmtx(&F, cols);
try std.testing.expectEqual(true, isIdtXmtx(&F, cols));
std.debug.print("Calculated inverse F (should be inverse matrix):\n", .{});
clnXmtx(&idtF);
prntXmtx(&idtF, cols);
F = .{ 5, 6, 8, 9 };
b = getInvFromDet2(&F, detF, &invF);
try std.testing.expectEqual(true, b);
std.debug.print("Generated inverse from detF (should be inverse matrix):\n", .{});
clnXmtx(&invF);
prntXmtx(&invF, cols);
try std.testing.expectEqual(true, equXmtx(&idtF, &invF));
std.debug.print("Test 2:\n", .{});
var F2: [9]f32 = .{ 2, 3, 8, 6, 0, -3, -1, 3, 2 };
var invF2: [9]f32 = .{ 0, 0, 0, 0, 0, 0, 0, 0, 0 };
cols = 3;
std.debug.print("F2 Matrix:\n", .{});
clnXmtx(&F2);
prntXmtx(&F2, cols);
const detF2 = try detXmtx(&F2, cols, &alloc, 0);
std.debug.print("detF2 = {}\n", .{detF2});
F2 = .{ 2, 3, 8, 6, 0, -3, -1, 3, 2 };
var idtF2: [9]f32 = .{ 1, 0, 0, 0, 1, 0, 0, 0, 1 };
sclr = 0.0;
b = rdcXmtxInl(&F2, cols, false, true, &idtF2, 3, false, &sclr);
try std.testing.expectEqual(true, b);
std.debug.print("Calculated inverse F2 (should be identity matrix):\n", .{});
clnXmtx(&F2);
prntXmtx(&F2, cols);
try std.testing.expectEqual(true, isIdtXmtx(&F2, cols));
std.debug.print("Calculated inverse F2 (should be inverse matrix):\n", .{});
clnXmtx(&idtF2);
prntXmtx(&idtF2, cols);
F2 = .{ 2, 3, 8, 6, 0, -3, -1, 3, 2 };
b = getInvFromDet3(&F2, detF2, &invF2);
try std.testing.expectEqual(true, b);
std.debug.print("Generated inverse from detF2 (should be inverse matrix):\n", .{});
clnXmtx(&invF2);
prntXmtx(&invF2, cols);
try std.testing.expectEqual(true, equXmtx(&idtF2, &invF2));
}
Execution Times
Execution times are calculated after the last unit test that uses them. You can find the execution time summary in the test output by searching for the term "Function Execution Times List". An example of the execution time summary list is shown below.
Function Execution Times List:
absF32: Count: 1.0e+00 Avg: 0.000ms 200.000ns
absF32Ref: Count: 1.0e+00 Avg: 0.000ms 100.000ns
absF32Ret: Count: 1.0e+00 Avg: 0.000ms 100.000ns
absXmtx: Count: 2.0e+00 Avg: 0.000ms 300.000ns
addSclMulXmtxRows: Count: 1.0e+00 Avg: 0.001ms 500.000ns
addSclMulXmtxRowsInl: Count: 1.0e+00 Avg: 0.000ms 200.000ns
addSclXmtxRows: Count: 1.0e+00 Avg: 0.000ms 300.000ns
addSclXmtxRowsInl: Count: 1.0e+00 Avg: 0.005ms 4900.000ns
addXvec: Count: 1.0e+00 Avg: 0.000ms 200.000ns
adjXmtx3: Count: 1.0e+00 Avg: 0.012ms 12200.000ns
adjXmtx4: Count: 1.0e+00 Avg: 0.013ms 12600.000ns
aglBtwnXvec: Count: 1.0e+00 Avg: 0.009ms 9400.000ns
altXmtxRows: Count: 1.0e+00 Avg: 0.001ms 500.000ns
...
You can see the function name, the usage count, and the average execution time in ms and ns. To effectively turn off this memory allocation set <b>MAX_EXEC_TIMES</b> equal to 1. It is only used by the unit test code, no library functions have execution time monitoring. | [] |
https://avatars.githubusercontent.com/u/170900029?v=4 | zenith | zenith-editor/zenith | 2024-04-11T16:22:57Z | [mirror] A very minimal text editor in Zig | master | 0 | 2 | 1 | 2 | https://api.github.com/repos/zenith-editor/zenith/tags | BSD-3-Clause | [
"text-editor",
"zig"
] | 1,034 | false | 2025-01-24T02:23:23Z | true | false | unknown | github | [] | zenith
<ul>
<li>
<strong>What it is:</strong> a console-based text editor
</li>
<li>
... that is easy to learn with familiar keyboard shortcuts
</li>
<li>... that is lightweight and requires no external dependencies</li>
<li>... that has most of the features in a regular text editor: syntax highlighting, word wrapping, pattern matching,...</li>
<li>
... that is written in Zig
</li>
<li>
<strong>What it is not:</strong> an IDE
</li>
</ul>
Requirements
<ul>
<li>An xterm-compatible terminal emulator</li>
</ul>
Build
*Building from source*
**Supported Zig version:** 0.12.0.
For debug builds, use the command:
```
make
```
For release:
```
make release
```
To install into a directory (i.e. `/opt`):
```
make install PREFIX="/opt"
```
You can also obtain a release tarball.
Usage
Zenith is a modal editor. It supports the following modes:
<ul>
<li>Text mode (default)</li>
<li>Block mode (or text marking mode)</li>
<li>Command mode</li>
</ul>
You can switch from any other mode back to text mode by pressing escape.
Navigation is done with the arrow keys, page up/down, home/end keys. Editing works as you would expect from a modern non-terminal based word processor.
For more help, press <code>^h</code> (ctrl-h) to show keyboard shortcuts. Press <code>^h</code> multiple times to scroll through the help pages.
To enable syntax highlighting, copy the config directory to the appropriate location. See <a>documentation</a> for details.
See also:
<ul>
<li><a>Config</a></li>
<li><a>Patterns</a></li>
</ul>
License
Copyright (c) 2024 T.M.
BSD License. See LICENSE file for more information. | [] |
https://avatars.githubusercontent.com/u/31665788?v=4 | rat | david-haerer/rat | 2024-03-11T15:15:02Z | keyboard. driven. mouse. | main | 1 | 2 | 0 | 2 | https://api.github.com/repos/david-haerer/rat/tags | MIT | [
"keyboard",
"linux",
"mouse",
"ui",
"x11",
"zig"
] | 31 | false | 2025-01-07T22:55:13Z | true | true | unknown | github | [] |
Rat 🐀
<em>keyboard. driven. mouse.</em>
Installation
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
Rat only works on Linux with X11 and only with a single display.
</blockquote>
Download the pre-built binary from the <a>GitHub Releases page</a> and add it to your <code>$PATH</code>.
<blockquote>
[!TIP]
For easy access define a keyboard shortcut to launch Rat.
</blockquote>
Keybindings
Rat grabs the keyboard during execution, such that only the following keys are active.
Modes
The following keys change the mode Rat is working in.
Rat starts in normal mode.
Key | Mode
----|---------
<code>q</code> | Exit Rat.
<code>s</code> | Scroll mode.
<code>ESCAPE</code> | Return to normal mode.
Directions
The following keys set the direction.
The action taken depends on the current mode.
<ul>
<li>In normal mode, the pointer is moved.</li>
<li>In scroll mode, the page is scrolled.</li>
</ul>
Key | Direction
----|---------
<code>h</code> / <code>LEFT</code> | Left
<code>y</code> | Left + 30° Up
<code>u</code> | Up + 30° Left
<code>k</code> / <code>UP</code> | Up
<code>i</code> | Up + 30° Right
<code>o</code> | Right + 30° Up
<code>l</code> / <code>RIGHT</code> | Right
<code>.</code> | Right + 30° Down
<code>,</code> | Down + 30° Right
<code>DOWN</code> / <code>j</code> | Down
<code>m</code> | Down + 30° Left
<code>n</code> | Left + 30° Down
Buttons
The following keys act as the three mouse buttons.
Key | Button
----|---------
<code>SPACE</code> | Left
<code>x</code> | Middle
<code>r</code> | Right
Alternatives
<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>
Since Rat is still in early development, here's a list of more mature alternatives.
If you know of a program that would fit this list, feel free to reach out ❤️
</blockquote>
Name | Platform | Description
----|----|-------
<a>warpd</a> | <code>X11</code> <code>Wayland</code> <code>macOS</code> | A modal keyboard driven interface for mouse manipulation.
<a>keynav</a> | <code>X11</code> | Control the mouse with the keyboard.
<a>keynavish</a> | <code>Windows</code> | Control the mouse with the keyboard, on Windows.
<a>TPMouse</a> | <code>Windows</code> | A virtual trackball for Windows, via vim-like homerow controls.
<a>AhkCoordGrid</a> | <code>Windows</code> | AutoHotkey code for Windows overlay grid allowing you to emulate mouse click at different points on the screen using keyboard shortcuts.
<a>Mouseable</a> | <code>Windows</code> | Control the mouse via the keyboard.
<a>win-vind</a> | <code>Windows</code> | You can operate Windows with key bindings like Vim.
<a>Scoot</a> | <code>macOS</code> | Your friendly cursor teleportation and actuation tool.
<a>Shortcat</a> | <code>macOS</code> | Manipulate macOS masterfully, minus the mouse.
<a>vimac</a> | <code>macOS</code> | Stop using your clunky trackpad/mouse now.
<a>Homerow</a> | <code>macOS</code> | Keyboard shortcuts for every button in macOS.
<a>Superkey</a> | <code>macOS</code> | Simple and powerful keyboard enhancement on macOS.
Troubleshooting
Dependencies
Make sure the <em>X11 Testing -- Record extension library</em> is installed.
<code>sh
sudo apt install libxtst6</code>
Logs
The log outputs of Rat can be found in <code>$HOME/.local/share/rat.log</code>.
Contributing
Thank you for considering to contribute ❤️!
Feedback
If you run into problems or have feedback, feel free to open a <a>GitHub issue</a>.
Development
If you want to work on the code yourself, see <a>DEVELOPMENT.md</a> for further documentation.
<blockquote>
[!TIP]
For ideas on what to work on, have a look at the <a>GitHub issues</a>.
</blockquote> | [] |
https://avatars.githubusercontent.com/u/33818?v=4 | chainguard-zig-cloud-run | wintermi/chainguard-zig-cloud-run | 2024-07-22T06:16:02Z | An example micro service written in Zig using the Zap Web Framework. Container images are built using the Chainguard Images ready for deployment to Google Cloud Run. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/wintermi/chainguard-zig-cloud-run/tags | Apache-2.0 | [
"chainguard-images",
"cloudbuild",
"cloudrun-service",
"google-cloud",
"google-cloud-platform",
"zig",
"ziglang"
] | 14 | false | 2024-10-03T13:02:20Z | false | false | unknown | github | [] | Example Zig Cloud Run Micro Service using the Chainguard Images
<a></a>
<a></a>
Description
An example micro service written in Zig using the Zap Web Framework. Container images are built using the Chainguard Images ready for deployment to Google Cloud Run.
In summary, the following components are used by this project:
<ul>
<li><a>Zig Programming Language</a></li>
<li><a>⚡Zap⚡ Web Framework</a></li>
<li><a>Chainguard Images</a></li>
<li><a>Google Cloud Build</a></li>
<li><a>Google Cloud Run</a></li>
</ul>
License
<strong>chainguard-zig-cloud-run</strong> is released under the <a>Apache License 2.0</a> unless explicitly mentioned in the file header. | [] |
https://avatars.githubusercontent.com/u/25912761?v=4 | ccdb | r4gus/ccdb | 2024-04-29T21:12:39Z | CBOR Credential Database Format | master | 1 | 2 | 0 | 2 | https://api.github.com/repos/r4gus/ccdb/tags | - | [
"credential-manager",
"credential-store",
"passkey",
"password",
"password-database",
"zig",
"zig-package"
] | 1,296 | false | 2025-03-30T21:49:19Z | true | true | 0.12.0 | github | [
{
"commit": "refs",
"name": "zbor",
"tar_url": "https://github.com/r4gus/zbor/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/r4gus/zbor"
},
{
"commit": "refs",
"name": "uuid",
"tar_url": "https://github.com/r4gus/uuid-zig/archive/refs.tar.gz",
"type": "rem... | CBOR Credential Database Format
This document describes a format to store secrets at rest based on the CBOR data format. It is designed as an alternative to other file formats like KDBX used with KeePass and KeePassXC.
Source Code
Installation
Versions:
| Zig version | ccdb version |
|:-----------:|:------------:|
| 0.13.0 | 0.1.0, 0.2.0 |
| 0.14.0 | 0.3.0 |
Module
The <code>ccdb</code> module can be added to your projects by adding <code>ccdb</code> to your list of dependencies in <code>build.zig.zon</code>.
<code>zig
.dependencies = .{
//...
.ccdb = .{
.url = "https://github.com/r4gus/ccdb/archive/refs/tags/0.1.0.tar.gz",
// Adjust the hash if you use another version!
.hash = "12202413b8cfe91ea51f3680b8eaa5645870a6e3fabc5cb9076c80f8182ea1d4028f",
},
},</code>
Alternatively you can use the following command, which will automatically add <code>ccdb</code> as an dependency to your <code>build.zig.zon</code> file:
```bash
Replace with the version you want to use
zig fetch --save https://github.com/r4gus/ccdb/archive/refs/tags/.tar.gz
```
You can then import the module within your <code>build.zig</code>.
```zig
const ccdb_dep = b.dependency("ccdb", .{
.target = target,
.optimize = optimize,
});
// Create a exe or library and then...
exe.root_module.addImport("ccdb", ccdb_dep.module("ccdb"));
```
Command Line Tool
You can manage a CCDB database from the command line using <code>ccdbcmd</code>. Run <code>build zig -Doptimize=ReleaseSmall</code>
to build the executable.
Documentation
You can build the documentation by running <code>bikeshed</code> within the <code>/docs</code> folder. | [
"https://github.com/Zig-Sec/PassKeeZ"
] |
https://avatars.githubusercontent.com/u/164784529?v=4 | zig-tools | bstrdlord/zig-tools | 2024-03-29T21:59:08Z | ⚡ Zig tools for vscode | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/bstrdlord/zig-tools/tags | - | [
"formatter",
"linter",
"snippets",
"vscode",
"vscode-extension",
"zig",
"zig-tools",
"zig-vscode",
"ziglang"
] | 7,199 | false | 2025-04-06T19:43:23Z | false | false | unknown | github | [] | Zig tools
<a></a>
⚡ Features
Data type hints on hover
Bitwise operation hints on hover
Convert a number from hexadecimal to decimal
| [] |
https://avatars.githubusercontent.com/u/163546630?v=4 | zinc-examples | zon-dev/zinc-examples | 2024-04-13T10:51:53Z | Examples of Zinc framework. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/zon-dev/zinc-examples/tags | - | [
"backend",
"framework",
"web",
"web-framework",
"zig",
"ziglang",
"zinc"
] | 59 | false | 2025-04-26T15:57:01Z | true | true | unknown | github | [
{
"commit": null,
"name": "zinc",
"tar_url": null,
"type": "relative",
"url": "../zinc"
}
] | Zinc Examples
This repository contains a number of ready-to-run examples demonstrating various use cases of Zinc.
<code>git clone https://github.com/zon-dev/zinc-examples.git
cd zinc-examples
zig fetch --save https://github.com/zon-dev/zinc/archive/refs/heads/main.zip
zig build</code>
All samples in the <code>examples</code> folder. Run one of the sample use command <code>zig build run-{sample_name}</code>. E.g.
<code>zig build run-basic</code> | [] |
https://avatars.githubusercontent.com/u/104397667?v=4 | Ziglings-on-Colab | RGambarini/Ziglings-on-Colab | 2024-03-07T13:50:02Z | Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. Ziglings are tiny broken programs written in zig that can be used to learn the language. This serves as an extension of the repo https://codeberg.org/ziglings/exercises to provide a Google Colab notebook for the exercises | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/RGambarini/Ziglings-on-Colab/tags | MIT | [
"zig",
"ziglang",
"ziglearn"
] | 105 | false | 2025-05-16T06:11:42Z | false | false | unknown | github | [] | Ziglings-on-Colab
Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. Ziglings are tiny broken programs written in zig that can be used to learn the language. This serves as an extension of the original repo https://codeberg.org/ziglings/exercises to provide a <a>Google Colab notebook</a> for the exercises.
Link to the notebook: https://colab.research.google.com/drive/1W34UVnRQDH_2KpYVIfUvjKwPBuupp8tO?usp=sharing
Note: Copy the notebook by going 'File' > 'Save a copy in Drive' in the toolbar of the notebook.
This repo is intended to be self serving by providing the python code to generate the neccesary notebook. If not updated to the latest version, modify the python script with the appropriate link for the x86_64 architecture. The script clones the <a>Ziglings repo</a> now hosted in codeberg that can be used, preferentially, in Google Colab.
The notebook is organized so that it first installs zig into the runtime and adds the path of the installation. There is no need to keep the installation saved in your drive as zig in its nature is intended to be quick to download and install. Every code cell thereafter is automatically organized in the manner in which it is intended in the original repo. The files are written using magic commands and it is followed by an execution cell.
Other useful links:
Zig website: https://ziglang.org
Current documentation for zig: https://ziglang.org/learn/
Cookbook: https://zigcc.github.io/zig-cookbook/ | [] |
https://avatars.githubusercontent.com/u/5464072?v=4 | zig-intrusive-parser | nektro/zig-intrusive-parser | 2024-06-04T19:37:19Z | Core plumbing to make text or binary document parsers with Data Oriented Design | master | 0 | 2 | 1 | 2 | https://api.github.com/repos/nektro/zig-intrusive-parser/tags | MPL-2.0 | [
"zig",
"zig-package"
] | 18 | false | 2025-05-21T20:33:50Z | true | false | unknown | github | [] | zig-intrusive-parser
<a></a>
<a></a>
<a></a>
<a></a>
Core plumbing to make text or binary document parsers with Data Oriented Design
Used by
<ul>
<li>https://github.com/nektro/zig-json</li>
<li>https://github.com/nektro/zig-webidl</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/98186360?v=4 | zxd | caio-bernardo/zxd | 2024-07-11T20:54:41Z | xxd clone built with Zig | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/caio-bernardo/zxd/tags | MIT | [
"xxd",
"zig"
] | 36 | false | 2024-12-24T02:07:38Z | true | true | unknown | github | [] | ZEX DUMP
A <code>xxd</code> clone build with Zig Programming Language
Features
<ul>
<li>Display a file as hex, with offset and ascii format</li>
<li>Customize bytes groupings, endianess, by offset and more..</li>
<li>Revert the workflow! Take a hexdump and convert it back to binary format</li>
</ul>
How to use
Clone this repo. Open the projects folder, and compile it
<code>sh
zig build</code>
and access the binary inside <em>zig-out</em>
or, e.g.
<code>zig build run -- binfile</code>
Roadmap
<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> Basic <code>xxd</code> features, (autoskip, toggle offset, group size, endianess...)
<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> More complex things (outfile, output to C style, ...) <strong>COMING SOON</strong>
Acknowledgments
This project was inspired by:
<ul>
<li>Low Level Learning</li>
<li>Coding Challenges</li>
<li><code>xxd</code> tool</li>
</ul>
License
This project is under the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/14790226?v=4 | shellcodez | chivay/shellcodez | 2024-03-02T01:29:32Z | Zig-based shellcode builder | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/chivay/shellcodez/tags | - | [
"shellcode",
"zig"
] | 9 | false | 2025-01-05T04:56:07Z | true | false | unknown | github | [] | shellcodez
making headerless PIEs :cake: for fun and no profit.
Supported shellcodez:
* <a>execve</a> - spawn /bin/sh
* <a>revshell</a> - connect to target and spawn /bin/sh
Output file sizes:
```
124 execve-aarch64.bin
90 execve-x86_64.bin
256 revshell-aarch64.bin
189 revshell-x86_64.bin
```
Another ~40B can be shaved off by disabling .bss zeroing. Although far from
shortest possible shellcodes, they unlock the ability to use Zig standard library. | [] |
https://avatars.githubusercontent.com/u/87977742?v=4 | greetd_ipc | Ziqi-Yang/greetd_ipc | 2024-03-24T04:20:05Z | [mirror] Zig library for interacting with [greetd](https://sr.ht/~kennylevinsen/greetd/) ipc. | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/Ziqi-Yang/greetd_ipc/tags | MIT | [
"greetd",
"ipc",
"zig"
] | 17 | false | 2024-09-14T16:14:58Z | true | true | 0.11.0 | github | [] | Greetd_IPC
Installation
Supported Zig Version: <code>0.13</code>.
<code>bash
zig fetch 'https://codeberg.org/meow_king/greetd_ipc/archive/v0.1.1.tar.gz' --save</code>
Then you can add this dependency into <code>build.zig</code> file:
<code>zig
const dep = b.dependency("greetd_ipc", .{ .target = target, .optimize = optimize });
const module = dep.module("greetd_ipc");
exe.root_module.addImport("greetd_ipc", module);</code>
For other version of Zig, you can include <code>greetd-ipc.zig</code> file into
your source directory.
Usage
``` zig
const std = @import("std");
pub fn main() !void {
var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){};
defer if (gpa_impl.deinit() == .leak) @panic("MEMORY LEAK");
const gpa = gpa_impl.allocator();
<code>const gipc: GreetdIPC = try GreetdIPC.new(null, gpa);
defer gipc.deinit();
const request: Request = .{ .create_session = .{ .username = "user"}};
try gipc.sendMsg(request);
const response = try gipc.readMsg();
std.debug.print("{s}\n", .{std.json.fmt(response, .{})});
</code>
}
```
Run Example
Build <code>fakegreet</code> from <a>greetd</a>
repo.
<code>bash
zig build -Dexample=examples/demo.zig run-example
fakegreet ./zig-out/bin/demo</code>
Or you can run the following command if you have
<a>just</a> installed.
<code>bash
just run</code>
Note <code>fakegreet</code> is a testing tool inside greetd's repo. see
<a>source</a>. | [] |
https://avatars.githubusercontent.com/u/89152669?v=4 | Dnipro-mirror- | NippleOfAnApe/Dnipro-mirror- | 2024-07-03T19:08:33Z | Zig as the Foundation for a Portable and Modular Game Engine. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/NippleOfAnApe/Dnipro-mirror-/tags | EUPL-1.2 | [
"game-development",
"game-engine",
"zig"
] | 4,758 | false | 2024-09-06T18:15:39Z | true | true | unknown | github | [
{
"commit": null,
"name": "mach",
"tar_url": null,
"type": "remote",
"url": "https://pkg.machengine.org/mach/316f2354d155d7fb706e6cfa1d09b7db8896b92f.tar.gz"
}
] | Dnipro
Zig as the Foundation for a Portable and Modular Game Engine.
<a>Draft</a>
Final thesis with code implementation.
Zig compiler version is <code>0.13.0-dev.351+64ef45eb0</code>
Example <a>mermaid diagram</a>
```mermaid
classDiagram
Class01 <|-- AveryLongClass : Cool
<> Class01
Class09 --> C2 : Where am I?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
class Class10 {
<>
int id
size()
}
```
Example architecture file from <a>rust-analyzer</a>
Example Design file from <a>TigerBeetle</a>
<b>⚠ My lovely country has been invaded by russia and is currently at war ⚠</b>
Due to the matter, all activity on my repositories might be delayed
Please consider helping Ukraine! The most effective thing you can do is donate to one of the local non-government charities that supply our defenders with critical equipment — power stations, medical supplies, armored vests, light vehicles, reconnaissance drones, weapon attachments, etc. It's best to avoid donating to global funds, such as Red Cross or UN Crisis Relief, because they have a very limited presence in Ukraine and typically can't provide the most necessary support.
Here's a list of trusted charities from r/Ukraine https://www.reddit.com/r/ukraine/wiki/charities. You can also donate to Serhii Sternenko's https://send.monobank.ua/jar/dzBdJ3737 fund, who buys fpv drones and distributes them throughout different units. | [] |
https://avatars.githubusercontent.com/u/89275?v=4 | clipboard | dgv/clipboard | 2024-06-16T22:46:36Z | multiplatform clipboard for zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/dgv/clipboard/tags | MIT | [
"clipboard",
"linux",
"macos",
"multiplatform",
"windows",
"zig",
"zig-package",
"ziglang"
] | 2,366 | false | 2025-05-21T04:52:40Z | true | true | 0.13.0 | github | [] | clipboard
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
<a></a>
Provide copying and pasting text (UTF-8) to the clipboard for Zig.
platform support
<ul>
<li>MacOS</li>
<li>Linux, Unix (requires 'xclip' or 'xsel' command to be installed)</li>
<li>Windows</li>
</ul>
usage
install
<code>zig fetch --save https://github.com/dgv/clipboard/archive/refs/heads/main.zip</code>
import (build.zig)
<code>zig
...
exe.root_module.addImport("clipboard", b.dependency("clipboard", .{}).module("clipboard"));
b.installArtifact(exe);</code>
sample
```zig
const clipboard = @import("clipboard");
const std = @import("std");
pub fn main() !void {
try clipboard.write("Zig ⚡");
std.debug.print("{s}\n", .{clipboard.read() catch ""});
}
``` | [] |
https://avatars.githubusercontent.com/u/33042132?v=4 | portzcan | henriquencmt/portzcan | 2024-04-09T07:38:11Z | Command-line tool and Zig library for port scanning. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/henriquencmt/portzcan/tags | AGPL-3.0 | [
"library",
"networking",
"package",
"port-scanner",
"portzcan",
"sockets",
"zig",
"ziglang"
] | 59 | false | 2024-06-27T00:41:15Z | true | true | unknown | github | [] | portzcan :zap:
Command-line tool and Zig library for port scanning.
Installation
As a command-line tool
Get the source code cloning the repo or downloading it from the <a>Releases page</a>.
Then build it with <code>zig build</code>.
As a library
Fetch the package.
<code>zig fetch --save git+https://github.com/henriquencmt/portzcan</code>
Update your <em>build.zig</em>.
```zig
const portzcan = b.dependency("portzcan", .{});
const portzcan_lib = b.addModule("lib", .{ .root_source_file = portzcan.path("lib/portzcan.zig") });
const exe = b.addExecutable(...);
exe.root_module.addImport("portzcan", portzcan_lib);
```
Usage
As a command-line tool
<code>portzcan [-s] TARGET [PORTS]</code>
Example
<code>portzcan your-target.com 80,443,22</code>
As a library
Example
```zig
const std = @import("std");
const portzcan = @import("portzcan");
pub fn main() !void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
<code>const allocator = arena.allocator();
const addr_list = try std.net.getAddressList(allocator, "your-target.com", 0);
var addr = addr_list.addrs[0];
const ports = [_]u16{ 80, 8080, 22, 443 };
const scanner = portzcan.TcpConnectScanner.init(allocator, &addr, null);
try scanner.scan(&ports);
</code>
}
```
Go to the <a>library API reference</a> for further documentation.
Contributing
Contributions of any kind are welcome. | [] |
https://avatars.githubusercontent.com/u/50797868?v=4 | bfjit-x86_64 | maolonglong/bfjit-x86_64 | 2024-02-11T07:29:57Z | A Just-In-Time Compiler for Brainfuck. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/maolonglong/bfjit-x86_64/tags | MIT | [
"assembly",
"brainfuck",
"jit",
"x86-64",
"zig"
] | 5 | false | 2024-10-03T13:03:23Z | true | false | unknown | github | [] | bfjit-x86_64
A Just-In-Time Compiler for Brainfuck. | [] |
https://avatars.githubusercontent.com/u/57362253?v=4 | vulkan.zig | tiawl/vulkan.zig | 2024-02-28T15:40:13Z | vulkan headers packaged for @ziglang | trunk | 0 | 2 | 2 | 2 | https://api.github.com/repos/tiawl/vulkan.zig/tags | Unlicense | [
"binding",
"spaceporn",
"vulkan",
"vulkan-api",
"zig",
"zig-package",
"ziglang"
] | 6,957 | false | 2025-05-10T10:21:19Z | true | true | 0.14.0 | github | [
{
"commit": "master",
"name": "toolbox",
"tar_url": "https://github.com/tiawl/toolbox/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/tiawl/toolbox"
}
] | vulkan.zig
This is a fork of <a>hexops/vulkan-headers</a> which is itself a fork of <a>KhronosGroup/Vulkan-Headers</a>.
Why this forkception ?
The intention under this fork is the same as <a>hexops</a> had when they forked <a>KhronosGroup/Vulkan-Headers</a>: package the headers for <a>Zig</a>. So:
* Unnecessary files have been deleted,
* The build system has been replaced with <code>build.zig</code>.
However this repository has subtle differences for maintainability tasks:
* No shell scripting,
* A cron runs every day to check <a>KhronosGroup/Vulkan-Headers</a>. Then it updates this repository if a new release is available.
How to use it
The current usage of this repository is centered around <a>tiawl/glfw.zig</a> compilation. But you could use it for your own projects. Headers are here and there are no planned evolution to modify them. See <a>tiawl/glfw.zig</a> to see how you can use it.
Dependencies
The <a>Zig</a> part of this package is relying on the latest <a>Zig</a> release (0.14.0) and will only be updated for the next one (so for the 0.14.1).
Here the repositories' version used by this fork:
* <a>KhronosGroup/Vulkan-Headers</a>
CICD reminder
These repositories are automatically updated when a new release is available:
* <a>tiawl/glfw.zig</a>
This repository is automatically updated when a new release is available from these repositories:
* <a>KhronosGroup/Vulkan-Headers</a>
* <a>tiawl/toolbox</a>
<code>zig build</code> options
These additional options have been implemented for maintainability tasks:
<code>-Dfetch Update .references folder and build.zig.zon then stop execution
-Dupdate Update binding</code>
License
This repository is not subject to a unique License:
The parts of this repository originated from this repository are dedicated to the public domain. See the LICENSE file for more details.
<strong>For other parts, it is subject to the License restrictions their respective owners choosed. By design, the public domain code is incompatible with the License notion. In this case, the License prevails. So if you have any doubt about a file property, open an issue.</strong> | [] |
https://avatars.githubusercontent.com/u/18282288?v=4 | bazel-execlog-duckdb-extension | Strum355/bazel-execlog-duckdb-extension | 2024-08-06T22:03:27Z | null | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/Strum355/bazel-execlog-duckdb-extension/tags | - | [
"bazel",
"duckdb",
"duckdb-extension",
"nix",
"nix-flake",
"protobuf",
"zig"
] | 60 | false | 2024-09-19T08:23:28Z | true | true | unknown | github | [
{
"commit": "a2762e39138ca23b8e380edb535f85578f159d1c.tar.gz",
"name": "protobuf",
"tar_url": "https://github.com/Arwalk/zig-protobuf/archive/a2762e39138ca23b8e380edb535f85578f159d1c.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/Arwalk/zig-protobuf"
}
] | 404 | [] |
https://avatars.githubusercontent.com/u/12463905?v=4 | zig-8086-simulator | mtimbs/zig-8086-simulator | 2024-07-07T12:07:44Z | A basic x86 disassembler + 8086 simulator written in Zig | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/mtimbs/zig-8086-simulator/tags | MIT | [
"8086-emulator",
"x86-assembly",
"zig"
] | 2,947 | false | 2025-04-19T11:04:47Z | true | true | 0.13.0 | github | [
{
"commit": "master",
"name": "raylib-zig",
"tar_url": "https://github.com/Not-Nik/raylib-zig/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/Not-Nik/raylib-zig"
}
] | Learning Zig + CPUs more good
A simple x86 dissasembler + 8086 simulator in Zig
Goal:
<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> Learn more about Zig so I can compare it to Odin
<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> Learn more about Assembly and how CPUs work in general in the process
Tools
<ul>
<li>Zig 0.13 (https://ziglang.org/download/)</li>
<li>NASM (converting .asm to binary)(https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/macosx/)</li>
</ul>
Resources
<ul>
<li>8086 user manual - https://edge.edx.org/c4x/BITSPilani/EEE231/asset/8086_family_Users_Manual_1_.pdf (page 164 is instruction table)</li>
</ul>
Aknowledgements
I am building this as I am following along with the course by C. Muratori at https://www.computerenhance.com
TODO
<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> Opcode patterns in 8086 arithmetic (https://www.computerenhance.com/p/opcode-patterns-in-8086-arithmetic)
- Check the byte/word stuff with immediate to register/memory on MOV. ADD/SUB behave different
-[x] add
-[x] subtract
-[ ] compare
-[ ] jump not zero | [] |
https://avatars.githubusercontent.com/u/8588690?v=4 | REPLace | themanyone/REPLace | 2024-03-05T07:08:25Z | A REPL for all langauges with *your* editor and this simple bash script. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/themanyone/REPLace/tags | GPL-2.0 | [
"c",
"c17",
"cobol",
"cpp",
"cpp17",
"csharp",
"fortran",
"go",
"hare",
"java",
"node",
"perl",
"php",
"python",
"repl",
"rust",
"zig"
] | 77 | false | 2025-03-30T00:43:37Z | false | false | unknown | github | [] | REPL Ace
A REPL for all languages and compilers. One command is all you need.
<code>repl.sh [source]
or
repl.sh [compiler] -run [source] [optional args]
</code>
Dependencies
Install <code>fswatch</code>, available from distro package manager.
Get optional compiler, preprocessor for your favorite language.
<code>TinyCC | https://repo.or.cz/tinycc.git/
Crap | https://themanyone.github.io/crap/
Go | https://go.dev/
Zig | https://ziglang.org/
Hare | https://sr.ht/~sircmpwn/hare/sources
</code>
Installation
Copy scripts to somewhere in $PATH.
install -D r* /usr/local/bin
Make Sources Executable
<code>chmod +x hello.c
</code>
Put this header at the top of the source code.
//usr/local/bin/tcc $0 -run -- foo bar baz; exit $?
This tricks the shell into running the compiler.
The -- foo bar baz arguments are optional, for testing.
Your script can access them in the argv[] argument list.
Here's one for go compiler.
//path/to/go run "$0" -- foo bar && exit $?
Another example for zig.
//path/to/repl.sh zig run hello.zig fizz buzz && exit $?
It's basically a bash script, so you can run other commands.
Usage
Now you can run scripted source code from the terminal.
<code>* Try it.
`./hello.c`
* Launch repl.sh command or alias.
`repl.sh ./hello.c`
* Edit the [source] with your favorite editor.
`nano hello.c`
* Script will re-run whenever it is saved in the editor.
</code>
You could also run python scripts whenever they are updated.
<code>repl.sh hello.py</code>
Use it for any kind of script, configuration, or AI agent.
Advanced Usage
Sometimes it's a challenge making sources into executable scripts. We can also compile and run them from the command line, using the editor's F5 <code>run</code> command, or by using an alias.
Make aliases for your favorite REPLs.
alias repl_c='repl.sh tcc -run hello.c hello world'
alias repl_go='repl.sh go run hello.go foo bar baz'
alias repl_zig='repl.sh zig run hello.zig fizz buzz'
Put aliases in <code>~/.bashrc</code> for later use.
Extra arguments
Supply extra arguments to access them in source code.
<code>repl.sh tcc -run hello.c hello world</code>
<code>printf("%s %s", argv[1], argv[2]); //outputs "hello world"</code>
Print arguments in golang.
<code>repl.sh go run hello.go foo bar baz</code>
<code>```go
package main; import ("fmt"; "os")
func main() {
fmt.Printf("Args 1: %s\n", os.Args[1]) // prints foo
}
```
</code>
Runner
Use <code>runner</code> if your compiler has no <code>-run</code> option.
Code <code>runner</code> can be used in script headers or commands.
The <code>-o</code> is optional if <code>repl.sh</code> can find the executable.
In script headers.
//path/to/runner my_compiler "$0" -- my args && exit 0
//path/to/runner go build "$0" -- foo bar && exit 0
From command line
repl.sh zig run hello.zig fizz buzz
repl.sh runner gcc $CFLAGS $LIBS -o test test.c -- my args
repl.sh runner hare build hello.ha -- my args
Sharing
<code>This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
</code>
Updates
<code>Get updates from https://github.com/themanyone/REPLace.git
</code>
Other REPLs
<code>Itcc: repl for c-like languages https://github.com/themanyone/itcc
various languages in the browser http://repl.it
csharp: included with monodevelop http://www.csharphelp.com/
psysh: comes with php for php code http://php.net
evcxr: another Rust REPL https://github.com/evcxr/evcxr
ipython: interactive python https://github.com/ipython/ipython
rep.lua: a lua REPL https://github.com/hoelzro/lua-repl
re.pl: perl command line https://github.com/daurnimator/rep
d8-314: from V8, JavaScript https://developers.google.com/v8/
csi: from chicken, a scheme REPL http://call-cc.org/
RStudio: interactive R coding https://rstudio.com/
Ruby IRB: REPL tool for Ruby https://ruby-doc.org/stdlib-2.7.2/libdoc/irb/rdoc/IRB.html
numerous bash-like shells and interpreters
</code>
Author's links
<code>- GitHub https://github.com/themanyone
- YouTube https://www.youtube.com/themanyone
- Mastodon https://mastodon.social/@themanyone
- Linkedin https://www.linkedin.com/in/henry-kroll-iii-93860426/
- [TheNerdShow.com](http://thenerdshow.com/)
</code> | [] |
https://avatars.githubusercontent.com/u/60118973?v=4 | zldr | kothavade/zldr | 2024-05-26T05:02:10Z | A fast tldr client written in Zig. | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/kothavade/zldr/tags | MIT | [
"tldr",
"zig"
] | 75 | false | 2024-11-28T12:49:21Z | true | true | 0.13.0-dev.351+64ef45eb0 | github | [
{
"commit": "60cd46aacff4960104703da9ba683077b1e3c76c",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/60cd46aacff4960104703da9ba683077b1e3c76c.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
},
{
"commit": "dd2bca67f89c5b216b0b8187307d0b44b... | zldr
A fast <a>tldr</a> client written in <a>Zig</a>.
tldr?
tldr-pages are a collection of short and simple help pages for command line tools, like <code>man</code> but simpler.
For example, here is the tldr page for <code>tar</code>:
Click to expand
### tar
> Archiving utility.
> Often combined with a compression method, such as `gzip` or `bzip2`.
> More information: .
- [c]reate an archive and write it to a [f]ile:
`tar cf {{path/to/target.tar}} {{path/to/file1 path/to/file2 ...}}`
- [c]reate a g[z]ipped archive and write it to a [f]ile:
`tar czf {{path/to/target.tar.gz}} {{path/to/file1 path/to/file2 ...}}`
- [c]reate a g[z]ipped archive from a directory using relative paths:
`tar czf {{path/to/target.tar.gz}} --directory={{path/to/directory}} .`
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely:
`tar xvf {{path/to/source.tar[.gz|.bz2|.xz]}}`
- E[x]tract a (compressed) archive [f]ile into the target directory:
`tar xf {{path/to/source.tar[.gz|.bz2|.xz]}} --directory={{path/to/directory}}`
- [c]reate a compressed archive and write it to a [f]ile, using the file extension to [a]utomatically determine the compression program:
`tar caf {{path/to/target.tar.xz}} {{path/to/file1 path/to/file2 ...}}`
- Lis[t] the contents of a tar [f]ile [v]erbosely:
`tar tvf {{path/to/source.tar}}`
- E[x]tract files matching a pattern from an archive [f]ile:
`tar xf {{path/to/source.tar}} --wildcards "{{*.html}}"`
Fast?
Here are benchmarks of <code>zldr</code> against <a>tealdeer (Rust)</a>, <a>tlrc (Rust)</a>, and <a>tldr-c-client (C)</a> using <a>hyperfine</a> on my machine. Each of the other clients was downloaded from nixpkgs, and <code>zldr</code> was built with <code>--release=fast</code>.
```
~/code/zldr main λ hyperfine -N --warmup 10 \
".../tealdeer-1.6.1/tldr ip" -n "tealdeer (rust, unoffical)" \
".../tlrc-1.9.2/tldr ip" -n "tlrc (rust, offical)" \
".../tldr-1.6.1/tldr ip" -n "tldr-c (c, offical)" \
"./zig-out/bin/zldr ip" -n "zldr (zig, unoffical)"
Benchmark 1: tealdeer (rust, unoffical)
Time (mean ± σ): 802.5 µs ± 63.7 µs [User: 297.4 µs, System: 436.2 µs]
Range (min … max): 663.7 µs … 1075.9 µs 4190 runs
Benchmark 2: tlrc (rust, offical)
Time (mean ± σ): 912.5 µs ± 66.6 µs [User: 279.0 µs, System: 562.4 µs]
Range (min … max): 758.4 µs … 1188.3 µs 3039 runs
Benchmark 3: tldr-c (c, offical)
Time (mean ± σ): 2.4 ms ± 0.1 ms [User: 0.8 ms, System: 1.5 ms]
Range (min … max): 2.2 ms … 2.7 ms 1211 runs
Benchmark 4: zldr (zig, unoffical)
Time (mean ± σ): 431.6 µs ± 39.7 µs [User: 255.4 µs, System: 121.0 µs]
Range (min … max): 364.0 µs … 603.0 µs 7221 runs
Summary
zldr (zig, unoffical) ran
1.86 ± 0.23 times faster than tealdeer (rust, unoffical)
2.11 ± 0.25 times faster than tlrc (rust, offical)
5.54 ± 0.55 times faster than tldr-c (c, offical)
```
Usage
```
zldr v0.0.1
Ved Kothavade <a>ved@kothavade.com</a>
__ __
<strong><em>_/ /</em></strong>/ /<strong><em>_
/</em> / / __ / </strong><em>/
/ /</em>/ /<em>/ / /
/___/_</em>,<em>/</em>/
A fast tdlr client written in Zig.
USAGE:
zldr [OPTIONS]
OPTIONS:
<code>-h, --help Print help
-v, --version Get zldr version
-p, --platform <platform> Search using a specific platform
-u, --update Update the tldr pages cache
-l, --list List all pages for the current platform
-c, --clear-cache Clear the cache
--list-platforms List all available platforms
--cache-dir <dir> Specify the cache directory to use (default: ${system cache directory}/zldr)
<page> The command to show the tldr page for
</code>
```
Building
Currently requires the latest Zig Nightly (<code>0.13.0-dev.351+64ef45eb0</code>).
```sh
A Nix flake is provided to ease both building and development:
nix build
nix develop # or use direnv
Debug build
zig build
Release build
zig build --release=fast # or --release=safe, --release=small depending on your preferences
Run (after building)
./zig-out/bin/zldr
```
Tasks
In no particular order:
<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> GitHub Actions for releases.
<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> Support language selection and detection
<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>tldr-pages client specification</a> conformance
<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> Shell autocompletions
<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>charmbracelet/vhs</a> GIF for README
<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> Add tests
<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> use <code>std.Progress</code>
Credits
<ul>
<li><a>src/tmpfile.zig</a> is a modified version of <a>liyu1981/tmpfile.zig</a>.</li>
<li><a>zig-clap</a> is used for CLI argument parsing.</li>
<li><a>ziglibs/known-folders</a> is used to find the cache directory.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/3868549?v=4 | goku | sea-grass/goku | 2024-08-06T20:30:30Z | A Static Site Generator written in Zig. | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/sea-grass/goku/tags | MIT | [
"markdown",
"static-site-generator",
"yaml",
"zig",
"zig-package"
] | 923 | false | 2025-04-20T20:39:51Z | true | true | unknown | github | [
{
"commit": "master",
"name": "httpz",
"tar_url": "https://github.com/sea-grass/http.zig/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/sea-grass/http.zig"
},
{
"commit": null,
"name": "custom_test_runner",
"tar_url": null,
"type": "relative",
"url":... | Goku
Goku is a Static Site Generator written in Zig.
Introduction
A static site generator (SSG) is typically run on some input source to produce a folder of html files, suitable for hosting on any HTTP server. Goku aims to be a SSG that can operate on a variety of input sources to generate static sites of up to hundreds of thousands of pages.
Notice
<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>
Goku is in its early stages. The roadmap for features is prioritized on an as-needed basis. If you want to use Goku but it's lacking a key feature you need, feel free to check out the <a>contributing</a> section of the readme.
</blockquote>
Requirements
<ul>
<li>Officially supported Zig: <code>0.14.0</code> (you can get it from the <a>Zig Releases page</a>)</li>
</ul>
Installation
Use Zig to build the application binary. With a shell open in this project's directory:
<code>zig build -Doptimize=ReleaseSafe</code>
The goku binary will be available at <code>zig-out/bin/goku</code>.
Usage
See <a>the docs</a> on how to scaffold your first Goku site.
Once you've set up your site, you can use goku to build it:
<code>goku site -o build</code>
In the above example, Goku will scan <code>site/pages</code> recursively for all <code>.md</code> files, parse their yaml frontmatter for a <code>slug</code>, and then place the built sites into the <code>build</code> folder according to each page's <code>slug</code>. It will provide a build summary with the time elapsed and the source and destination directories.
Once you've built the site, you can try previewing it on your local machine using your preferred file server. For example, if you have <code>python3</code> on your system, you can try:
<code>sh -c 'cd build; python3 -m http.server'</code>
Further Work
In its current form, Goku is very basic. There is no support for theming, asset management, etc. If there's a feature you'd like to see, please open a GitHub issue.
Contributing
Contributions are welcome, but I do request that if there's no open GitHub issue regarding your ideal change that you open one first! It's likely that I'm already working on the feature, so following this process helps to ensure that we're not spending double the time.
Bug reports
If you find a bug in the software, please report it using the GitHub issue tracker for this project's repository. | [] |
https://avatars.githubusercontent.com/u/5254142?v=4 | flycheck-ziglint | flycheck/flycheck-ziglint | 2024-02-29T09:33:02Z | Flycheck for ziglint | main | 0 | 2 | 1 | 2 | https://api.github.com/repos/flycheck/flycheck-ziglint/tags | GPL-3.0 | [
"elisp",
"zig",
"ziglint"
] | 34 | false | 2025-04-22T23:17:42Z | false | false | unknown | github | [] | <a></a>
<a></a>
flycheck-ziglint
<blockquote>
Flycheck for ziglint
</blockquote>
<a></a>
🔨 Usage
To enable this package, simply add loading to your config like the code below.
<code>el
(with-eval-after-load 'flycheck
(flycheck-ziglint-setup))</code>
🛠️ Contribute
<a></a>
<a></a>
<a></a>
<a></a>
If you would like to contribute to this project, you may either
clone and make pull requests to this repository. Or you can
clone the project and establish your own branch of this tool.
Any methods are welcome!
🔬 Development
To run the test locally, you will need the following tools:
<ul>
<li><a>Eask</a></li>
<li><a>Make</a> (optional)</li>
</ul>
Install all dependencies and development dependencies:
<code>sh
eask install-deps --dev</code>
To test the package's installation:
<code>sh
eask package
eask install</code>
To test compilation:
<code>sh
eask compile</code>
<strong>🪧 The following steps are optional, but we recommend you follow these lint results!</strong>
The built-in <code>checkdoc</code> linter:
<code>sh
eask lint checkdoc</code>
The standard <code>package</code> linter:
<code>sh
eask lint package</code>
<em>📝 P.S. For more information, find the Eask manual at https://emacs-eask.github.io/.</em>
⚜️ License
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <a>https://www.gnu.org/licenses/</a>.
See <a><code>LICENSE</code></a> for details. | [] |
https://avatars.githubusercontent.com/u/91969467?v=4 | zonzai | unicorn-city/zonzai | 2024-02-09T19:51:42Z | null | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/unicorn-city/zonzai/tags | - | [
"bonsai",
"cellular-automata",
"game-of-life",
"wasm",
"zig"
] | 668 | false | 2024-08-19T09:00:44Z | true | true | 0.11.0 | github | [] | ぞんざい
[d͡zõ̞nd͡za̠i]
<strong><em>Adjective</em></strong>
<ol>
<li>markedly rough or careless in manner</li>
</ol>
<strong><em>Noun (1)</em></strong>
<ol>
<li>person whose words and actions are violent</li>
<li>state of being rude</li>
</ol>
<strong><em>Noun (2)</em></strong>
<ol>
<li>bonsai tree generator</li>
<li>cellular automata life simulation</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/434125?v=4 | zig-hailo | ssttevee/zig-hailo | 2024-07-08T04:22:33Z | zig reimplementation of some functions provided by https://github.com/hailo-ai/hailort | trunk | 0 | 2 | 0 | 2 | https://api.github.com/repos/ssttevee/zig-hailo/tags | MIT | [
"ai",
"artificial-intelligence",
"hailo",
"hailo-8",
"hailo-ai",
"hailo8",
"machine-learning",
"ml",
"neural-network",
"zig",
"ziglang"
] | 52 | false | 2024-10-22T14:39:05Z | true | true | unknown | github | [] | zig-hailo
A reimplementation of <a>hailort</a> in Zig. The goal was to learn about the low level interface of the hailo devices and not feature parity with the official library, so reimplemented surface area may be small.
Only PCIE devices on linux are currently supported.
hailostatus
This is a simple program that prints the status of your installed hailo devices. It is driver version independent unlike the official hailortcli tool.
Tested on hailort driver versions: <a><code>4.17.1</code></a> <a><code>4.18.0</code></a>
Usage
You can run the program with the zig build system:
<code>sh
zig build run-status</code>
Or, you can build the program and run it:
<code>sh
zig build -Doptimize=ReleaseSafe
./zig-out/bin/hailostatus</code>
The output looks like this:
<code>Device: /dev/hailo0 (0000:59:00.00)
Driver Version: 4.17.1
Max Page Size: 4096
Board Type: hailo8
Allocation Mode: userspace
DMA Type: pcie
DMA Engines Count: 1
Is Firmware Loaded: false
Control Protocol Version: 2
Firmware Version: 4.17.1 (release, app, extended context switch buffer)
Logger Version: 0
Board Name: Hailo-8
Device Architecture: HAILO8
Serial Number: 0000000000000000
Part Number: 000000000000
Product Name: HAILO-8 AI ACC M.2 B+M KEY MODULE EXT TEMP
Core Clock Rate: 400000000Hz
Supported Features: ethernet false
mipi false
pcie true
current_monitoring true
mdio false
Boot Source: pcie
LCS: 3
SOC ID: 0000000000000000000000000000000000000000000000000000000000000000
Ethernet MAC Address: 00:00:00:00:00:00
ULT ID: 000000000000000000000000
PM Values: 000000000000000000000000000000000000000000000000
Partial Clusters Layout Bitmap: unknown
Measured Power: overcurrent_protection: 0.58912134W
Temperature: S0 41.05951C
S1 41.110096C
Avg 41.0848C</code>
You can also get json output with the <code>-json</code> flag:
```sh
zig build run-status -- -json
OR
./zig-out/bin/hailostatus -json
```
<code>json
[
{
"device": "/dev/hailo0",
"bdf": "0000:59:00.00",
"driver_version": "4.17.1",
"device_properties": {
"desc_max_page_size": 4096,
"board_type": "hailo8",
"allocation_mode": "userspace",
"dma_type": "pcie",
"dma_engines_count": 1,
"is_fw_loaded": true
},
"device_identity": {
"protocol_version": 2,
"firmware_version": {
"version": "4.17.1",
"mode": "release",
"firmware_type": "app",
"extended_context_switch_buffer": true
},
"logger_version": 0,
"board_name": "Hailo-8",
"device_architecture": "HAILO8",
"serial_number": "0000000000000000",
"part_number": "000000000000",
"product_name": "HAILO-8 AI ACC M.2 B+M KEY MODULE EXT TEMP"
},
"device_information": {
"neural_network_core_clock_rate": 400000000,
"supported_features": {
"ethernet": false,
"mipi": false,
"pcie": true,
"current_monitoring": true,
"mdio": false
},
"boot_source": "pcie",
"lcs": 3,
"soc_id": "0000000000000000000000000000000000000000000000000000000000000000",
"eth_mac_address": "00:00:00:00:00:00",
"fuse_info": "000000000000000000000000",
"pd_info": "000000000000000000000000000000000000000000000000",
"partial_clusters_layout_bitmap": "unknown"
},
"power_measurements": [
{
"value": 0.5891213417053223,
"dvm": "overcurrent_protection",
"type": "power"
}
],
"chip_temperature": {
"s0": 41.21126937866211,
"s1": 41.26185607910156,
"sample_count": 10459
}
}
]</code>
Importing into your own zig project
Run this command from your project folder
<code>sh
zig fetch --save https://github.com/ssttevee/zig-hailo/archive/refs/heads/trunk.tar.gz</code>
Then add this snippet to your build.zig file
```zig
const adb = b.dependency("hailo", .{
.optimize = optimize,
.target = target,
});
exe.root_module.addImport("hailo", adb.module("hailo"));
``` | [] |
https://avatars.githubusercontent.com/u/171613424?v=4 | zssh | say-fish/zssh | 2024-07-14T17:21:17Z | Freestanding implementation of the ssh protocol. | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/say-fish/zssh/tags | GPL-3.0 | [
"ssh",
"zig"
] | 3,932 | false | 2025-05-20T09:52:42Z | true | true | 0.14.0 | github | [] | zssh
Freestanding implementation of the ssh protocol. Not including implementations for cryptographic algorithms such as <code>ed25519</code>, or <code>sntrup761x25519-sha512</code>, etc... This allows for reuse of other established implementations, or use of non-spec defined algorithms. See: [using openssl] (TODO:) for more info.
Parsing of ssh primitives (i.e. keys, certkeys, sshsigs, agent messages) is done entirely in place.
The implementation is done in such way to allow for easy hacking of the protocol.
Using:
<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>
Not ready for any type of use! Wait for 0.0.1 release.
</blockquote>
TODO:
Module:
TODO:
As a lib:
TODO:
Examples:
See <a>examples</a> for a comprehensive list of examples.
Running examples should be as easy as <code>zig build run -- <args></code>, otherwise, see example specific README.
Contributing:
Yes. No fuzz, just do it!
Docs:
TODO:
TODO:
See <a>TODO</a>.
Happy hacking!!! | [] |
https://avatars.githubusercontent.com/u/3502597?v=4 | zig-rust-interop | mkpoli/zig-rust-interop | 2024-03-30T02:27:55Z | An example of Zig-Rust and Rust-Zig interop through C ABI | master | 0 | 2 | 0 | 2 | https://api.github.com/repos/mkpoli/zig-rust-interop/tags | - | [
"abi",
"interop",
"rust",
"zig"
] | 7 | false | 2025-05-03T17:49:57Z | false | false | unknown | github | [] | Rust–Zig / Zig–Rust DLL Interop Example
This repository contains examples of calling DLLs written in Rust and Zig from each other using C ABI.
<ul>
<li><a>rust-zig</a>: Zig application calling Rust DLL</li>
<li><a>zig-rust</a>: Rust application calling Zig DLL</li>
</ul>
Article
English
<ul>
<li><a>⚡Zig💞Rust🦀 DLL InterOP</a></li>
</ul>
Japanese
<ul>
<li><a>Zigで書いたDLLをRustで読み込む</a></li>
<li><a>Rustで書いたDLLをZigで読み込む</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/2242?v=4 | zig-doh | softprops/zig-doh | 2024-06-22T17:33:09Z | DNS over HTTPS client | main | 0 | 2 | 0 | 2 | https://api.github.com/repos/softprops/zig-doh/tags | MIT | [
"dns",
"doh",
"zig",
"zig-library",
"zig-package",
"zigdex-lib"
] | 14 | false | 2025-02-17T09:47:42Z | true | true | unknown | github | [] |
zig DoH
A DNS over HTTPs client interface
<a></a> <a></a>
examples
See examples directory
📼 installing
Create a new exec project with <code>zig init</code>. Copy an example from the examples directory into your into <code>src/main.zig</code>
Create a <code>build.zig.zon</code> file to declare a dependency
<blockquote>
.zon short for "zig object notation" files are essentially zig structs. <code>build.zig.zon</code> is zigs native package manager convention for where to declare dependencies
</blockquote>
Starting in zig 0.12.0, you can use and should prefer
<code>sh
zig fetch --save https://github.com/softprops/zig-doh/archive/refs/tags/v0.1.0.tar.gz</code>
otherwise, to manually add it, do so as follows
<code>diff
.{
.name = "my-app",
.version = "0.1.0",
.dependencies = .{
+ // 👇 declare dep properties
+ .doh = .{
+ // 👇 uri to download
+ .url = "https://github.com/softprops/zig-doh/archive/refs/tags/v0.1.0.tar.gz",
+ // 👇 hash verification
+ .hash = "...",
+ },
},
}</code>
<blockquote>
the hash below may vary. you can also depend any tag with <code>https://github.com/softprops/zig-doh/archive/refs/tags/v{version}.tar.gz</code> or current main with <code>https://github.com/softprops/zig-doh/archive/refs/heads/main/main.tar.gz</code>. to resolve a hash omit it and let zig tell you the expected value.
</blockquote>
Add the following in your <code>build.zig</code> file
```diff
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
<code>const optimize = b.standardOptimizeOption(.{});
// 👇 de-reference dep from build.zig.zon
</code>
<ul>
<li>const doh = b.dependency("doh", .{</li>
<li>.target = target,</li>
<li>.optimize = optimize,</li>
<li>}).module("doh");
var exe = b.addExecutable(.{
.name = "your-exe",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
// 👇 add the module to executable</li>
<li>
exe.root_mode.addImport("doh", doh);
b.installArtifact(exe);
}
```
</li>
</ul>
🥹 for budding ziglings
Does this look interesting but you're new to zig and feel left out? No problem, zig is young so most us of our new are as well. Here are some resources to help get you up to speed on zig
<ul>
<li><a>the official zig website</a></li>
<li><a>zig's one-page language documentation</a></li>
<li><a>ziglearn</a></li>
<li><a>ziglings exercises</a></li>
</ul>
- softprops 2024 | [] |
https://avatars.githubusercontent.com/u/113565070?v=4 | Zig3D | Darkfllame/Zig3D | 2024-02-24T18:02:37Z | A bindings library for writing 3D/2D apps and games in Zig ! | main | 1 | 2 | 0 | 2 | https://api.github.com/repos/Darkfllame/Zig3D/tags | MIT | [
"2d",
"3d",
"3d-graphics",
"bindings",
"freetype",
"game-development",
"glfw",
"opengl",
"stb-image",
"zig"
] | 1,285 | false | 2024-06-19T16:06:45Z | true | true | unknown | github | [
{
"commit": "a271d291fc7dea0e57befd941bd37829bfafd8a1.tar.gz",
"name": "glfw",
"tar_url": "https://github.com/Darkfllame/glfw/archive/a271d291fc7dea0e57befd941bd37829bfafd8a1.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/Darkfllame/glfw"
},
{
"commit": "be03df0d15b7f934d6f... | Zig3D
The Zig3D library is maintaned by <a>me</a> and is made to make 3D games. It provides the user bindings to the glfw, glad, stb libraries and others. The functions are adapted to the Zig conventions and avoid using C strings in profit of slices (and thus a lot of memory allocation sorry).
How to use
To use this library you have to fetch it with zig: <code>zig fetch --save https://github.com/Darkfllame/Zig3D/archive/<commit>.tar.gz</code>, replace <code><commit></code> by the commit hash of you choice or replace it with <code>main</code> (or <code>master</code>, the two works the same) for the latest update.
After adding the dependency, you'll need to add:
```zig
const zig3d = b.dependency("zig3d", .{
.optimize = optimize,
.target = target,
// if you're on windows this wont work, look at this <a>issue</a> for more infos
.shared = false,
.exposeC = true, // optional, set whether to expose c apis under a "capi" namespace. This is for glad, glfw, stb and freetype (even though freetype is always exposed since I did not make the zig API yet)
});
...
exe.root_module.addImport("zig3d", zig3d.module("zig3d"));
```
to your <code>build.zig</code> file.
You can check out the <a>demos</a> for examples on how to use the library.
<strong>Notes</strong>:
<ul>
<li>There is low (almost no) documentation, so you'll need to check out on khronos group's site for errors and what parameters do.</li>
<li>Most of the library is entirely compiled using zig, so you can expect slow compilation especially when first build.</li>
<li>Expect bugs, the library is pretty recent and I'm litteraly going back and forth with this one (I do multiple projects at once, dumb me)</li>
</ul>
Help me I guess.
Feel free to use, test it and give me ideas for this, you can also help me by proposing <a>pull requests</a>.
Now on 0.12.0
Now works on zig 0.12.0, probably will update it further more on more recent zig updates.
Little things so I don't get sued
Also thanks to mach-engine's dev(s?) for zig support on GLFW and freetype, big mwah | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.