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/18044887?v=4 | ziglearn-cn | meission/ziglearn-cn | 2023-06-19T15:14:25Z | https://ziglearn.org ๆฑ่ฏญ็ฟป่ฏ็ | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/meission/ziglearn-cn/tags | MIT | [
"zig",
"ziglang",
"ziglearn"
] | 46 | false | 2023-06-19T15:40:07Z | false | false | unknown | github | [] | ziglearn-cn
ๆฌไปๅบไธบhttps://ziglearn.org ๆฑ่ฏญ็ฟป่ฏๅ
ๅฎน ๆฌข่ฟๅ้ฆๅprใ
How to run the tests
<ol>
<li><code>zig run test-out.zig</code></li>
<li><code>zig test do_tests.zig</code></li>
</ol>
็ๆๅฃฐๆ
<a></a>
็ฑ <a>meission</a> ้็จ <a>็ฅ่ฏๅ
ฑไบซ ็ฝฒๅ-้ๅไธๆงไฝฟ็จ-็ฆๆญขๆผ็ป 4.0 ๅฝ้
่ฎธๅฏๅ่ฎฎ</a>่ฟ่ก่ฎธๅฏใ
ไธฅ็ฆไปปไฝๅไธ่กไธบไฝฟ็จๆๅผ็จ่ฏฅๆๆกฃ็ๅ
จ้จๆ้จๅๅ
ๅฎน๏ผ
ๆฌข่ฟๅคงๅฎถๆไพๅปบ่ฎฎ๏ผ | [] |
https://avatars.githubusercontent.com/u/122752255?v=4 | ZIGCalculator | CalculationCollective/ZIGCalculator | 2023-11-25T23:34:44Z | null | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/CalculationCollective/ZIGCalculator/tags | NOASSERTION | [
"calculator",
"zig"
] | 2 | false | 2023-11-27T19:41:03Z | false | false | unknown | github | [] | ZIGCalculator
Install
ZIG can be downloaded from the official <a>website</a>.
Run
You can run the program with this command:
<code>bash
zig run ZIGCalculator.zig</code> | [] |
https://avatars.githubusercontent.com/u/20256717?v=4 | zvox | Game4all/zvox | 2024-01-28T22:55:53Z | ๐ง Zig library to parse Magicavoxel .vox files | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/Game4all/zvox/tags | - | [
"magicavoxel",
"vox",
"voxel",
"zig"
] | 28 | false | 2024-10-01T04:57:17Z | true | true | unknown | github | [] | <code>zvox</code>
Installation
Using Zig's package manager.
Usage
```zig
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = gpa.allocator();
defer _ = gpa.deinit();
const file = try std.fs.cwd().openFile("testing/chicken.vox", .{ .mode = .read_only });
defer file.close();
const reader = file.reader();
const voxfile = try VoxFile.from_reader(reader, alloc);
std.log.info("Got {} models loaded", voxfile.models.len);
defer voxfile.deinit(alloc);
```
License
Licensed under the MIT License. | [
"https://github.com/Game4all/unnamed-voxel-tracer"
] |
https://avatars.githubusercontent.com/u/4185906?v=4 | zig-http-test | Vemahk/zig-http-test | 2023-10-16T01:21:09Z | A toy webserver, built with Zig, Zap, HTMX, and TailwindCSS | master | 5 | 2 | 0 | 2 | https://api.github.com/repos/Vemahk/zig-http-test/tags | MIT | [
"htmx",
"webserver",
"zap",
"zig"
] | 145 | false | 2025-01-25T20:18:16Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "zap",
"tar_url": "https://github.com/zigzap/zap/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/zigzap/zap"
},
{
"commit": "ae5ecc1522da983dc39bb0d8b27f5d1b1d7956e3.tar.gz",
"name": "mustache",
"tar_url": "https://github.com/batiati... | Zig HTTP Server
Made with <a>zig</a>,
<a>zap</a>,
<a>mustache-zig</a>,
<a>htmx</a>,
and <a>tailwind</a>.
Purpose
I work mainly in web dev, and I like zig. Thought I'd see how the two went together.
Findings
Yeah. It's pretty aight.
Kinda wish zig had some kind of interface/trait system, but I get by.
I've had to do a lot of legwork to very little website running. I'm hoping with all the work I've put into the backend that I'll get to spend more time developing the website itself, but I have yet to put a whole lot into it.
I really enjoy the level of control C and Zig grant, but I've never liked working in C. Too many quirks with the language, arrays are just pointers and don't preserve length, it's hard to do it right. Zig seems fairly straightforward to do both well and correctly, and it's been surprizingly easy to learn (granted, after many years programming experience behind it).
So far, it's been a very positive experience.
Bugs?
In Zig
I've noticed that if an error occurs behind a duck type (<code>anytype</code>), the stack trace is sometimes destroyed, and it's not possible to tell where an error is occuring. Judging Zig for that it does not have interfaces and relies heavily on duck-typing for polymorphism, this is a huge pain point for working with Zig.
I've also tried and failed to use the built in http client to pull requests from https. The error was very strange and I wasn't able to work through it with the limited amount of time I allocated to it.
In Zap
None, really. Very smooth.
In Mustache-Zig
Haven't had much a chance to mess around with it.
In HTMX
Haven't had much a chance to mess around with it :(.
In my own code
Ha, there are plenty.
I'm keeping a decent track of feature I want and bugs I notice in the Issues tab. Check those out if you're curious. Since this is a personal project, I'm not terribly inclined to tag things, though... | [] |
https://avatars.githubusercontent.com/u/28438021?v=4 | upsmon | maximousblk/upsmon | 2024-01-16T14:16:53Z | A simple UPS monitor for Raspberry Pi | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/maximousblk/upsmon/tags | MIT | [
"i2c",
"raspberry-pi",
"zig"
] | 4 | false | 2024-05-29T09:06:35Z | true | false | unknown | github | [] | UPSmon
A simple UPS monitor for <a>UPS HAT (B) for Raspberry Pi</a>.
Installation
You can download the latest release from the <a>releases page</a> or build it yourselfโข๏ธ.
Requirements
<ul>
<li><a>Zig</a></li>
<li>Make sure you have I2C enabled on your Raspberry Pi</li>
</ul>
Clone this repository
<code>bash
git clone https://github.com/maximousblk/upsmon.git</code>
Install
<code>bash
cd upsmon
zig build install -Doptimize=ReleaseSafe -p ~/.local # will install to ~/.local/bin/upsmon</code>
License
This project is licensed under the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/6332937?v=4 | zigcat | SuSonicTH/zigcat | 2023-06-23T20:20:26Z | As a lerning exercise to get to know zig I build a small command line tool that works like cat | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/SuSonicTH/zigcat/tags | - | [
"cat",
"cli",
"commandline-tool",
"learning",
"zig"
] | 35 | false | 2024-07-30T21:20:18Z | true | false | unknown | github | [] | zigcat
As a lerning exercise to get to know zig I build a small command line tool that works like cat.
Most GNU cat commandline options are implemented.
Missing options (all depend on --show-nonprinting)
<ul>
<li>-A, --show-all</li>
<li>-e</li>
<li>-t</li>
<li>-v, --show-nonprinting</li>
</ul>
Feedback from more experienced zig developers is verry welcome.
If you find any bug or you see some non-idiomatic costructs please let me know.
Usage
see <a>src/USAGE.txt</a>
Licence
zigcat is licenced under the MIT licence
see <a>src/LICENSE.txt</a>
Build requirements
To build zigcat you just need the zig compiler, which can be downloaded from <a>https://ziglang.org/download/</a>
There is no installation needed, just download the package for your operating system an extract the archive and add it to your <code>PATH</code>
Windows example
execute following commands in a windows Command Prompt (cmd.exe)
<code>cmd
curl https://ziglang.org/builds/zig-windows-x86_64-0.11.0-dev.3777+64f0059cd.zip --output zig.zip
tar -xf zig.zip
del zig.zip
move zig-windows-x86_64* zig
set PATH=%cd%\zig;%PATH%</code>
Linux example
execute following commands in a shell
<code>bash
curl https://ziglang.org/builds/zig-linux-x86_64-0.11.0-dev.3777+64f0059cd.tar.xz --output zig.tar.xz
tar -xf zig.tar.xz
rm zig.tar.xz
mv zig-linux-x86_64* zig
export PATH=$(pwd)/zig:$PATH</code>
Build
If you have zig installed and on your <code>PATH</code> just cd into the directory and execute <code>zig build</code>
The first build takes a while and when it's finished you'll find the executeable (zigcat or zigcat.exe) in zig-out/bin/
You can run the built-in uinit tests with <code>zig build test</code> If everything is ok you will see no output.
Or you can run <code>zig test src/main.zig</code> that should give you the output "All 9 tests passed." if everything is OK. | [] |
https://avatars.githubusercontent.com/u/558581?v=4 | zig-ocr-mnist-k-nearest-neighbors | MadLittleMods/zig-ocr-mnist-k-nearest-neighbors | 2023-09-30T07:09:30Z | Basic OCR example written in Zig using K-nearest neighbor against the MNIST dataset | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/MadLittleMods/zig-ocr-mnist-k-nearest-neighbors/tags | - | [
"k-nearest-neighbors",
"knn",
"mnist",
"mnist-handwriting-recognition",
"ocr",
"zig"
] | 27 | false | 2024-08-10T18:44:20Z | true | false | unknown | github | [] | Basic OCR example using K-nearest neighbors against the MNIST dataset
A from scratch, simple OCR project to recognize/detect text in images from the MNIST
dataset which is just a bunch of 28x28 images of white number digits centered on a black
background.
We're using K-nearest neighbors to classify the images which is the simplest way we can
compare our test sample against our training samples. Basically it takes our test sample
image and compares it to all the training samples and finds the closest match (yes, it
is inefficient and slow with a lot of training samples).
Basically a Zig rewrite following this tutorial by Vlad Harbuz from @clumsycomputer:
https://www.youtube.com/watch?v=vzabeKdW9tE.
Just getting my feet wet in OCR.
Setup
Download and extract the MNIST dataset from http://yann.lecun.com/exdb/mnist/ to a
directory called <code>data/</code> in the root of this project. Here is a copy-paste command
you can run:
```sh
Make a data/ directory
mkdir data/ &&
cd data/ &&
Download the MNIST dataset
curl -O http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz &&
curl -O http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz &&
curl -O http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz &&
curl -O http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz &&
Unzip the files
gunzip *.gz
```
Building and running
Tested with Zig 0.11.0
<code>sh
$ zig build run
zig build run
debug: training labels header mnist_data_utils.MnistLabelFileHeader{ .magic_number = 2049, .number_of_labels = 60000 }
debug: training images header mnist_data_utils.MnistImageFileHeader{ .magic_number = 2051, .number_of_images = 60000, .number_of_rows = 28, .number_of_columns = 28 }
debug: testing labels header mnist_data_utils.MnistLabelFileHeader{ .magic_number = 2049, .number_of_labels = 10000 }
debug: testing images header mnist_data_utils.MnistImageFileHeader{ .magic_number = 2051, .number_of_images = 10000, .number_of_rows = 28, .number_of_columns = 28 }
debug: prediction 7
debug: nearest neighbors { k_nearest_neighbors.LabeledDistance{ .label = 7, .distance = 1034 }, k_nearest_neighbors.LabeledDistance{ .label = 7, .distance = 1047 }, k_nearest_neighbors.LabeledDistance{ .label = 7, .distance = 1095 }, k_nearest_neighbors.LabeledDistance{ .label = 7, .distance = 1097 }, k_nearest_neighbors.LabeledDistance{ .label = 7, .distance = 1121 } }
โโโโโโโโโโโโ
โ Label: 7 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โ
โ โ
โ โ
โ โ
โ โ
โ โ
โ โโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโโโ โ
โ โโโโโโโโ โ
โ โโโโโโโโโโ โ
โ โโโโโโโโโโ โ
โ โโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
...</code>
Results/Accuracy
With <code>k=5</code>, running with all 60k training images against the 10k test images, we get
an accuracy of 96.72% (9672/10000).
With <code>k=10</code>, running with all 60k training images against the 10k test images, we get
an accuracy of 95.09% (9509/10000).
Dev notes
See the <a><em>developer notes</em></a> for more information. | [] |
https://avatars.githubusercontent.com/u/1427341?v=4 | Zigota | doanamo/Zigota | 2023-06-17T13:37:40Z | First game/demo project in Zig language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/doanamo/Zigota/tags | - | [
"gamedev",
"vulkan",
"zig"
] | 3,496 | false | 2024-04-22T07:03:34Z | true | false | unknown | github | [] | Prerequisites
<ul>
<li>Tested only with Windows as of now</li>
<li>Zig: <a>0.12.0-dev.798+5a4a5875d</a></li>
<li>Vulkan: <a>1.3.261.1</a></li>
<li>Blender: <a>3.6.2</a></li>
</ul>
Binaries of prerequisities must be available from PATH environment.
Screenshots
| [] |
https://avatars.githubusercontent.com/u/120288185?v=4 | FreshPresence | LittleBigRefresh/FreshPresence | 2023-08-12T06:52:46Z | A tiny background app providing Discord Rich Presence for the LittleBigPlanet games on Refresh-based servers. | master | 1 | 1 | 1 | 1 | https://api.github.com/repos/LittleBigRefresh/FreshPresence/tags | AGPL-3.0 | [
"custom-server",
"littlebigplanet",
"zig"
] | 188 | false | 2024-11-08T22:46:16Z | true | true | unknown | github | [
{
"commit": "900dd023c0a22357b5f5c58464f05d4403ccb02f",
"name": "zig-discord",
"tar_url": "https://github.com/Beyley/zig-discord/archive/900dd023c0a22357b5f5c58464f05d4403ccb02f.tar.gz",
"type": "remote",
"url": "https://github.com/Beyley/zig-discord"
},
{
"commit": "4ff20c6fcec81ec07622... | FreshPresence
A tiny background app providing Discord Rich Presence for the LittleBigPlanet games on <a>Refresh</a>-based servers.
<a></a>
Compatibility
FreshPresence is only designed for the <a>Refresh v3 API</a>, so FreshPresence will not work with alternative servers.
Additionally, LBP1 will only have limited rich presence.
Running
Legalties
<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>
FreshPresence is still early in development, as such we cannot make any guarantees about anything. You use FreshPresence at YOUR OWN RISK.
FreshPresence 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 <a>GNU Affero General Public License</a> for more details.
<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>
FreshPresence is free software: you can redistribute it and/or modify it under the terms of the <a>GNU Affero General Public License</a> as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
</blockquote>
Anyway, with the legal disclaimers out of the way...
Instructions
From Releases
<ol>
<li><a>Find the latest release</a></li>
<li>Download the version for your OS/CPU, extract it somewhere most convenient to you, and run it.</li>
<li>It will open a message box asking if you want to edit the config file, press Yes, then update the <code>fresh_presence_config.ini</code> file to contain your username and preferred settings.</li>
<li>Open FreshPresence once more, and it should now show your profile on Discord.</li>
</ol>
To update, you can simply repeat this process, overwriting the previous file.
It's on fire! What do I do?
FreshPresence isn't perfect, so it's not exactly uncommon to run into bugs. If you'd like, you can <a>create an issue</a> here on GitHub or join our <a>Discord</a> for support.
Wherever you choose to post, be sure to include details about how to trigger the bug, text logs (not screenshots!), your environment, the bug's symptoms, and anything else you might find relevant to the bug.
Building & Contributing
To contribute to FreshPresence, it may be helpful to refer to our <a>contributing guide</a> to get a basic development environment set up. If you're a pro, feel free to skip this as it's just your bog-standard Zig set-up guide.
However, something important for all those involved: we also serve additional documentation relating to FreshPresence, Refresh, Bunkum, and LittleBigPlanet in general in our <a>Docs repo</a>.
<em>Made with :heart: for the LittleBigPlanet community</em> | [] |
https://avatars.githubusercontent.com/u/13811862?v=4 | cutenet-zig | thechampagne/cutenet-zig | 2023-04-20T12:58:27Z | Zig binding for cutenet a networking library for games requiring an optional reliability layer over UDP with a baked in security scheme. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/thechampagne/cutenet-zig/tags | Zlib | [
"zig",
"zig-package"
] | 2 | false | 2024-08-31T21:03:56Z | false | false | unknown | github | [] | cutenet-zig
<a></a> <a></a>
Zig binding for <strong>cutenet</strong> a networking library for games requiring an optional reliability layer over UDP with a baked in security scheme.
References
<ul>
<li><a>cutenet</a> - <strong>1.03</strong></li>
</ul>
License
This repo is released under the <a>Zlib License</a>. | [] |
https://avatars.githubusercontent.com/u/4337696?v=4 | dynamo | nikneym/dynamo | 2023-05-01T10:36:39Z | Performant abstraction over system APIs for non-blocking socket I/O. Implements an event loop that leverages proactor pattern. | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/nikneym/dynamo/tags | MIT | [
"dynamo",
"epoll",
"non-blocking-io",
"non-blocking-sockets",
"nonblocking",
"nonblocking-sockets",
"socket",
"socket-io",
"zig",
"ziglang"
] | 15 | false | 2025-03-03T11:52:09Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/139293750?v=4 | Musubi | bogwi/Musubi | 2023-08-31T08:55:33Z | All purpose Graph in ZIG | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/bogwi/Musubi/tags | MIT | [
"data-structures",
"graph",
"graph-algorithms",
"zig",
"zig-package",
"ziglang"
] | 93 | false | 2024-06-01T03:13:30Z | true | true | unknown | github | [] | All purpose Graph in ZIG.
Description
An implementation of an adjacency map graph, where all edges incident on a vertex are collected into a map, using the adjacent vertex as a key. \
The graph can be initiated as one of four variants, subjects of graph type: <code>.directed,.undirected</code> and mode: <code>.weighted, .unweighted</code>.
<code>zig
const Graph = Musubi(VertexId, EdgeId, EdgeWt, .undirected, .unweighted);
var graph: Graph = .{};
graph.init(allocator);
defer graph.deinit();</code>
<code>VertexId</code>, a vertex type, can be anything that can be hashed, such as numeric types, structs, arrays, snippets of code, or anything except floats and untagged enums. \
<code>EdgeId</code>, an edge type, can be anything. \
<code>EdgeWt</code>, the weight type of the edge, if the graph was initiated as weighted; any numeric type. If the graph is unweighted, the type is void.
Here is the full API at the moment:
<em>GENERAL API</em> \
A set of standard procedures typically found in graph ADTs.
```
Vertex:
.id: VertexId
init: void
Edge:
.origin: Vertex
.destination: Vertex
.id: EdgeId
.weight: EdgeWt
init: void
endpoints: PairV:
origin
destination
opposite: Vertex
init: void
deinit: void
clearAndFree: void
clearRetainingCapacity: void
ensureTotalCapacity: !void
cloneIntoSelf: !void
cloneIntoSelfWithAllocator: !void
mergeIntoSelf: !void
makeVertex: Vertex
insertVertex: !Vertex
insertVertexIfVertex: !void
removeVertex: bool
gotVertex: bool
vertexCount: u64
vertices: ?[]Vertex
adjacentVertices: ?[]Vertex
verticesIntoSet: !AllVertices
AllVertices:
.vertices: ArrayHashMap
deinit: void
list: []Vertex
count: usize
gotVertex: bool
deleteVertex: bool
makeEdge: Edge
insertEdge: !Edge
insertEdgeIfEdge: !void
removeEdge: bool
gotEdge: bool
gotEdgeIfEdge: bool
getEdge: ?Edge
edgeCount: usize
degree: usize
incidentEdges: ?[]Edge
edgesIntoSet: AllEdges
AllEdges:
.edges: ArrayHashMap
deinit: void
list: []Edge
count: usize
gotEdge: bool
deleteEdge: bool
```
<em>SPECIAL API</em>
<em>tree Traversing</em>
<code>traverseTree: !ArrayList
traverseTreeIfTarget: !ArrayList</code>
The tree traversing procedure supports four algorithms by passing a corresponding enum to the above function:
<blockquote>
<code>TreeTraverseAlg:</code>
<code>.bfs</code>, breadth-first, iterative \
<code>.pre</code>, preorder, recursive \
<code>.post</code>, postorder, recursive \
<code>.ino</code>, inorder, recursive
</blockquote>
<em>graph Traversing</em>
```
connectionTree: !Connections
connectionTreeExcept: !Connections
connectionTreeThrough: !Connections
connectionTreeIfTarget: !Connection
connectionTreeIfTargetExcept: !Connection
connectionTreeIfTargetThrough:!Connection
```
The graph traversing procedure supports four + 1 algorithm by passing a corresponding enum to the above functions:
<blockquote>
<code>SearchAlg:</code>
<code>.bfs</code>, breadth-first search, iterative \
<code>.dfsA</code>, depth-first search, iterative \
<code>.dfsB</code>, depth-first search, iterative, true recursion emulation \
<code>.dfsC</code>, depth-first search, pure recursive \
<code>.dij</code> , Dijkstra shortest path, iterative.
</blockquote>
Which algorithm is better? That depends. <code>.bfs</code> and <code>.dij</code> are both shortest path algorithms. The only difference between them is that <code>.bfs</code> gives the shortest path based on how many edges it needs to travel to reach the goal, while <code>.dij</code> considers the weights of the edges, treating them like distances between vertices. If all edges have the same weight, then <code>.dij</code> will give the same result as <code>.bfsd</code>. \
The depth-first group of algorithms is different and graph-dependent. If the graph is undirected, where all vertices are randomly connected, they will not necessarily produce the shortest paths from origin to destination. They explore the graph as a whole and are useful for finding the longest possible paths. If we have such an undirected tangly graph with 1M randomly connected vertices, and if it is possible to travel from the first vertex to the last vertex and visit all the nodes, the recursive <code>.dfsC</code> algorithm will find this path from 1M - 1 vertex. \
<code>.dfsB</code> is the author's iterative algorithm, which emulates true recursion to a large extent. In some scenarios, the paths it produces are identical to true recursion with an identical stack trace, but may differ in branches. It is only designed for undirected graphs as a <code>dfsC</code> replacement. \
<code>.dfsA</code> is a lazy iterative algorithm often found in books and used worldwide. It is an inversion of <code>.bfs</code> where the queue is substituted for the stack. In the case of an undirected, randomly connected graph, the paths it produces will be much shorter than those of the recursive <code>.dfsC</code>.
Additional parameters are \
<code>knockout</code>, a set of vertices to remove from the traversal or to traverse only \
<code>target</code>, the target of the traversal, the traversal will stop when the target is reached \
<code>depth</code>, the depth of the traversal, which has slightly different goals depending on the algorithm.
The traversal process computes a connection tree from the given starting vertex to all other vertices in the map. \
The connection tree has its own documented API for working with the result:
```
Connection
.found: bool
.explore: Connections
deinit: void
Connections:
.origin: Vertex
.path: ArrayHashMap
.discovered: ArrayHashMap
.last_lookup: Vertex
deinit: void
connectedTo: bool
getAllConnected: []Vertex
getDistanceTo: EdgeWt
getPathTo: ![]Vertex
walkPathTo: !WalkPath
WalkPath:
.cnt: <em>Connections
.idx: u64
next: ?Vertex
reset: void
popPathTo: !PopPath
PopPath:
.cnt: </em>Connections
.dest: Vertex
next: ?Vertex
reset: void
```
<em>Common-problems algorithms and their APIs</em> \
<em>topological sort</em>
<code>topologicalSort: TOPO
TOPO:
.topo: ArrayList
.acyclic: bool
getAll: ?[]Vertex
getPositions: ?Vertex
getFirst: ?Vertex
getLast: ?Vertex
walk: WalkTopo</code>
<em>minimum spanning tree</em>
<code>primJarnikMST: MST
kruskalMST: MST
MST
.cost: u64
.tree: ArrayHashMap
.len: usize
getEdges: []Edge
getVertexPairs: []PairV
gotVertexPair: bool</code>
Performance
Musubi's underlying ADT is Zig's superior ArrayHashMap, which has unmatched iteration speed over keys and values, and can extract keys and values as a matter of course. This speeds up the graph routine considerably. For example, calling <code>vertices()</code> will give you an array of all the vertices in the graph without harvesting them all into a container and only then returning them to the user. The same goes for finding <code>incidentEdges()</code> of a vertex or its <code>adjacentVertices()</code>.
Testing
Apple M1 laptop with 32GB of RAM, \
ReleaseFast optimization
Complete Binary Tree
```
20M vertices: u64
20M-1 edges: void
creation: time: 7.667
BFS time: 2.682
PRE time: 3.020
POST time: 3.033
INO time: 3.019
```
Although not advertised, Musubi remembers the insertion order and can be used as a general or binary tree for your projects. The only consequence is that broken links have to be repaired manually when vertices or edges are removed. The graph is not a linked tree and cannot behave as such. Nerveless tree traversal is implemented for directed graphs and is quite fast.
Undirected, weighted, randomly connected, cobweb-looking graph
```
25k vertices: u64
500k edges: u1
creation: time: 0.105 sec
Tree - connection tree
Paths - origin -> others 25k
BFS Tree time: 0.019
BFS Paths time: 0.001
DFS A Tree time: 0.021
DFS A Paths time: 0.342 a
DFS B Tree time: 0.031
DFS B Paths time: 5.056 a
DFS C Tree time: 0.020
DFS C Paths time: 6.181 a
DIJ Tree time: 0.027
DIJ Paths time: 0.002
MST:
Prim-Jarnik: cost: 29751 time: 0.062,
throughput: 8.089
Kruskal: cost: 29751 time: 0.082,
throughput: 6.108
<code>``
(a) Constructing all 25k-1 paths computed by depth-first algorithms happens to be a costly task. As mentioned above, dfs algorithms on undirected randomly constructed graphs tend to produce the longest paths possible, with</code>.dfsC` as a true recursive algorithm producing the longest paths. Therefore, the <em>paths</em> test is omitted in the following results. However, such graphs are not real scenarios, but only benchmarking vessels. It also does not mean that DFS traversing should not be used at all to find a connection between two points of interest when working with such a tangled graph.
```
50k vertices: u64
1m edges: u1
creation: time: 0.313 sec
Tree - connection tree
Paths - origin -> others 50k
BFS Tree time: 0.057
BFS Paths time: 0.004
DFS A Tree time: 0.057
DFS A Paths
DFS B Tree time: 0.086
DFS B Paths
DFS C Tree time: 0.056 a
DFS C Paths
DIJ Tree time: 0.103
DIJ Paths time: 0.005
MST:
Prim-Jarnik: cost: 59264 time: 0.146
throughput: 6.830
Kruskal: cost: 59264 time: 0.226
throughput: 4.418
<code>``
(a) In an experiment, recursive</code>.dfsC<code>was found to break at about 1_200_000 edges for the graph described above, so there is no data for this algorithm implementation for larger graphs. For small undirected random graphs < 1.2M edges, using a purely recursive</code>.dfsC` algorithm should be fine.
```
100k vertices: u64
2M edges: u1
creation: time: 0.785 sec
Tree - connection tree
Paths - origin -> others 100k
BFS Tree time: 0.131
BFS Paths time: 0.009
DFS A Tree time: 0.129
DFS A Paths
DFS B Tree time: 0.199
DFS B Paths
DFS C Tree
DFS C Paths
DIJ Tree time: 0.246
DIJ Paths time: 0.015
MST:
Prim-Jarnik:
cost: 118512 time: 0.354
throughput: 5.650
Kruskal:
cost: 118512 time: 0.503
throughput: 3.978
```
```
1M vertices: u64
20M edges: u1
creation: time: 13.289 sec
Tree - connection tree
Paths - origin -> others 1M
BFS Tree time: 3.213
BFS Paths time: 0.177
DFS A Tree time: 3.221
DFS A Paths
DFS B Tree time: 3.550
DFS B Paths
DFS C Tree
DFS C Paths
DIJ Tree time: 6.335
DIJ Paths time: 0.347
MST:
Prim-Jarnik:
cost: 1184658 time: 7.624
throughput: 2.623
Kruskal:
cost: 1184658 time: 9.918
throughput: 2.017
```
Directed, weighted, acyclic, randomly connected graph
```
1M vertices: u64
20M+ edges: u64
creation: time: 7.083 sec
Tree - connection tree
Paths - origin -> others 1M
BFS Tree time: 0.483
BFS Paths time: 0.105
DFS A Tree time: 0.446
DFS A Paths time: 0.138
DFS B Tree not applicable
DFS B Paths not applicable
DFS C Tree time: 0.469
DFS C Paths time: 0.144
DIJ Tree time: 1.582
DIJ Paths time: 0.239
Topological Sort time: 1.684
<code></code>
5M vertices: u64
102M+ edges: u64
creation: time: 46.741 sec
Tree - connection tree
Paths - origin -> others 5M
BFS Tree time: 4.741
BFS Paths time: 0.765
DFS A Tree time: 3.743
DFS A Paths time: 0.914
DFS B Tree not applicable
DFS B Paths not applicable
DFS C Tree time: 4.026
DFS C Paths time: 0.907
DIJ Tree time: 15.195
DIJ Paths time: 2.739
Topological Sort time: 20.585
<code>``
In the case of a directed graph, the results are very different. The cost of finding every path from the origin to every other vertex is very modest. Since there are no cycles, the recursive</code>.dfsC` algorithm that examines 102M edges works correctly and does not break. | [] |
https://avatars.githubusercontent.com/u/43012445?v=4 | raylib-zig-template | cowboy8625/raylib-zig-template | 2024-01-19T23:08:09Z | a starter template for zig and raylib projects | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/cowboy8625/raylib-zig-template/tags | - | [
"raylib",
"template",
"zig"
] | 4,211 | false | 2024-07-15T21:22:48Z | true | true | 0.13.0 | github | [
{
"commit": "d2f2827a8199fbb3e33b92f53da179272717867e.tar.gz",
"name": "raylib_zig",
"tar_url": "https://github.com/cowboy8625/raylib_zig/archive/d2f2827a8199fbb3e33b92f53da179272717867e.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/cowboy8625/raylib_zig"
}
] | Raylib Zig Template
This template is just to help others quickly get started with Raylib and Zig.
I had a hard time getting started even though it was super simple.
How to use
<code>git clone https://github.com/cowboy8625/raylib-zig-template <project-name> && cd <project-name></code> | [] |
https://avatars.githubusercontent.com/u/45712559?v=4 | ggml-playground | metalwhale/ggml-playground | 2023-08-20T11:09:58Z | ML model inference in Zig using ggml | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/metalwhale/ggml-playground/tags | MIT | [
"ggml",
"zig"
] | 20 | false | 2024-01-31T15:17:51Z | false | false | unknown | github | [] | ggml-playground
ML model inference in Zig using ggml
How to run
<ol>
<li>Start and get inside the Docker container:
<code>bash
cd infra-dev/
docker-compose up -d
docker-compose exec -it ggml-playground bash</code></li>
<li>Convert models:
<code>bash
cd ./models/
python3 ./convert.py gpt_neox "rinna/japanese-gpt-neox-small"</code></li>
<li>Inference:
<code>bash
cd ../ggml-playground/
zig build test</code></li>
</ol> | [] |
https://avatars.githubusercontent.com/u/15676482?v=4 | zglgen | siniarskimar/zglgen | 2023-09-22T14:33:15Z | OpenGL bindings generator written in Zig | main | 10 | 1 | 1 | 1 | https://api.github.com/repos/siniarskimar/zglgen/tags | Zlib | [
"3d-graphics",
"generator",
"opengl",
"tools",
"zig"
] | 255 | false | 2025-02-15T16:48:46Z | true | true | 0.12.0 | github | [
{
"commit": "c0193e9247335a6c1688b946325060289405de2a.tar.gz",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/c0193e9247335a6c1688b946325060289405de2a.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | zglgen
<a></a>
OpenGL bindings generator fully written in Zig.
Supports generating bindings for all versions of:
- OpenGL
- OpenGL Core
- OpenGL ES
- OpenGL SC
Usage
The main branch of zglgen tries to work with latest official release of Zig.
Command line
Up-to-date documentation on command line options can be found by running <code>zglgen -h</code>.
```
[-hc] [-o ] [--api ] [--registry ] ...
-h, --help
Show this help message
<code>-o, --output <file>
Destination path for the generated module (default: prints to stdout)
--api <apispec>
Api to generate
--registry <file>
File path to OpenGL registry (default: downloads https://raw.githubusercontent.com/KhronosGroup/OpenGL-Registry/main/xml/gl.xml)
-c, --no-cache
Disables caching of GL registry
<extension>...
Additional extensions
</code>
```
Generating bindings
You can use zglgen to generate bindings on the command line or as part of your build process.
See <a>examples/build.zig</a>.
<strong>NOTE</strong>: Consider building zglgen with <code>ReleaseSafe</code> optimization.
In <code>Debug</code>, zglgen uses <code>std.GeneralPurposeAllocator</code> which is <strong>really slow</strong> but is necessary to fix bugs.
In <code>ReleaseSafe</code> mode, zglgen will link with C standard library and use <code>std.heap.c_allocator</code> which is substantially faster.
FAQ
Why the procedure table is <code>thread_local</code>?
As per <a>Khronos OpenGL Wiki</a>:
<blockquote>
The current context is a thread-local variable, so a single process can have several threads
each of which has its own current context. However, a single context cannot be current in
multiple threads at the same time.
</blockquote>
A non-thread-local procedure table is unusable for people that want to have multiple GL contexts.
<ol>
<li>Multiple contexts may refer to different APIs.</li>
<li>Changing contexts does not guarantee that function pointers stay the same.</li>
</ol>
Why OpenGL constants aren't Zig enums?
Reason no. 1: <strong>Aliases</strong>. In Zig multiple tag names cannot refer to the same value.
I've experimented with making them as public declerations but ultimately decided to keep API consistant
and opted out to include a comment near a constant about the enum groups it belongs to.
Using LSP's <code>goto reference</code> you can find constants that uniquely belong to a single enum group.
I've also experimented with representing bitmasks as <code>packed structs</code>.
The upside is that bitfield values were easly discoverable.
The downside is that we lost the ability to perform tail calls.
Considering the bindings can potentialy be a part of a hot code path (which they most likely are), I removed them. | [] |
https://avatars.githubusercontent.com/u/135217?v=4 | mini-zos | gthvn1/mini-zos | 2023-10-19T16:50:48Z | A unikernel written in zig that runs on top of Xen and provides runtime for Wasm binaries... | master | 5 | 1 | 0 | 1 | https://api.github.com/repos/gthvn1/mini-zos/tags | GPL-3.0 | [
"unikernel",
"wasm",
"xen",
"zig"
] | 49 | false | 2024-06-17T08:36:22Z | true | false | unknown | github | [] | <blockquote>
<strong>Warning</strong>
This project has been archived because the main project is now <a>barebones</a>.
My idea is too merge <a>barebones</a> and <a>zanzibar</a> at some point to be able to run barebones on Xen with zanzibar as monkey REPL
</blockquote>
Mini-Zos
Inspired by mini-os that is a small OS kernel running on Xen hypervisor.
<ul>
<li><a>Mini-OS source code</a></li>
<li><a>Some notes about the original Mini-OS</a></li>
</ul>
Cool links
<ul>
<li><a>Zig Bare Bones</a></li>
<li><a>HellOS</a></li>
<li><a>Zig Live Coding - "Hello world" x86 kernel</a> - Andrew Kelley</li>
</ul>
Build
<ul>
<li>We are targeting the native x86_64 architecture.</li>
<li>Just run <code>zig build -Doptimize=ReleaseSmall</code></li>
<li>the build will produce a binary <strong>zig-out/bin/mini-zos</strong></li>
</ul>
Tadam...
```sh
~/git/mini-zos master* โก
โฏ zig build -Doptimize=ReleaseSmall
~/git/mini-zos master* โก
โฏ objdump -d zig-out/bin/mini-zos
zig-out/bin/mini-zos: file format elf64-x86-64
Disassembly of section .text:
0000000000010000 <.text>:
10000: bc 00 30 01 00 mov $0x13000,%esp
10005: e8 03 00 00 00 call 0x1000d
1000a: f4 hlt
1000b: eb fd jmp 0x1000a
1000d: 90 nop
1000e: 90 nop
1000f: c3 ret
```
The ultimate goal
The ultimate goal is to run a unikernel written in zig that runs on top of Xen and provides runtime for Wasm binaries...
Cool no :)
Web Assembly
Look into the repo <code>wasm_apps</code> to have a little sneak peek of <em>Wasm</em>. | [] |
https://avatars.githubusercontent.com/u/2242?v=4 | zig-jsonlog | softprops/zig-jsonlog | 2023-11-26T06:12:18Z | format zig std logs as structured JSON | main | 2 | 1 | 0 | 1 | https://api.github.com/repos/softprops/zig-jsonlog/tags | MIT | [
"json",
"logging",
"zig",
"zig-library",
"zig-package",
"zigdex-lib",
"ziglang"
] | 28 | false | 2024-06-08T22:20:12Z | true | true | 0.13.0 | github | [] |
jsonlog
A zero-allocation JSON formatting logging library for zig
<a></a> <a></a>
๐ฌ features
<ul>
<li>make your logs easy to query with tools like aws cloud watch insights</li>
<li>zero-allocation</li>
<li>append arbitrary metadata to your logs</li>
<li>automatic newline insertion</li>
</ul>
Coming soon...
<ul>
<li>configurable writers</li>
</ul>
currently jsonlog writes to stderr, as the default std log fn does. we'd like to make the writer user configurable.
examples
```zig
const std = @import("std");
const jsonLog = @import("jsonlog");
const log = std.log.scoped(.demo);
pub const std_options: std.Options = .{
// configure the std lib log api fn to use jsonlog formatting
.logFn = jsonLog.logFn,
};
pub fn main() void {
// std log interface
log.debug("DEBUG", .{});
log.info("INFO", .{});
log.warn("WARN", .{});
log.err("ERR", .{});
<code>// jsonLog interface for provoding arbitrary structured metadata
jsonLog.info("things are happening", .{}, .{
.endpoint = "/home",
.method = "GET",
});
// create a custom scope for doing the same
jsonLog.scoped(.demo).warn("things could be better", .{}, .{
.endpoint = "/home",
.method = "GET",
});
</code>
}
```
<code>json
{"ts":"2024-03-20T15:07:15.363Z","level":"debug","msg":"DEBUG","scope":"demo"}
{"ts":"2024-03-20T15:07:15.364Z","level":"info","msg":"INFO","scope":"demo"}
{"ts":"2024-03-20T15:07:15.364Z","level":"warning","msg":"WARN","scope":"demo"}
{"ts":"2024-03-20T15:07:15.364Z","level":"error","msg":"ERR","scope":"demo"}
{"ts":"2024-03-20T15:07:15.364Z","level":"info","msg":"things are happening","scope":"default","meta":{"endpoint":"/home","method":"GET"}}
{"ts":"2024-03-20T15:07:15.364Z","level":"warning","msg":"things could be better","scope":"demo","meta":{"endpoint":"/home","method":"GET"}}</code>
๐ผ installing
Create a new exec project with <code>zig init-exe</code>. Copy the echo handler example above 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-jsonlog/archive/refs/tags/v0.2.1.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
+ .jsonlog = .{
+ // ๐ uri to download
+ .url = "https://github.com/softprops/zig-jsonlog/archive/refs/tags/v0.2.1.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-jsonlog/archive/refs/tags/v{version}.tar.gz</code> or current main with <code>https://github.com/softprops/zig-jsonlog/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 jsonlog dep from build.zig.zon
</code>
<ul>
<li>const jsonlog = b.dependency("jsonlog", .{</li>
<li>.target = target,</li>
<li>.optimize = optimize,</li>
<li>}).module("jsonlog");
var exe = b.addExecutable(.{
.name = "your-exe",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
// ๐ add the jsonlog module to executable</li>
<li>
exe.root_mode.addImport("jsonlog", jsonlog);
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/5048090?v=4 | zig-tour | jackdbd/zig-tour | 2023-04-13T16:21:07Z | An introduction to the Zig programming language and toolchain | main | 3 | 1 | 0 | 1 | https://api.github.com/repos/jackdbd/zig-tour/tags | - | [
"meetup",
"zig"
] | 5,228 | false | 2024-08-16T00:06:03Z | false | false | unknown | github | [] | Zig tour
An introduction to the Zig programming language and toolchain.
I gave this talk at <a>pisa.dev</a>.
<ul>
<li>๐ https://zig-tour.vercel.app/</li>
<li>๐บ https://www.youtube.com/live/Fe1xDUh6dYs</li>
<li>๐ https://raw.githubusercontent.com/jackdbd/zig-tour/main/assets/zig-tour.pdf</li>
</ul>
Installation
The presentation is Vue.js application built with <a>Slidev</a>. You can install the dependencies with:
<code>sh
npm install</code>
Development
Slidev can hot-code reload your presentation thanks to Vite. Launch the dev server with:
<code>sh
npm run dev</code>
Slidev Play mode:
http://localhost:3030/1
Slidev <a>Presenter</a> Mode:
http://localhost:3030/presenter/1
Deploy
The <code>dist</code> directory will be automatically deployed to Vercel on each <code>git push</code>.
PDF export
Slidev allows <a>exporting the slides to a PDF</a>. This feature relies on <a>Playwright</a> and requires <a>playwright-chromium</a> to work. Since I did not want to install Playwright when building on Vercel (so deployments are faster), I declared <code>playwright-chromium</code> as a dev dependency and set <code>npm install --omit=dev</code> as the Vercel <code>installCommand</code> in <code>vercel.json</code>.
Run this command to export the presentation to <code>assets/zig-tour.pdf</code>:
<code>sh
npm run export:pdf</code>
Note: exporting the notes with this command generates an empty PDF. Maybe a Slidev bug?
<code>sh
npx slidev export-notes --output assets/zig-tour-notes</code> | [] |
https://avatars.githubusercontent.com/u/18609989?v=4 | lox-zig | adrianchong518/lox-zig | 2023-05-24T14:29:48Z | A Lox bytecode VM compiler / interpreter written in Zig | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/adrianchong518/lox-zig/tags | MIT | [
"crafting-interpreters",
"lox",
"zig"
] | 96 | false | 2025-02-12T21:03:56Z | true | false | unknown | github | [] | lox-zig
A bytecode VM compiler / interpreter for the Lox language written in Zig from the book <a>Crafting Interpreters</a> | [] |
https://avatars.githubusercontent.com/u/90179203?v=4 | taptempo-zig | alberic89/taptempo-zig | 2023-08-02T18:32:00Z | Un Taptempo minimaliste codรฉ en zig | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/alberic89/taptempo-zig/tags | GPL-3.0 | [
"zig"
] | 35 | false | 2025-02-20T15:30:28Z | false | false | unknown | github | [] | taptempo-zig
Un Taptempo minimaliste codรฉ en zig
Compilรฉ avec succรจs avec zig 0.11.0 (4 aoรปt 2023)
Retouvez le code source ร <a>https://github.com/alberic89/taptempo-zig</a>
Pour compiler :
<code>bash
zig build-exe taptempo.zig</code>
Lancez avec :
<code>bash
./taptempo</code>
Vous pouvez spรฉcifier le nombre de frappe avec :
<code>bash
./taptempo nombre_de_frappe</code>
Sur une idรฉe de Franรงois Mazen
https://linuxfr.org/users/mzf/journaux/un-tap-tempo-en-ligne-de-commande
Merci ร Leon Henrik Plickat pour son exemple d'application zig "Uncooked"
https://zig.news/lhp/want-to-create-a-tui-application-the-basics-of-uncooked-terminal-io-17gm | [] |
https://avatars.githubusercontent.com/u/56188619?v=4 | zigonic | hun756/zigonic | 2023-10-30T20:26:13Z | Algorithm library in Zig programming language | main | 0 | 1 | 0 | 1 | https://api.github.com/repos/hun756/zigonic/tags | MIT | [
"algorithm",
"algorithms",
"zig",
"zig-lang",
"zig-library",
"ziglang"
] | 31 | false | 2025-01-19T15:37:57Z | true | false | unknown | github | [] | zigonic
Algorithm library in Zig programming language | [] |
https://avatars.githubusercontent.com/u/85593302?v=4 | funnel | svelterust/funnel | 2023-05-31T12:16:52Z | Funny operating system | master | 0 | 1 | 0 | 1 | https://api.github.com/repos/svelterust/funnel/tags | - | [
"x86",
"zig"
] | 19 | false | 2023-12-29T22:30:01Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/6756180?v=4 | 3bc-zig | kassane/3bc-zig | 2023-07-18T18:40:47Z | Raw 3BC bindings for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/kassane/3bc-zig/tags | GPL-3.0 | [
"3bc-lang",
"ffi",
"zig",
"ziglang"
] | 22 | false | 2023-11-01T17:11:04Z | true | false | unknown | github | [] | 3bc-zig
Raw 3BC bindings for Zig.
This zig binding is designed for testing interoperability between both languages.
Whats is <a>3BC language</a>?
Low-level language, tiny virtual machine, intermediate representation, embeddable, easy for beginners.
Requirements
<ul>
<li>zig <a>v0.12 or higher</a></li>
<li>git for download 3bc-lang dependency</li>
</ul>
Acknowledgements
<ul>
<li><strong>Rodrigo Dornelles</strong> is author of 3BC language.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/5579064?v=4 | zig-xplat-cube | carljdp/zig-xplat-cube | 2023-08-11T07:43:11Z | An Experiment - Learning cross-platform Zig lang + OpenGL | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/carljdp/zig-xplat-cube/tags | - | [
"3d",
"3d-engine",
"cross-platform",
"crossplatform",
"engine3d",
"glfw",
"glfw3",
"glsl",
"opengl",
"opengl4",
"zig"
] | 319 | false | 2023-11-01T17:24:25Z | true | false | unknown | github | [] | zig-xplat-cube
A Zig based attempt to rotate a cube on multiple platforms.
Rationale
I want to learn Zig, and I want to learn how to make cross platform applications. I also want to learn how to make 3D graphics. This project is an attempt to do all of those things at once.
Description
// TODO: add more detailed description
Table of Contents
// TODO: add table of contents
Developer Guide
Quickstart
<code>shell
git clone https://github.com/carljdp/zig-xplat-cube.git
cd zig-xplat-cube
zig build run</code>
Prerequisites / Dependencies
<ul>
<li><code>zig</code></li>
<li><code>vcpkg</code> - for installing <code>glfw</code> on windows</li>
<li><code>glfw</code> - for windowing and opengl context</li>
<li>I have not yet decided between <code>glad</code> and <code>glew</code> for opengl loading. I'm currently using <code>glad</code> because it seems to be the more modern of the two.<ul>
<li><code>glfw</code> is a C library, so we need to use <code>c_import</code> to use it in Zig.</li>
</ul>
</li>
</ul>
Project Conventions
Structure
<ul>
<li><code>src/</code> - zig source files</li>
<li><code>src/main.zig</code> - main entry point</li>
<li><code>build.zig</code> - zig build config</li>
</ul>
Configuration
<ul>
<li><code>.env</code> - nothing here yet</li>
<li><code>.env.example</code> - nothing here yet</li>
</ul>
Other Stuff
Disclaimer & Acknowledgements
Used paid versions of both ChatGPT and GitHub Copilot
License
// TODO: choose license | [] |
https://avatars.githubusercontent.com/u/13811862?v=4 | cnbt-zig | thechampagne/cnbt-zig | 2023-04-18T12:51:09Z | Zig binding for cNBT an NBT file parser and manipulator library. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/thechampagne/cnbt-zig/tags | Apache-2.0 | [
"zig",
"zig-package"
] | 5 | false | 2023-04-22T00:47:32Z | false | false | unknown | github | [] | cnbt-zig
<a></a> <a></a>
Zig binding for <strong>cNBT</strong> an NBT file parser and manipulator library.
References
<ul>
<li><a>cnbt</a></li>
</ul>
License
This repo is released under the <a>Apache License 2.0</a>. | [] |
https://avatars.githubusercontent.com/u/55260788?v=4 | zvm | Wraith29/zvm | 2023-04-08T22:20:12Z | Zig Version Manager | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Wraith29/zvm/tags | - | [
"zig"
] | 78 | false | 2023-11-01T17:12:13Z | true | false | unknown | github | [] | Zig Version Manager
As of right now, this will only work on x86_64 Windows machines,
I am looking to improve this, but it will take a while.
Usage
<ul>
<li>list [-i]</li>
<li>lists installed versions of zig</li>
<li>install \</li>
<li>attempt to install the specified version</li>
<li>latest</li>
<li>install latest version</li>
<li>select \</li>
<li>select the specified version (if installed)</li>
<li>current</li>
<li>outputs current version in use</li>
</ul>
Requirements
<ul>
<li><code>7z</code> executable on Path</li>
<li><code>pwsh</code> executable on Path</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/60897190?v=4 | ansi | Remy2701/ansi | 2023-06-17T08:36:25Z | Library to manipulate ansi codes in zig! | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Remy2701/ansi/tags | - | [
"ansi",
"zig"
] | 4 | false | 2023-06-17T19:25:53Z | true | false | unknown | github | [] | ANSI
This library provides abstraction to write ANSI codes, this allows you to
- Set background and foreground color
- Set text mode (Bold, Italic, Strikethrough, ...)
- Erase
- Manipulate the cursor
Installation
Clone this repository in your libs folder.
<code>sh
git clone https://github.com/Remy2701/ansi</code>
Then add the following line in the <code>build.zig</code>:
```zig
const ansi = @import("libs/ansi/build.zig");
pub fn build(b: *Build) !void {
...
exe.addModule("ansi", ansi.module(b));
}
```
Usage
```zig
const std = @import("std");
const ansi = @import("ansi");
pub fn main() void {
std.debug.print("Hello, {}{}World{}!\n", .{
ansi.Graphics.bold(),
ansi.Foreground.blue(),
ansi.Graphics.reset()
});
}
``` | [
"https://github.com/derveloper/aoc.zig"
] |
https://avatars.githubusercontent.com/u/24578855?v=4 | ztool | deatil/ztool | 2023-08-14T08:52:15Z | ztool ๆฏไธไธชไฝฟ็จ zig ่ฏญ่จๅผๅ่ทๅๆไปถๆ่ฆ็ๅทฅๅ
ท | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/deatil/ztool/tags | Apache-2.0 | [
"base64",
"hash",
"md5",
"sha1",
"tools",
"zig"
] | 39 | false | 2023-08-16T02:49:06Z | true | false | unknown | github | [] | ztool
ztool ๆฏไธไธชไฝฟ็จ zig ่ฏญ่จๅผๅ่ทๅๆไปถๆ่ฆ็ๅทฅๅ
ท
็ฏๅข่ฆๆฑ
<ul>
<li>Zig >= 0.11</li>
</ul>
ไธ่ฝฝๅฎ่ฃ
~~~cmd
git clone github.com/deatil/ztool
~~~
ๅผๅงไฝฟ็จ
็ผ่ฏๆต่ฏ
~~~cmd
zig build run
~~~
่ฟ่ก
~~~cmd
./ztool -h
./ztool --help
./ztool -t=md5 [-i=in.txt] [-o=out.txt] [-k=key_data] [-s=1]
./ztool --type=md5 [--in=in.txt] [--out=out.txt] [--key=key_data] [--show=1]
~~~
ๅๆฐ
~~~zig
type: ็ฑปๅ b64en, b64de, md5, sha1,
file_md5, file_sha1, file_sha256, file_hmacmd5, file_hmacsha1,
sha224, sha256, sha384, sha512,
sha3_224, sha3_256, sha3_384, sha3_512, hmac_md5
in: ่พๅ
ฅๆไปถ, ้ป่ฎคไธบ in.txt
out: ่พๅบๆไปถ, ้ป่ฎคไธบ out.txt
key: Hmacๆถๅฏ้ฅ,้ป่ฎคไธบ็ฉบ
show: ๆฏๅฆๅจๆงๅถๅฐๆพ็คบ็ปๆ๏ผ้ป่ฎคๅฆ
~~~
ๅผๆบๅ่ฎฎ
<ul>
<li>ๆฌ่ฝฏไปถๅ
้ตๅพช <code>Apache2</code> ๅผๆบๅ่ฎฎๅๅธ๏ผๅจไฟ็ๆฌ่ฝฏไปถๅ
็ๆ็ๆ
ๅตไธๆไพไธชไบบๅๅไธๅ
่ดนไฝฟ็จใ</li>
</ul>
็ๆ
<ul>
<li>ๆฌ่ฝฏไปถๅ
ๆๅฑ็ๆๅฝ deatil(https://github.com/deatil) ๆๆใ</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/13811862?v=4 | sfdir-zig | thechampagne/sfdir-zig | 2023-04-18T22:33:28Z | Zig binding for Single-file dir a directory listing functions. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/thechampagne/sfdir-zig/tags | Apache-2.0 | [
"zig",
"zig-package"
] | 4 | false | 2023-04-22T00:47:01Z | false | false | unknown | github | [] | sfdir-zig
<a></a> <a></a>
Zig binding for <strong>Single-file dir</strong> a directory listing functions.
References
<ul>
<li><a>sfdir</a></li>
</ul>
License
This repo is released under the <a>Apache License 2.0</a>. | [] |
https://avatars.githubusercontent.com/u/59750184?v=4 | clip.zig | fremantle-industries/clip.zig | 2023-03-25T01:38:47Z | A declarative CLI programming language | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fremantle-industries/clip.zig/tags | MIT | [
"cli",
"declarative",
"declarative-cli",
"zig"
] | 2 | false | 2023-03-28T04:46:21Z | true | false | unknown | github | [] | clip.zig
A declarative CLI programming language
Development
<code>sh
make</code>
Test
<code>sh
make test</code>
Authors
<ul>
<li>Alex Kwiatkowski - alex+git@fremantle.io</li>
</ul>
License
<code>clip.zig</code> is released under the <a>MIT license</a> | [] |
https://avatars.githubusercontent.com/u/20625305?v=4 | zig_c_cxx_build | axojhf/zig_c_cxx_build | 2023-05-20T13:07:28Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/axojhf/zig_c_cxx_build/tags | MIT | [
"zig"
] | 27 | false | 2023-05-24T10:15:19Z | false | false | unknown | github | [] | zig_c_cxx_build
Use the zig compilation system to compile C/C++ open source projects. | [] |
https://avatars.githubusercontent.com/u/29982750?v=4 | ZIG-LEARN | rakesh740/ZIG-LEARN | 2023-08-04T06:37:29Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/rakesh740/ZIG-LEARN/tags | - | [
"hacktoberfest",
"zig"
] | 7 | false | 2023-10-01T13:59:25Z | false | false | unknown | github | [] | ZIG-LEARN
I am trying to learn a new language zig using resources in https://ziglang.org/learn/ | [] |
https://avatars.githubusercontent.com/u/137411855?v=4 | amgine | JosephABudd/amgine | 2023-07-17T17:06:13Z | I'm just learning zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/JosephABudd/amgine/tags | MIT | [
"cypher",
"zig"
] | 13 | false | 2023-11-01T17:12:08Z | true | false | unknown | github | [] | amgine
July 26, 2023
This library might be finished.
July 18, 2023
amgine is a poly numberic substituion cypher. ( Similar to the poly alphabetic substition cyphers children create in grade school for passing secret messages around. )
This project is how I am learning zig and making a zig library. This library is working but I have not tested and used the marshalling.
I got this library to work in a zig application folder's libs/ folder so now I'm trying to use the lib with zigmod and zigmod fetch.
The Zig Discord Team
<a>The <strong>Men</strong> and <strong>Women</strong> at the zig discord server</a> have gotten me over most of my mental hurdles with their help. Now I'm thinking the Zig way and I'm really liking Zig. | [] |
https://avatars.githubusercontent.com/u/12962448?v=4 | configurator | star-tek-mb/configurator | 2023-02-24T18:51:14Z | Configurator | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/star-tek-mb/configurator/tags | - | [
"config",
"django",
"laravel",
"nginx",
"proxy",
"zig"
] | 6 | false | 2023-07-08T22:34:53Z | true | false | unknown | github | [] | Overview
Configurator is a template generator
Purpose
Make my life easier to deploy my apps with nginx
Build
Tested with Zig <code>0.11.0-dev.1711+dc1f50e50</code>
<code>zig build</code>
Run with
<code>zig build run</code>
How to add new config
To add new config look into <code>main.zig</code> for example of predefined configurations.
For example your new config will look like:
```zig
pub const NewConfig = struct {
pub const Template = @embedFile("config.template");
<code>var1: []const u8 = "default",
var2: []const u8 = "value",
var3: []const u8 = "or example",
</code>
};
```
Then create and place your <code>config.template</code> in <code>src</code> directory:
<code>var1 = {{var1}}
var2 = {{var2}}
var3 = {{var3}}</code>
Don't forget to include your <code>NewConfig</code> to list of <code>Configs</code> in <code>main.zig</code>:
<code>pub const Configs = .{ NewConfig, Laravel, Django, Proxy };</code> | [] |
https://avatars.githubusercontent.com/u/47928703?v=4 | hello-world-zig | eavelasquez/hello-world-zig | 2023-04-10T21:34:45Z | This repository contains exercises for learning the Zig programming language. The exercises are based on the ziglings repository. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/eavelasquez/hello-world-zig/tags | - | [
"zig",
"ziglings"
] | 11 | false | 2023-04-10T21:35:56Z | false | false | unknown | github | [] | Hello World Zig
This repository contains exercises for learning the <a>Zig programming language</a>. The exercises are based on the <a>ziglings</a> repository. | [] |
https://avatars.githubusercontent.com/u/23489037?v=4 | divide-zig | lacc97/divide-zig | 2023-07-02T20:36:21Z | A port of libdivide for the Zig language | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/lacc97/divide-zig/tags | BSL-1.0 | [
"zig"
] | 8 | false | 2023-07-02T20:41:56Z | true | false | unknown | github | [] | divide-zig
A port of <a>libdivide</a> to Zig. | [] |
https://avatars.githubusercontent.com/u/54628577?v=4 | zigocs | C0DIC/zigocs | 2023-04-06T14:49:19Z | ะะพะบัะผะตะฝัะฐัะธั ัะทัะบะฐ ะฟัะพะณัะฐะผะผะธัะพะฒะฐะฝะธั Zig ั ะฟัะธะผะตัะฐะผะธ | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/C0DIC/zigocs/tags | MIT | [
"documentation",
"programming-language",
"russian",
"russian-language",
"zig"
] | 7 | false | 2023-04-06T16:19:01Z | false | false | unknown | github | [] | zigocs
ะะพะบัะผะตะฝัะฐัะธั (ะฝะตะพั.) ัะทัะบะฐ ะฟัะพะณัะฐะผะผะธัะพะฒะฐะฝะธั <a>Zig</a> ั ะฟัะธะผะตัะฐะผะธ.
Zig unofficial documentaion in Russian language
ะะฑัะฐั ะธะฝัะพัะผะฐัะธั
<ul>
<li>ะัั ะดะพะบัะผะตะฝัะฐัะธั ะฒ <a>docs</a></li>
<li>ะ ะบะฐะถะดะพะน ะฟะฐะฟะบะต ะธะผะตะตััั ะผะด-ัััะฐะฝะธัะฐ ั ะดะพะบัะผะตะฝัะฐัะธะตะน ะธ ัะฐะนะป ั ะบะพะดะพะผ</li>
</ul>
ะะธัะตะฝะทะธั
ะัะต ะฟะพะด MIT-ะปะธัะตะฝะทะธะตะน. ะะพะถะฝะพ ะดะตะปะฐัั ะฒัะต, ััะพ ัะณะพะดะฝะพ, ะฝะพ ะฝะต ะฟัะธัะฒะฐะธะฒะฐัั ะฟัะพะดะตะปะฐะฝะฝัั ัะฐะฑะพัั ัะตะฑะต | [] |
https://avatars.githubusercontent.com/u/67988550?v=4 | zig-cli-hello-world | bearddan2000/zig-cli-hello-world | 2023-06-24T12:50:16Z | A POC zig program hello world. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/bearddan2000/zig-cli-hello-world/tags | - | [
"cli",
"hello",
"world",
"zig"
] | 1 | false | 2023-06-24T12:50:22Z | false | false | unknown | github | [] | zig-cli-hello-world
Description
A POC zig program hello world.
Tech stack
<ul>
<li>zig</li>
</ul>
Docker stack
<ul>
<li>euantorano/zig</li>
</ul>
To run
<code>sudo ./install.sh -u</code>
To stop
<code>sudo ./install.sh -d</code>
For help
<code>sudo ./install.sh -h</code> | [] |
https://avatars.githubusercontent.com/u/6811788?v=4 | monocypher-zig | permutationlock/monocypher-zig | 2023-07-02T22:06:38Z | Zig bindings for the Monocypher cryptography library. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/permutationlock/monocypher-zig/tags | MIT | [
"cryptography",
"monocypher",
"zig"
] | 16 | false | 2023-07-08T04:33:23Z | true | false | unknown | github | [] | Monocypher-Zig
Monocypher-Zig aims to provide simple Zig bindings for the
<a>Monocypher</a> cryptography
library. It currently targets the Zig 10.1 release.
For most functions it simply provides a casting
interface to allow Zig code to pass slices rather than pointers
and sizes.
The incremental interface for authenticated encryption
has a more involved implementation that aims to be compatible
with the Zig Standard Library Reader/Writer interface.
The interface for Argon2 password derivation uses a passed
Allocator to allocate the workspace memory, rather than taking a void
pointer. | [] |
https://avatars.githubusercontent.com/u/473672?v=4 | pong | fabioarnold/pong | 2023-05-02T21:47:15Z | Pong game | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fabioarnold/pong/tags | MIT | [
"game",
"sdl2",
"zig"
] | 10 | false | 2023-05-02T21:50:24Z | true | true | unknown | github | [
{
"commit": "3eb87f0f5b8d815d5a608b732e1d77f0876712d9.tar.gz",
"name": "sdl",
"tar_url": "https://github.com/andrewrk/SDL/archive/3eb87f0f5b8d815d5a608b732e1d77f0876712d9.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/andrewrk/SDL"
}
] | Pong
Config
To configure which paddle is controlled by AI edit <a>config.zig</a>.
Build and run
<code>bash
$ zig build run</code>
Tested with <a>Zig</a> version <code>0.12.0-dev.1830+779b8e259</code>. | [] |
https://avatars.githubusercontent.com/u/81272124?v=4 | zig | xpdojo/zig | 2023-02-19T13:12:47Z | Zig is an imperative, general-purpose, statically typed, compiled system programming language designed by Andrew Kelley. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/xpdojo/zig/tags | MIT | [
"zig"
] | 1 | false | 2023-02-19T13:13:36Z | false | false | unknown | github | [] | zig
Zig is an imperative, general-purpose, statically typed, compiled system programming language designed by Andrew Kelley. | [] |
https://avatars.githubusercontent.com/u/59750184?v=4 | sql.zig | fremantle-industries/sql.zig | 2023-03-25T02:21:35Z | A generic SQL interface for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fremantle-industries/sql.zig/tags | MIT | [
"sql",
"zig"
] | 2 | false | 2023-03-28T05:27:13Z | true | false | unknown | github | [] | sql.zig
A generic SQL interface for Zig
Development
<code>sh
make</code>
Test
<code>sh
make test</code>
Authors
<ul>
<li>Alex Kwiatkowski - alex+git@fremantle.io</li>
</ul>
License
<code>sql.zig</code> is released under the <a>MIT license</a> | [] |
https://avatars.githubusercontent.com/u/87276646?v=4 | Zig | tomiis4/Zig | 2023-04-15T19:09:16Z | My Zig projects with cheatsheet | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tomiis4/Zig/tags | - | [
"cheatsheet",
"zig",
"zig-cheatsheet"
] | 7 | false | 2023-05-01T13:32:54Z | false | false | unknown | github | [] | <a>Zig</a> Cheatsheet
* [File](#file)
* [Hello world](#hello-world)
* [Importing packages](#importing-packages)
* [Variables & Types](#variables)
* [structs](#structs)
* [map](#map)
* [Functions](#functions)
* [Logic statements](#logic-statements)
* [if/else](#ifelse)
* [switch/case](#switchcase)
* [Loop](#loop)
* [for-i](#for-i)
* [for-in](#for-in)
* [while](#while)
* [Converting](#converting)
* [Build-in iunctions](#build-in-functions)
* [func](#func)
* [Pointers](#pointers)
* [Unit testing](#unit-testing)
* [External file](#external-file)
* [Remote packages](#remote-packages)
* [Packages](#packages)
* [pkg](#pkg)
* [Project ideas](#project-ideas)
File
Run file
<code>zig run file.zig</code>
Generate exe file
<code>zig build-exe file.zig</code>
Hello world
```zig
// import print fromm std
const print = @import("std").debug.print;
// create main function
pub fn main() void {
// print
print("Hello, world!\n", .{});
}
```
Importing packages
<code>zig
const <package> = @import("<package-name>");</code>
Variables
```zig
// mutable
var : type = ;
var : type; // empty
// immutable
const : type = ;
// arrays
var arr: [] = [, ...];
var arr: []; // empty
/<em>
Type:
bool = %b = true, false
u8, u16, u32, u64, u128 = %d = number in range of x bits, can't be negative
i8, i16, i32, i64, i128 = %d = number in range of x bits, can be negative
f16, f32, f64 = %f = decimal numbers
[] u8 = %.</em>s = string
*/
```
Structs
```zig
// create struct
const = struct {
: ,
: ,
};
// use struct
const = {
: ,
: ,
};
```
Map
```zig
const HashMap = @import("std").HashMap;
// create map
var = HashMap().init();
// add item
.put(, );
// read item
const = .get();
```
Functions
```zig
// normal function for one file
fn name() void {
//...
}
// public function
pub fn name() void {
//...
}
// return
fn name() { return x; }
fn name() (, ) { return (x, y); }
// parameters
fn name(param1: ) { }
fn name(param1, param2: ) { } // if param1 have same type as param2
```
Logic Statements
If/else
<code>zig
if (<statement>) {
// ...
}</code>
Switch/case
<code>zig
switch (operation) {
x => <do-x>,
y => <do-y>,
else => <do-else>,
}</code>
Loop
For-I
<code>zig
for (var i: u32 = 0; i<10; i++) {
// ...
}</code>
For-In
```zig
var arr: [10]u8 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
for (arr) |elem, i| {
// ...
}
```
While
<code>zig
while (condition) {
// ...
}</code>
Converting
```zig
// str -> int
const str = "123";
const num = try std.parseInt(u32, str);
// int -> str
```
Build-In Functions
func
<code>zig</code>
Pointers
```zig
```
Unit Testing
<code>sh</code>
<code>zig
// main.zig
// main_test.zig</code>
External file
```zig
// folder structure
|- main.zig
|
|- example
|- second.zig
// main.zig
// second.zig
```
Remote packages
Install packages
```
```
Import packages
<code>zig</code>
Packages
pkg
<code>zig
// code</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> Enums
<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> std.io
Project ideas
<ul>
<li><a>name</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/25912761?v=4 | snorlax | r4gus/snorlax | 2023-08-15T22:18:50Z | CouchDB client | master | 1 | 0 | 0 | 0 | https://api.github.com/repos/r4gus/snorlax/tags | - | [
"couchdb",
"couchdb-client",
"database",
"zig",
"ziglang"
] | 23 | false | 2023-08-17T19:39:10Z | true | false | unknown | github | [] | Snorlax
A <strong>work in progress</strong> <a>CouchDB</a> client library.
Getting started
<ol>
<li>Install <a>Zig</a> <code>0.11.0</code> on your system.</li>
<li>Follow the CouchDB <a>installation instructions</a>
to setup CouchDB on your system.</li>
<li>Then check out one of the <a>examples</a>. After running <code>zig build</code> you can find the executables in <code>zig-out/bin</code>.</li>
</ol>
<blockquote>
Note: You have to adjust the examples (e.g. username and password)!
</blockquote>
Adding Snorlax to your application
First add this library as dependency to your <code>build.zig.zon</code> file:
```zon
.{
.name = "your-project",
.version = 0.0.1,
<code>.dependencies = .{
.snorlax = .{
.url = "https://github.com/r4gus/snorlax/archive/master.tar.gz",
.hash = "<your hash>",
}
},
</code>
}
```
<blockquote>
The easiest way to obtain the hash is to leave it blank or enter a wrong hash and then copy the correct
one from the error message.
</blockquote>
Then within your <code>build.zig</code>:
```zig
// Fetch the dependency...
const snorlax_dep = b.dependency("snorlax", .{
.target = target,
.optimize = optimize,
});
// ...and obtain the module
const snorlax_module = snorlax_dep.module("snorlax");
...
// Add this module to your executable
exe.addModule("snorlax", snorlax_module);
```
After you've added the <code>snorlax</code> module to your application, you can import it using
<code>const snorlax = @import("snorlax");</code>.
Overfiew
Currently the library supports the following operations:
<ul>
<li>Create a new database by using the <code>createDatabase</code> function</li>
<li>Delete a database (and all its documents) by using the <code>deleteDatabase</code> function</li>
<li>Create a new document by using the <code>createDocument</code> function</li>
<li>Find a document based on <em>selectors</em> by using the <code>find</code> function</li>
<li>Read a specific document by using the <code>read</code> function</li>
<li>Update a existing document by using the <code>update</code> function</li>
<li>Delete a existing document by using the <code>delete</code> function</li>
</ul>
Check out the <a>examples</a> folder for an overfiew on how to use the library. | [] |
https://avatars.githubusercontent.com/u/59750184?v=4 | kafka.zig | fremantle-industries/kafka.zig | 2023-03-27T05:48:14Z | A Kafka client for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fremantle-industries/kafka.zig/tags | MIT | [
"apache-kafka",
"kafka",
"kafka-client",
"zig"
] | 2 | false | 2023-03-28T04:10:30Z | true | false | unknown | github | [] | kafka.zig
A Kafka client for Zig
Test
<code>sh
make test</code>
Authors
<ul>
<li>Alex Kwiatkowski - alex+git@fremantle.io</li>
</ul>
License
<code>kafka.zig</code> is released under the <a>MIT license</a> | [] |
https://avatars.githubusercontent.com/u/135145066?v=4 | RLock | dying-will-bullet/RLock | 2023-07-17T15:09:54Z | Reentrant lock in Zig. | master | 1 | 0 | 1 | 0 | https://api.github.com/repos/dying-will-bullet/RLock/tags | MIT | [
"lock",
"mutex",
"threading",
"zig",
"ziglang"
] | 8 | false | 2023-11-01T17:12:17Z | true | true | unknown | github | [] | RLock
<a></a>
A reentrant lock is a synchronization primitive that may be acquired multiple times by the same thread.
Internally, it uses the concepts of "owning thread" and "recursion level" in addition to the locked/unlocked state used by primitive locks.
In the locked state, some thread owns the lock; in the unlocked state, no thread owns it.
Example
```zig
const std = @import("std");
const Thread = std.Thread;
const RLock = @import("RLock").RLock;
var counter: usize = 0;
var rlock = RLock.init();
pub fn main() !void {
var threads: [100]std.Thread = undefined;
<code>for (&threads) |*handle| {
handle.* = try std.Thread.spawn(.{}, struct {
fn thread_fn() !void {
for (0..100) |_| {
rlock.lock();
defer rlock.unlock();
counter += 1;
Thread.yield() catch {};
rlock.lock();
defer rlock.unlock();
counter += 1;
}
}
}.thread_fn, .{});
}
for (threads) |handle| {
handle.join();
}
std.debug.assert(counter == 20000);
std.debug.print("counter => {d}\n", .{counter});
</code>
}
```
License
MIT | [] |
https://avatars.githubusercontent.com/u/6188189?v=4 | aoc22.zig | scnewma/aoc22.zig | 2023-06-28T04:51:04Z | Advent of Code 2022 in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/scnewma/aoc22.zig/tags | - | [
"advent-of-code-2022",
"zig"
] | 24 | false | 2023-11-01T17:24:55Z | true | false | unknown | github | [] | Advent of Code 2022
Rewriting my <a>Rust solutions</a> in <a>Zig</a> to learn the language. | [] |
https://avatars.githubusercontent.com/u/5454662?v=4 | zemc | fveilly/zemc | 2023-08-30T17:04:53Z | Zig Embedded Containers | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fveilly/zemc/tags | MIT | [
"containers",
"linked-list",
"zig"
] | 7 | false | 2023-11-01T17:25:51Z | true | false | unknown | github | [] | ZEmC
Zig Embedded Containers
A collection of embedded containers for Zig inspired by the linux kernel's implementation.
Circular doubly linked list
```
// Any structure containing ListHead can be added to the list
const Point = struct { x: i32, y: i32, list_ref: ListHead };
// Initialize the head of the list
var list = ListHead.default();
list_init(&list);
var p1: Point = .{ .x = 13, .y = 64, .list_ref = ListHead.default() };
var p2: Point = .{ .x = 14, .y = 65, .list_ref = ListHead.default() };
// Add two elements to the list
list.add(&p1.list_ref);
list.add_tail(&p2.list_ref);
// Iterate over the list
var iter = ListIterator(Point).init(&list, "list_ref");
while (iter.next()) |value| {
value.x += 1;
}
// Iterate over the list and remove all the elements
var rawIter = ListIteratorRaw().init(&list);
while (rawIter.next()) |entry| {
list_del(entry);
}
try expect(list.empty());
``` | [] |
https://avatars.githubusercontent.com/u/76484203?v=4 | zigu | lebenoa/zigu | 2024-01-13T12:06:39Z | Yet another zig updater.. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/lebenoa/zigu/tags | BSL-1.0 | [
"updater",
"zig"
] | 63 | false | 2025-01-15T14:31:19Z | true | true | unknown | github | [] |
# Zigu
Yet another (Zig) (u)pdater
# Dependencies
Runtime
<ul>
<li><code>tar</code> for extracting compressed archive (Runtime)</li>
</ul>
Build
<blockquote>
No build dependencies other than <code>Zig compiler</code>
</blockquote>
Usage
```pwsh
Usage:
zigu
Commands:
list Show all available versions
latest Install latest stable version
nightly | master Install latest nightly version
[version] Install specified version.
Will resolve to a latest version with the provided prefix
help Show this help message
Examples:
zigu latest
<code> zigu 0 Will resolve to latest 0.x.x version (i.e. 0.11.0) if any
zigu 0.10 Will resolve to latest 0.10 version (i.e. 0.10.1) if any
zigu 1 Will resolve to latest 1.x.x version if any
</code>
```
Screenshot
| [] |
https://avatars.githubusercontent.com/u/91773180?v=4 | randomstring-zig | zaki3mymy/randomstring-zig | 2023-11-12T11:30:38Z | Generate random string for Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/zaki3mymy/randomstring-zig/tags | MIT | [
"zig"
] | 5 | false | 2023-11-12T15:03:46Z | true | false | unknown | github | [] | randomstring-zig
Generate random string for Zig.
Example
```zig
const std = @import("std");
const rs = @import("./randomstring.zig");
pub fn main() !void {
// Allocate a fixed-size buffer on the stack to be used as the initial memory for the allocator.
var buf: [1024]u8 = undefined;
var fba = std.heap.FixedBufferAllocator.init(&buf);
var allocator = fba.allocator();
defer allocator.free(&buf);
<code>var str = try rs.randomString(16, allocator);
std.debug.print("{s}\n", .{str});
</code>
}
```
```
zig run src/main.zig
qBZCsHeyFJujoTxA
``` | [] |
https://avatars.githubusercontent.com/u/48196342?v=4 | zig-term-colors | BiscuitTin/zig-term-colors | 2024-01-16T17:49:55Z | [WIP] A simple library for ANSI terminal colors and styles in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/BiscuitTin/zig-term-colors/tags | MIT | [
"ansi",
"colors",
"select-graphic-rendition",
"terminal",
"zig"
] | 286 | false | 2024-01-23T16:54:34Z | true | true | 0.12.0 | github | [] | <a></a>
<a></a>
Zig terminal colors
A simple library for ANSI terminal colors and styles in Zig.
View full demo
Goals
Non-goals
Related projects
<ul>
<li><a>ansi-term</a> - Zig library for dealing with ANSI Terminals (escape codes, styles, etc.)</li>
<li><a>chameleon</a> - Terminal string styling for zig.</li>
<li><a>zig-ansi</a> - ANSI utilities for CLI usage in Zig.</li>
<li><a>mibu</a> - Pure Zig library for low-level terminal manipulation.</li>
</ul>
License
This project is licensed under the MIT License - see the <a>LICENSE</a> file for details. | [] |
https://avatars.githubusercontent.com/u/30635996?v=4 | zig-nix-deez | mitsuruu/zig-nix-deez | 2023-08-04T18:05:02Z | Template repository for bootstrapping a Zig executable using a Nix Flake | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/mitsuruu/zig-nix-deez/tags | Unlicense | [
"nix",
"nix-flakes",
"zig",
"ziglang"
] | 9 | false | 2023-08-20T21:19:32Z | true | false | unknown | github | [] | zig-nix-deez
A very basic (yet functional) way of getting Zig and Nix Flakes to work together to build a binary package for you. No bells, no whistles, just a <code>flake.nix</code> with a basic <code>stdenv.mkDerivation</code> to build a Hello World. | [] |
https://avatars.githubusercontent.com/u/87582318?v=4 | libwebp | koenigskraut/libwebp | 2023-10-24T17:32:32Z | libwebp partially ported to Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/koenigskraut/libwebp/tags | BSD-3-Clause | [
"libwebp",
"webp",
"zig"
] | 12,237 | true | 2023-12-25T06:43:49Z | true | true | unknown | github | [
{
"commit": "cddbd65797d0947b0a4f905f446c7c6c32a4db3f.tar.gz",
"name": "intrinzic",
"tar_url": "https://github.com/koenigskraut/intrinzic/archive/cddbd65797d0947b0a4f905f446c7c6c32a4db3f.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/koenigskraut/intrinzic"
}
] | WebP Codec
<code>__ __ ____ ____ ____
/ \\/ \/ _ \/ _ )/ _ \
\ / __/ _ \ __/
\__\__/\____/\_____/__/ ____ ___
/ _/ / \ \ / _ \/ _/
/ \_/ / / \ \ __/ \__
\____/____/\_____/_____/____/v1.3.2</code>
WebP codec is a library to encode and decode images in WebP format. This package
contains the library that can be used in other programs to add WebP support, as
well as the command line tools 'cwebp' and 'dwebp' to compress and decompress
images respectively.
See https://developers.google.com/speed/webp for details on the image format.
The latest source tree is available at
https://chromium.googlesource.com/webm/libwebp
It is released under the same license as the WebM project. See
https://www.webmproject.org/license/software/ or the "COPYING" file for details.
An additional intellectual property rights grant can be found in the file
PATENTS.
Building
Zig version required is at least <code>0.12.0-dev.1808+69195d0cd</code>. Build process for native target is just
<code>console
zig build -Doptimize=ReleaseSmall</code>
Consider specifying generic target for maximum compatibility, for example:
<code>console
zig build -Dtarget=x86_64-linux</code>
Pass option <code>zig-decoder</code> in order to use Zig port. If decoder is the only thing you'll need, you can use <code>only-decoder</code> option to deal only with Zig:
<code>console
zig build -Dzig-decoder -Donly-decoder</code>
Also see the general <a>building documentation</a>.
Encoding and Decoding Tools
The examples/ directory contains tools to encode and decode images and
animations, view information about WebP images, and more. See the
<a>tools documentation</a>.
APIs
See the <a>APIs documentation</a>, and API usage examples in the
<code>examples/</code> directory.
Bugs
Please report all bugs to the issue tracker: https://bugs.chromium.org/p/webp
Patches welcome! See <a>how to contribute</a>.
Discuss
Email: webp-discuss@webmproject.org
Web: https://groups.google.com/a/webmproject.org/group/webp-discuss | [
"https://github.com/koenigskraut/zig-webp"
] |
https://avatars.githubusercontent.com/u/29507195?v=4 | fizzbuzz | 18alantom/fizzbuzz | 2023-10-08T15:37:54Z | Fizz buzz in Zig (w.i.p). | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/18alantom/fizzbuzz/tags | - | [
"zig"
] | 11 | false | 2023-11-01T17:10:52Z | true | false | unknown | github | [] | Fast Fizz Buzz using Zig
<code>fizzbuzz.zig</code> generates <a>fizz buzz</a>
output. This is piped through <a>pv</a> to
measure data throughput. The output is finally piped to <code>/dev/null</code>.
This code aims to maximize fizz buzz data throughput.
Exec-env
```
OS: macOS 13.5.2 22G91 arm64
Shell: zsh 5.9
Terminal: iTerm2
CPU: Apple M1 Pro
Memory: 32768MiB
```
<strong>Baseline</strong>: <code>/dev/zero pv > /dev/null</code> is 34.6GiB/s
Runs
<em>Note: reasoning is mostly a guess.</em>
<ol>
<li><strong>naive implementation</strong>: <code>9.89MiB/s</code> <a>src</a><ul>
<li><code>0:01:10 for 700 MiB (n: 100_000_000) at 9.89MiB/s</code></li>
</ul>
</li>
<li><strong>use <code>std.c.printf</code></strong>: <code>127MiB/s</code><ul>
<li><code>0:00:58 for 7.33 GiB (n: 1_000_000_000) at 127MiB/s</code> <a>src</a></li>
<li>C std lib <a><code>printf</code></a> directly writes to stdout, <a><code>writer.write</code></a> consists of several comparisons, and might return errors which pulls in <code>builtin.returnError</code>.</li>
</ul>
</li>
<li><strong>use buffered writer, faster custom int formatter</strong>: <code>192MiB/s</code> <a>src</a><ul>
<li><code>0:00:38 for 7.33 GiB (n: 1_000_000_000) at 192MiB/s</code></li>
<li>Consists of 2 improvements:</li>
<li>Used a buffered writer which writes output to a 4MB buffer before flushing it to
stdout using <code>c.printf</code>. The buffer size was based off of <a>this experiment</a> which is probably
still not optimized for whatever lies between printf invocation and stdout receiving
the bytes. But it's still better than calling printf for every line of output.</li>
<li>Used a custom int formatter for digit to string conversion. Using
<code>fmt.bufPrint</code> makes it slower than the previous run probably cause
error handling and call stack.</li>
</ul>
</li>
<li><strong>use <code>c.write</code></strong>: <code>205MiB/s</code><ul>
<li><code>00:00:36 for 7.33 GiB (n: 1_000_000_000) at 205MiB/s</code> <a>src</a></li>
<li>Formatting is not required so <code>c.write</code> to <code>STDOUT</code> can be used directly.
Speed up probably cause no checks for format strings.</li>
</ul>
</li>
<li><strong>use SIMD <code>@Vector</code></strong>: <code>354MiB/s</code><ul>
<li><code>00:00:21 for 7.33GiB (n: 1_000_000_000) at 354MiB/s</code> <a>src</a></li>
<li>Since Fizz Buzz output shape repeats every 15 iterations, vectorization can be used
to calculate the next set of 8 numbers in a single iteration. In using vectorization,
the write function had to be regressed to using <code>c.printf</code> since given
formatting, for now that would be the fastest.</li>
</ul>
</li>
<li>
<strong>use 1MB output buffer</strong>: <code>368MiB/s</code>
<ul>
<li><code>00:00:20 for 7.33GiB (n: 1_000_000_000) at 368MiB/s</code> <a>src</a></li>
<li>Use <code>setvbuf</code> to set stdout to use full buffering (<code>IOFBF</code>) with a 1MB buffer. Without
this, writes to stdout are flushed on new lines by default and full buffering should
lead to fewer writes.</li>
</ul>
</li>
<li>
<strong>??</strong>: <code>??MiB/s</code>
</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | Zig-Intel-Hex | bcrist/Zig-Intel-Hex | 2023-10-28T04:17:10Z | Intel Hex format library in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/bcrist/Zig-Intel-Hex/tags | MIT | [
"encoding",
"ihex",
"intel-hex",
"intelhex",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 5 | false | 2024-06-22T15:29:41Z | true | true | 0.12.0-dev.2063+804cee3b9 | github | [] | Zig-Intel-Hex
Prints binary data into Intel Hex format.
TODO: Parsing | [] |
https://avatars.githubusercontent.com/u/25188?v=4 | tomaat.zig | unorsk/tomaat.zig | 2023-12-20T12:04:18Z | Pomodoro countdown | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/unorsk/tomaat.zig/tags | - | [
"cli",
"pomodoro",
"pomodoro-cli",
"pomodoro-timer",
"zig",
"ziglang"
] | 940 | false | 2025-05-11T10:54:35Z | true | true | 0.14.0 | github | [] | Simple countdown pomodoro timer in Zig
How to build it locally
This will build a binary and put it into your <code>/usr/local/bin</code>
<code>zig build install --prefix-exe-dir /usr/local/bin --verbose</code>
Building wasm
<code>zig build-exe src/main.zig -target wasm32-freestanding -fno-entry -rdynamic -freference-trace -OReleaseSmall -fstrip -femit-bin=www/main.wasm</code> | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | Zig-ConsoleHelper | bcrist/Zig-ConsoleHelper | 2023-06-17T17:55:03Z | Console Helpers for command line applications | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/bcrist/Zig-ConsoleHelper/tags | MIT | [
"console",
"console-color",
"stdio",
"stdout",
"termcolor",
"terminal",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 24 | false | 2025-03-22T07:07:13Z | true | true | 0.14.0 | github | [] | Zig-ConsoleHelper
Console helpers for command line Zig applications
<ul>
<li>Configures Windows stdout/stderr for UTF-8 and enables virtual terminal escape processing</li>
<li>Generates escape sequences to change the current color/style</li>
<li>Prints file context information with optional line numbers and highlighting (e.g. for error messages)</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/122347252?v=4 | LibreSSL-portable | epicyclic-dev/LibreSSL-portable | 2023-08-31T04:50:30Z | LibreSSL-portable with the zig build system | zig-build | 0 | 0 | 1 | 0 | https://api.github.com/repos/epicyclic-dev/LibreSSL-portable/tags | - | [
"libressl",
"openssl",
"zig"
] | 8,191 | false | 2024-09-16T04:18:27Z | true | false | unknown | github | [] | LibreSSL with a Zig build system
This is a somewhat hacky port of the LibreSSL build system to Zig. It builds LibreSSL exclusively as static libraries. It does not (currently) build the LibreSSL command-line executables, like <code>openssl</code>.
Notes:
<ol>
<li>
In order for this to work, <code>.\update.sh</code> must have first been run to bring in the LibreSSL OpenBSD sources. (Or, if you trust me, you may use the <code>zig-3.8.2</code> branch which has the upstream sources committed to the repository, for ease of use with the Zig package manager).
</li>
<li>
I don't know if this causes LibreSSL to be compiled in a way that Compromises Its Cryptographic Integrity. Hopefully it is not even possible to do such a thing in the first place. But I am not an expert, and I ain't looking to port the tests.
</li>
<li>
This does not (currently) compile the assembly routines, only the C versions, which may cause reduced performance on some platforms.
</li>
<li>
Only the "big 3" platforms are supported (namely: macOS, Linux, and Windows). Native and cross-compilation appears to work on modern versions of all three, but this has not been exhaustively tested.
</li>
<li>
Why LibreSSL? It has a CMake-based build system rather than the insane hand-rolled perl mess that OpenSSL does, so it was very straightforward to follow the build process for the purposes of porting it. In theory, its OpenSSL compatibility layer makes it possible to use with a variety of other programs that want to link OpenSSL.
</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/35391378?v=4 | Rock-Paper-Scissors-Arena | GeezerLMAO/Rock-Paper-Scissors-Arena | 2023-06-08T03:51:07Z | A Rock Paper Scissors Tournament Written Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/GeezerLMAO/Rock-Paper-Scissors-Arena/tags | - | [
"game-development",
"simulation",
"sokol",
"zig"
] | 868 | false | 2023-06-08T03:52:54Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/1311673?v=4 | learning_zig | tanangular/learning_zig | 2023-09-17T21:29:56Z | A repository for showcasing my knowledge of the Zig programming language, and continuing to learn the language. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tanangular/learning_zig/tags | - | [
"language",
"learn",
"learning",
"zig",
"zig-language"
] | 28 | false | 2023-11-01T17:24:28Z | false | false | unknown | github | [] | เนเธฃเธตเธขเธเธฃเธนเน เธ เธฒเธฉเธฒ zig
[เธญเนเธฒเธเธญเธดเธ เธเธฒเธ zig learning] (https://ziglang.org/documentation)
เนเธเธดเนเธกเนเธเธดเธก
- https://github.com/gyulanemeth/learn-zig
- https://github.com/craftlinks/zig_learn_opengl
- https://github.com/zigbyexample/zigbyexample.github.io
- https://github.com/bfeldpw/rayworld-ng
- https://github.com/seanpm2001/Learn-Zig
เนเธเนเธเธฒเธเนเธ Jetbrains IntelliJ
1. เธเธดเธเธเธฑเนเธ plugin "Zig Support" (https://plugins.jetbrains.com/plugin/18062-zig-support)
<ul>
<li>Basic language syntax rendering</li>
<li>Comment/Uncomment Zig code</li>
<li>Live templates</li>
<li>Formatting using zig fmt (Ctrl|Cmd + Alt + l)</li>
</ul>
2. เธเธดเธเธเธฑเนเธ plugin "ZigBrains" (https://plugins.jetbrains.com/plugin/22456-zigbrains)
A multifunctional Zig Programming Language plugin for the IDEA platform.
Core features:
Uses ZLS (Zig Language Server) for code assistance, syntax highlighting, and anything to do with coding assistance
Supports build.zig.zon files with autocomplete
Per-project Zig toolchain integration
Debugging support for CLion (builtin), and IDEA Ultimate With this plugin
Gutter icon for running main(), tests, and build
Setting up the language server
If you have zls available on PATH, ZigBrains will automatically discover it. If not, follow this guide:
<ol>
<li>Download or compile the ZLS language server, available at https://github.com/zigtools/zls</li>
<li>Go to Settings -> Languages & Frameworks -> ZLS -> ZLS path -> set the path to the zls executable you downloaded or compiled</li>
<li>Open a .zig file, and wait for the circle in the bottom status bar to turn Green (empty). See below for an explanation on what the circle means.</li>
</ol>
3. Jetbrains File Watcher
| [] |
https://avatars.githubusercontent.com/u/39483951?v=4 | sudoku-solver-zig | FranciscoLlobet/sudoku-solver-zig | 2023-05-29T16:36:37Z | Sudoku Solver in Zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/FranciscoLlobet/sudoku-solver-zig/tags | MIT | [
"sudoku",
"sudoku-solver",
"zig",
"ziglang"
] | 78 | false | 2024-05-20T11:27:53Z | true | false | unknown | github | [] | sudoku-solver-zig
<a></a>
Sudoku Solver in Zig
Simple Sudoku Solver Library based on the algorithm in <a>FranciscoLlobet/sudoku-solver</a>.
This library has been written as a <code>kata</code> to test the basic features of the <a>Zig Programming Language</a>.
<blockquote>
This project, the repository and author(s) are <strong>not</strong> affiliated with the <a>Zig Software Foundation</a>.
</blockquote>
Installation and Dependencies
To build and test the project, you need to have <a>Zig</a> installed. Follow the instructions on the Zig website to install the appropriate version for your system.
API Usage
<blockquote>
Work-in-progress
</blockquote>
```zig
const std = @import("std");
const puzzle = @import("puzzle.zig");
// Example puzzle string
const puzzle_as_string: []const u8 = "..2.3...8.....8....31.2.....6..5.27..1.....5.2.4.6..31....8.6.5.......13..531.4..";
// Provide your memory allocator
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var allocator = gpa.allocator();
// Import puzzle from string
var p = try puzzle.importFromString(puzzle_as_string);
// Solve the puzzle
// Returns error if Sudoku cannot be solved
try p.solve(allocator);
```
Limitations
<ul>
<li>Basic error handling</li>
<li>Basic API</li>
<li>Public Interface may change in the future</li>
</ul>
Building
<code>shell
zig build</code>
Testing
The testing strategy validates the solving algorithm using:
<ul>
<li>Invalid Sudoku puzzles</li>
<li>Valid and solved Sudoku puzzles</li>
<li>Naked singles</li>
<li>Hidden singles</li>
</ul>
Unit Tests
Run the unit tests:
<code>shell
zig build test</code>
Data Tests
Data-based tests will validate the Sudoku solving algorithm. The <a><code>top1465</code></a> data set is considered one of the most comprehensive for testing advanced Sudoku solving algorithms.
<blockquote>
The data sets are currently not included in the repository.
</blockquote>
To get the data set, download it from the link or use <code>curl</code>. The data set should be stored in the <code>data</code> directory.
<code>shell
curl http://magictour.free.fr/top1465 --output ./data/top1465.txt</code>
Run the data tests:
<code>shell
zig build test</code>
Examples
Running the Solver
Here is how you can run the solver on different types of puzzles:
<ol>
<li>Create a new puzzle from a string.</li>
<li>Solve the puzzle.</li>
<li>Handle any errors if the puzzle is unsolvable.</li>
</ol>
```zig
const std = @import("std");
const puzzle = @import("puzzle.zig");
pub fn main() !void {
const puzzle_as_string: []const u8 = "..2.3...8.....8....31.2.....6..5.27..1.....5.2.4.6..31....8.6.5.......13..531.4..";
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var allocator = gpa.allocator();
<code>var p = try puzzle.importFromString(puzzle_as_string);
// Attempt to solve the puzzle
try p.solve(allocator);
// If we reach here, the puzzle has been solved
std.debug.print("Solved puzzle:\n{}\n", .{p});
</code>
}
```
License
See the <a>LICENSE</a> file for more information.
Contact
For any questions or suggestions, feel free to open an issue or contact the author. | [] |
https://avatars.githubusercontent.com/u/614071?v=4 | chip8 | johanlindfors/chip8 | 2023-03-04T10:15:24Z | Implementation of a chip8 interpretator in different programming languages | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/johanlindfors/chip8/tags | - | [
"cplusplus",
"csharp",
"golang",
"rust",
"zig"
] | 197 | false | 2024-05-26T09:45:23Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/49961859?v=4 | mini-database-server-in-zig | paveloom/mini-database-server-in-zig | 2023-04-09T09:39:34Z | Mini database server in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/paveloom/mini-database-server-in-zig/tags | - | [
"database",
"zig"
] | 6 | false | 2023-08-02T20:02:25Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/85673341?v=4 | zcalc | coderloff/zcalc | 2023-10-30T11:24:37Z | A simple calculator built in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/coderloff/zcalc/tags | - | [
"calculator",
"zig"
] | 2 | false | 2024-06-22T14:08:03Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/24943868?v=4 | vosk.zig | jethrodaniel/vosk.zig | 2024-01-02T00:45:57Z | Vosk, built with Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/jethrodaniel/vosk.zig/tags | - | [
"vosk-api",
"zig"
] | 59 | false | 2024-09-05T03:35:55Z | true | true | unknown | github | [
{
"commit": "v0.3.50",
"name": "vosk",
"tar_url": "https://github.com/alphacep/vosk-api/archive/v0.3.50.tar.gz",
"type": "remote",
"url": "https://github.com/alphacep/vosk-api"
},
{
"commit": "fork",
"name": "openfst",
"tar_url": "https://github.com/jethrodaniel/openfst/archive/f... |
vosk.zig
Build <a>vosk-api</a> using <a>zig</a>.
Status
<ul>
<li>MacOS (using <code>linkFramework("Accelerate")</code>)</li>
<li>Linux (using <code>linkSystemLibrary("openblas")</code>)</li>
</ul>
Build
<code>sh
zig build -Doptimize=ReleaseFast -Dtarget=x86_64-native -p vosk/x86_64-macos
zig build -Doptimize=ReleaseFast -Dtarget=aarch64-native -p vosk/aarch64-macos</code>
Result (on MacOS):
<code>sh
% tree vosk
vosk
โโโ aarch64-macos
โย ย โโโ include
โย ย โย ย โโโ vosk_api.h
โย ย โโโ lib
โย ย โโโ libvosk.dylib
โโโ x86_64-macos
โโโ include
โย ย โโโ vosk_api.h
โโโ lib
โโโ libvosk.dylib</code>
Examples
<code>sh
zig build -Doptimize=ReleaseFast example-static
zig build -Doptimize=ReleaseFast example-shared
zig build -Doptimize=ReleaseFast example-zig</code>
Usage
C/C++
<code>sh
zig cc -Ivosk/aarch64-macos/include -Lvosk/aarch64-macos/lib src/example.c -lvosk -Wl,-rpath,vosk/aarch64-macos/lib
./a.out path/to/model path/to/wav</code>
FFI
```sh
git clone -b ruby https://github.com/jethrodaniel/vosk-api
cd vosk-api/ruby
cp -v path/to/libvosk.dylib .
bundle
bundle exec ruby examples/transcribe.rb
```
Zig
See the <code>example-zig</code> step in <code>build.zig</code>.
License
<a>Apache-2.0</a>, same as <a>vosk-api</a>. | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | md4c-zig | fjebaker/md4c-zig | 2023-12-09T20:23:08Z | A fork of md4c with a build.zig. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/fjebaker/md4c-zig/tags | MIT | [
"markdown",
"zig",
"zig-markdown"
] | 1,143 | true | 2025-05-12T21:36:32Z | true | false | unknown | github | [] | MD4C Readme
<ul>
<li>Home: http://github.com/mity/md4c</li>
<li>Wiki: http://github.com/mity/md4c/wiki</li>
<li>Issue tracker: http://github.com/mity/md4c/issues</li>
</ul>
MD4C stands for "Markdown for C" and that's exactly what this project is about.
What is Markdown
In short, Markdown is the markup language this <code>README.md</code> file is written in.
The following resources can explain more if you are unfamiliar with it:
* <a>Wikipedia article</a>
* <a>CommonMark site</a>
What is MD4C
MD4C is Markdown parser implementation in C, with the following features:
<ul>
<li>
<strong>Compliance:</strong> Generally, MD4C aims to be compliant to the latest version of
<a>CommonMark specification</a>. Currently, we are
fully compliant to CommonMark 0.31.
</li>
<li>
<strong>Extensions:</strong> MD4C supports some commonly requested and accepted extensions.
See below.
</li>
<li>
<strong>Performance:</strong> MD4C is <a>very fast</a>.
</li>
<li>
<strong>Compactness:</strong> MD4C parser is implemented in one source file and one header
file. There are no dependencies other than standard C library.
</li>
<li>
<strong>Embedding:</strong> MD4C parser is easy to reuse in other projects, its API is
very straightforward: There is actually just one function, <code>md_parse()</code>.
</li>
<li>
<strong>Push model:</strong> MD4C parses the complete document and calls few callback
functions provided by the application to inform it about a start/end of
every block, a start/end of every span, and with any textual contents.
</li>
<li>
<strong>Portability:</strong> MD4C builds and works on Windows and POSIX-compliant OSes.
(It should be simple to make it run also on most other platforms, at least as
long as the platform provides C standard library, including a heap memory
management.)
</li>
<li>
<strong>Encoding:</strong> MD4C by default expects UTF-8 encoding of the input document.
But it can be compiled to recognize ASCII-only control characters (i.e. to
disable all Unicode-specific code), or (on Windows) to expect UTF-16 (i.e.
what is on Windows commonly called just "Unicode"). See more details below.
</li>
<li>
<strong>Permissive license:</strong> MD4C is available under the <a>MIT license</a>.
</li>
</ul>
Using MD4C
Parsing Markdown
If you need just to parse a Markdown document, you need to include <code>md4c.h</code>
and link against MD4C library (<code>-lmd4c</code>); or alternatively add <code>md4c.[hc]</code>
directly to your code base as the parser is only implemented in the single C
source file.
The main provided function is <code>md_parse()</code>. It takes a text in the Markdown
syntax and a pointer to a structure which provides pointers to several callback
functions.
As <code>md_parse()</code> processes the input, it calls the callbacks (when entering or
leaving any Markdown block or span; and when outputting any textual content of
the document), allowing application to convert it into another format or render
it onto the screen.
Converting to HTML
If you need to convert Markdown to HTML, include <code>md4c-html.h</code> and link against
MD4C-HTML library (<code>-lmd4c-html</code>); or alternatively add the sources <code>md4c.[hc]</code>,
<code>md4c-html.[hc]</code> and <code>entity.[hc]</code> into your code base.
To convert a Markdown input, call <code>md_html()</code> function. It takes the Markdown
input and calls the provided callback function. The callback is fed with
chunks of the HTML output. Typical callback implementation just appends the
chunks into a buffer or writes them to a file.
Markdown Extensions
The default behavior is to recognize only Markdown syntax defined by the
<a>CommonMark specification</a>.
However, with appropriate flags, the behavior can be tuned to enable some
extensions:
<ul>
<li>
With the flag <code>MD_FLAG_COLLAPSEWHITESPACE</code>, a non-trivial whitespace is
collapsed into a single space.
</li>
<li>
With the flag <code>MD_FLAG_TABLES</code>, GitHub-style tables are supported.
</li>
<li>
With the flag <code>MD_FLAG_TASKLISTS</code>, GitHub-style task lists are supported.
</li>
<li>
With the flag <code>MD_FLAG_STRIKETHROUGH</code>, strike-through spans are enabled
(text enclosed in tilde marks, e.g. <code>~foo bar~</code>).
</li>
<li>
With the flag <code>MD_FLAG_PERMISSIVEURLAUTOLINKS</code> permissive URL autolinks
(not enclosed in <code><</code> and <code>></code>) are supported.
</li>
<li>
With the flag <code>MD_FLAG_PERMISSIVEEMAILAUTOLINKS</code>, permissive e-mail
autolinks (not enclosed in <code><</code> and <code>></code>) are supported.
</li>
<li>
With the flag <code>MD_FLAG_PERMISSIVEWWWAUTOLINKS</code> permissive WWW autolinks
without any scheme specified (e.g. <code>www.example.com</code>) are supported. MD4C
then assumes <code>http:</code> scheme.
</li>
<li>
With the flag <code>MD_FLAG_LATEXMATHSPANS</code> LaTeX math spans (<code>$...$</code>) and
LaTeX display math spans (<code>$$...$$</code>) are supported. (Note though that the
HTML renderer outputs them verbatim in a custom tag <code><x-equation></code>.)
</li>
<li>
With the flag <code>MD_FLAG_WIKILINKS</code>, wiki-style links (<code>[[link label]]</code> and
<code>[[target article|link label]]</code>) are supported. (Note that the HTML renderer
outputs them in a custom tag <code><x-wikilink></code>.)
</li>
<li>
With the flag <code>MD_FLAG_UNDERLINE</code>, underscore (<code>_</code>) denotes an underline
instead of an ordinary emphasis or strong emphasis.
</li>
</ul>
Few features of CommonMark (those some people see as mis-features) may be
disabled with the following flags:
<ul>
<li>
With the flag <code>MD_FLAG_NOHTMLSPANS</code> or <code>MD_FLAG_NOHTMLBLOCKS</code>, raw inline
HTML or raw HTML blocks respectively are disabled.
</li>
<li>
With the flag <code>MD_FLAG_NOINDENTEDCODEBLOCKS</code>, indented code blocks are
disabled.
</li>
</ul>
Input/Output Encoding
The CommonMark specification declares that any sequence of Unicode code points
is a valid CommonMark document.
But, under a closer inspection, Unicode plays any role in few very specific
situations when parsing Markdown documents:
<ol>
<li>
For detection of word boundaries when processing emphasis and strong
emphasis, some classification of Unicode characters (whether it is
a whitespace or a punctuation) is needed.
</li>
<li>
For (case-insensitive) matching of a link reference label with the
corresponding link reference definition, Unicode case folding is used.
</li>
<li>
For translating HTML entities (e.g. <code>&amp;</code>) and numeric character
references (e.g. <code>&#35;</code> or <code>&#xcab;</code>) into their Unicode equivalents.
</li>
</ol>
However note MD4C leaves this translation on the renderer/application; as
the renderer is supposed to really know output encoding and whether it
really needs to perform this kind of translation. (For example, when the
renderer outputs HTML, it may leave the entities untranslated and defer the
work to a web browser.)
MD4C relies on this property of the CommonMark and the implementation is, to
a large degree, encoding-agnostic. Most of MD4C code only assumes that the
encoding of your choice is compatible with ASCII. I.e. that the codepoints
below 128 have the same numeric values as ASCII.
Any input MD4C does not understand is simply seen as part of the document text
and sent to the renderer's callback functions unchanged.
The two situations (word boundary detection and link reference matching) where
MD4C has to understand Unicode are handled as specified by the following
preprocessor macros (as specified at the time MD4C is being built):
<ul>
<li>If preprocessor macro <code>MD4C_USE_UTF8</code> is defined, MD4C assumes UTF-8 for the
word boundary detection and for the case-insensitive matching of link labels.</li>
</ul>
When none of these macros is explicitly used, this is the default behavior.
<ul>
<li>On Windows, if preprocessor macro <code>MD4C_USE_UTF16</code> is defined, MD4C uses
<code>WCHAR</code> instead of <code>char</code> and assumes UTF-16 encoding in those situations.
(UTF-16 is what Windows developers usually call just "Unicode" and what
Win32API generally works with.)</li>
</ul>
Note that because this macro affects also the types in <code>md4c.h</code>, you have
to define the macro both when building MD4C as well as when including
<code>md4c.h</code>.
Also note this is only supported in the parser (<code>md4c.[hc]</code>). The HTML
renderer does not support this and you will have to write your own custom
renderer to use this feature.
<ul>
<li>If preprocessor macro <code>MD4C_USE_ASCII</code> is defined, MD4C assumes nothing but
an ASCII input.</li>
</ul>
That effectively means that non-ASCII whitespace or punctuation characters
won't be recognized as such and that link reference matching will work in
a case-insensitive way only for ASCII letters (<code>[a-zA-Z]</code>).
Documentation
The API of the parser is quite well documented in the comments in the <code>md4c.h</code>.
Similarly, the markdown-to-html API is described in its header <code>md4c-html.h</code>.
There is also <a>project wiki</a> which provides
some more comprehensive documentation. However note it is incomplete and some
details may be somewhat outdated.
FAQ
<strong>Q: How does MD4C compare to other Markdown parsers?</strong>
<strong>A:</strong> Some other implementations combine Markdown parser and HTML generator
into a single entangled code hidden behind an interface which just allows the
conversion from Markdown to HTML. They are often unusable if you want to
process the input in any other way.
Second, most parsers (if not all of them; at least within the scope of C/C++
language) are full DOM-like parsers: They construct abstract syntax tree (AST)
representation of the whole Markdown document. That takes time and it leads to
bigger memory footprint.
Building AST is completely fine as long as you need it. If you don't, there is
a very high chance that using MD4C will be substantially faster and less hungry
in terms of memory consumption.
Last but not least, some Markdown parsers are implemented in a naive way. When
fed with a <a>smartly crafted input pattern</a>, they
may exhibit quadratic (or even worse) parsing times. What MD4C can still parse
in a fraction of second may turn into long minutes or possibly hours with them.
Hence, when such a naive parser is used to process an input from an untrusted
source, the possibility of denial-of-service attacks becomes a real danger.
A lot of our effort went into providing linear parsing times no matter what
kind of crazy input MD4C parser is fed with. (If you encounter an input pattern
which leads to a sub-linear parsing times, please do not hesitate and report it
as a bug.)
<strong>Q: Does MD4C perform any input validation?</strong>
<strong>A:</strong> No. And we are proud of it. :-)
CommonMark specification states that any sequence of Unicode characters is
a valid Markdown document. (In practice, this more or less always means UTF-8
encoding.)
In other words, according to the specification, it does not matter whether some
Markdown syntax construction is in some way broken or not. If it's broken, it
won't be recognized and the parser should see it just as a verbatim text.
MD4C takes this a step further: It sees any sequence of bytes as a valid input,
following completely the GIGO philosophy (garbage in, garbage out). I.e. any
ill-formed UTF-8 byte sequence will propagate to the respective callback as
a part of the text.
If you need to validate that the input is, say, a well-formed UTF-8 document,
you have to do it on your own. The easiest way how to do this is to simply
validate the whole document before passing it to the MD4C parser.
License
MD4C is covered with MIT license, see the file <code>LICENSE.md</code>.
Links to Related Projects
Ports and bindings to other languages:
<ul>
<li>
<a>commonmark-d</a>:
Port of MD4C to D language.
</li>
<li>
<a>markdown-wasm</a>:
Port of MD4C to WebAssembly.
</li>
<li>
<a>PyMD4C</a>:
Python bindings for MD4C
</li>
</ul>
Software using MD4C:
<ul>
<li>
<a>imgui_md</a>:
Markdown renderer for <a>Dear ImGui</a>
</li>
<li>
<a>MarkDown Monolith Assembler</a>:
A command line tool for building browser-based books.
</li>
<li>
<a>QOwnNotes</a>:
A plain-text file notepad and todo-list manager with markdown support and
ownCloud / Nextcloud integration.
</li>
<li>
<a>Qt</a>:
Cross-platform C++ GUI framework.
</li>
<li>
<a>Textosaurus</a>:
Cross-platform text editor based on Qt and Scintilla.
</li>
<li>
<a>8th</a>:
Cross-platform concatenative programming language.
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/107077959?v=4 | learnzigopengl | jmillana/learnzigopengl | 2023-11-06T17:40:30Z | A port of https://learnopengl.com written in zig, with zig-opengl and mach-glfw | main | 0 | 0 | 1 | 0 | https://api.github.com/repos/jmillana/learnzigopengl/tags | Apache-2.0 | [
"computer-graphics",
"mach-glfw",
"opengl",
"tutorial",
"zig",
"zig-opengl"
] | 410 | false | 2023-11-06T19:42:24Z | true | true | unknown | github | [
{
"commit": null,
"name": "mach_glfw",
"tar_url": null,
"type": "remote",
"url": "https://pkg.machengine.org/mach-glfw/20d247fa4b70c0b3951cb3c439d3466f204754e1.tar.gz"
}
] | LearnZigOpenGL
This repository provides a comprehensive guide for porting the <a>LearnOpenGL</a> tutorials to <a>Zig</a>, using <a>zig-opengl</a> and <a>mach-glfw</a>.
Objective
The primary aim of this project is to create a foundational resource for OpenGL development in the Zig programming language. Navigating the existing materials for setting up and running OpenGL projects in Zig can be daunting, which motivated me to start this learning journey.
I hope that this repository will assist some of you in the future by providing a clear and detailed pathway to getting started on OpenGL with Zig.
Getting Started
To ensure a smooth start with the tutorials, we must first establish our development environment by installing the necessary dependencies.
Prerequisites
Zig
You should have Zig installed on your system. If not, follow the instructions here: <a>Installing Zig</a>.
.NET
.NET is required for building the Zig bindings for OpenGL.
Download and install .NET from <a>Microsoft's .NET Download Page</a>.
On Linux:
<code>bash
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --version latest</code>
Obtain the OpenGL Bindings
The <a>zig-opengl</a> repository offers a method to generate Zig bindings for OpenGL. Customize the <code>GL_VERSION_X_Y</code> to correspond with the desired version. See the <a>zig-opengl README</a> for all available versions.
<code>bash
git clone --recursive https://github.com/MasterQ32/zig-opengl.git
cd zig-opengl
dotnet run OpenGL-Registry/xml/gl.xml gl4v6.zig GL_VERSION_4_6</code>
Clone This Tutorial Repository
<code>bash
git clone https://github.com/jmillana/learnzigopengl.git</code>
Then, transfer the generated OpenGL bindings into the libs/ directory of this tutorial's repository.
If you opted for a different OpenGL version, you will need to update the build.zig file accordingly:
```zig
const std = @import("std");
const print = std.debug.print;
const OPENGL_BINDINGS_PATH = "libs/gl4v6.zig";
pub fn build(b: *std.Build) void {
...
```
Tutorials
Each tutorial is encapsulated in its own directory located at src/tutorial_. You'll find a dedicated README within each tutorial's folder to guide you through its specifics.
Running the Tutorials
To run a specific tutorial, use the command below, replacing with the number corresponding to the tutorial you wish to execute.
<code>zig build run -Dn=<tutorial_number></code>
To see a list of all available tutorials and instructions on how to run them, simply execute zig build without additional parameters. You will receive an output that provides usage details and lists the currently implemented tutorials:
```
zig build
<blockquote>
Usage:
zig build run -Dn=
Available tutorials: 1 - 2
```
</blockquote>
List of Tutorials
<ul>
<li>Tutorial 1: Setting up a Window</li>
<li>Tutorial 2: Rendering a Triangle</li>
</ul>
Contributions
This project is made entirely for fun as a way to get starged into computer grafics while deepend the knowledge about zig (at the time of writing this I'm preatty much a noob in both fields).
Whether you wish to enhance the documentation or add more tutorials, please feel free to fork this repository and open a PR. | [] |
https://avatars.githubusercontent.com/u/21150830?v=4 | underglow2 | ConnorRigby/underglow2 | 2023-02-28T21:50:24Z | Automotive PMU designed for controlling external lighting. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ConnorRigby/underglow2/tags | NOASSERTION | [
"can",
"kicad",
"lighting-controller",
"pcb",
"pcb-design",
"radio",
"stm32",
"zig"
] | 111,719 | false | 2023-03-24T13:27:45Z | false | false | unknown | github | [] | Underglow 2
Automotive PMU designed for controlling external lighting.
Specs
|high side output|low side output|12v digital input|BLE|Radio|
|-|-|-|-|-|
|2|6|4|1|1|
Repository Structure
|folder|description|
|-|-|
|<a>docs</a>|Documentation for hardware as well as 3d models and interactive bill of materials|
|<a>hardware</a>|Source material for the hardware PCB design| | [] |
https://avatars.githubusercontent.com/u/99132213?v=4 | zig-argtic | DISTREAT/zig-argtic | 2023-07-24T20:03:43Z | Zig argument parser | master | 2 | 0 | 1 | 0 | https://api.github.com/repos/DISTREAT/zig-argtic/tags | LGPL-3.0 | [
"argument-parser",
"cli",
"command-line-arguments-parser",
"option-parser",
"zig",
"zig-lib",
"zig-library",
"zig-package"
] | 11,944 | false | 2024-04-24T19:02:17Z | true | false | unknown | github | [] | zig-argtic
A library for parsing command-line options, arguments, and sub-commands.
<em>Build using zig version: <code>0.12.0</code></em>
How does it compare to the POSIX and GNU conventions?
<ul>
<li>An option requires a long name (GNU compatible; eg. <code>--long-option</code>)</li>
<li>An option may have a single char name and start with one hyphen (similar to POSIX)</li>
<li>An option may have a value (GNU compliant)</li>
<li>...directly following as the next index inside the argument vector (eg. <code>-o file.txt</code>)</li>
<li>but may not follow directly after the option name (incompatible GNU/incompatible POSIX; eg. <code>-ofile.txt</code>)</li>
<li>Options may be grouped in any order (POSIX compliant; eg. <code>-o -v</code> -> <code>-ov</code>)</li>
<li>Options may appear multiple times (POSIX)</li>
<li>Options precede required arguments (POSIX)</li>
<li>Options may be supplied in any order (GNU)</li>
<li>Options may be separated into option name and value through the use of an equal sign (GNU complicant; eg. <code>--name=value</code>)</li>
</ul>
<a>Source: POSIX Conventions</a>
<a>Source: GNU Conventions/Additions</a>
Example
```zig
// simple example - reduced to a minimum
const specification = argtic.ArgumentSpecification{
.name = "exe",
.positionals = &[_]argtic.Positional{
.{ .name = "value" },
},
};
const argument_vector = try std.process.argsAlloc(allocator);
defer std.process.argsFree(allocator, argument_vector);
const arguments = try argtic.ArgumentProcessor.parse(allocator, specification, argument_vector[1..]);
defer arguments.deinit();
std.log.info("{s}", .{arguments.getArgument("value").?});
```
For more thorough examples, visit <code>examples/</code> and <code>src/tests.zig</code>.
<a>Required Arguments</a>
<a>Optional Arguments</a>
<a>Optional Positionals</a>
<a>Subcommands</a>
Documentation
The documentation is created in the directory <code>docs/</code> when running <code>zig build</code>.
<a>Documentation</a>
Appendix
This project was likely one of the most challenging projects I have written, especially because I struggle with parsers in general. Nonetheless, I did realize this project in the end and am more or less content, although not happy.
There is a lot of missing work, but I assume it's usable to the point where I could use it in future projects. To put it in perspective, this is probably already the 10th iteration I have written, and I finally got a decent structure down that I assume to be scalable and maintainable.
Anyway, don't underestimate the project of writing a CLI argument parser that supports subcommands, flags (with multiple value syntax), compound flags, and positional arguments. This project tested my limits again and agian and even made me consider using a PEG or regular expression parser - also - it's not like I started programming yesterday. Notably, the API took me some time to figure out, which is funny considering it's simplicity.
Every single stage of this project tested me and my idealistic bed-of-rose-loving ass. Considering all I've just said, I'd recommend writing an argument parser once in your life - it just makes you feel cured of all previous projects (or sad about your life choices) - because I hated it, especially in the final half-assed stages.
Now that I succeeded (more or less), you may consider this my magnum opus of yak shaving. | [] |
https://avatars.githubusercontent.com/u/6391776?v=4 | zig | nikitavoloboev/zig | 2023-08-08T22:50:14Z | Zig tools, libraries and other code | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/nikitavoloboev/zig/tags | - | [
"zig"
] | 6 | false | 2025-03-16T18:10:45Z | true | true | unknown | github | [] | Run
<code>zig run main.zig</code>
Other
More zig exploration <a>here</a>.
<a></a> <a></a> <a></a> | [] |
https://avatars.githubusercontent.com/u/1825111?v=4 | zig-graphics-experiments | JamWils/zig-graphics-experiments | 2024-02-05T15:12:27Z | A playground for testing out low-level graphics APIs in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/JamWils/zig-graphics-experiments/tags | MIT | [
"3d-graphics",
"vulkan",
"zig"
] | 65,360 | false | 2024-02-21T23:14:27Z | true | true | unknown | github | [
{
"commit": null,
"name": "core",
"tar_url": null,
"type": "relative",
"url": "libs/core"
},
{
"commit": null,
"name": "flecs",
"tar_url": null,
"type": "relative",
"url": "libs/flecs"
},
{
"commit": null,
"name": "imgui",
"tar_url": null,
"type": "rel... | Graphics Experiments
I was curious about using Zig and seeing what the language had to offer. I have also been diving into 3D graphics development and wanted to work with Vulkan on more intermediate to advanced topics.
This has only been tested on Windows 11 using Zig 0.11.0
To run the app just use <code>zig build run</code>, make sure to set the environment variable <code>VK_SDK_PATH</code> for the Vulkan SDK path on your system.
I might extend this to support <a>Metal</a> in the future as well. | [] |
https://avatars.githubusercontent.com/u/142168653?v=4 | .github | zig-lang-ua/.github | 2023-08-13T16:17:54Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/zig-lang-ua/.github/tags | - | [
"zig",
"ziglang"
] | 10 | false | 2023-08-27T19:20:25Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/77886027?v=4 | sandbox | patrickm663/sandbox | 2023-03-26T19:44:53Z | A place to hold simple projects as I explore a language. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/patrickm663/sandbox/tags | BSD-3-Clause | [
"dlang",
"fennel",
"lua",
"nim",
"rust",
"zig"
] | 22,463 | false | 2023-11-01T17:11:12Z | false | false | unknown | github | [] | <a></a>
Sandbox
This repo serves as a testing ground for various languages. I really enjoy learning new languages and different approaches to solving problems.
The programmes here are written for fun and to track progress as I pick up new languages and see what sticks. Some of these may break, some are repeated, and some may grow to form bigger projects eventually -- but mostly they're written to get to grips with syntax.
Languages
This started as a place to hold Lua code but has since expanded to Fennel, D, Zig, and more on the horizon. Nim is the latest language I'm looking at. It looks interesting so far! It feels like a better Python with optional static typing. | [] |
https://avatars.githubusercontent.com/u/3594035?v=4 | zig-life-expirements | tsunaminoai/zig-life-expirements | 2023-09-16T12:52:48Z | Life simulation with raylib-zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tsunaminoai/zig-life-expirements/tags | - | [
"life",
"particles",
"raylib",
"simulation",
"zig"
] | 643 | false | 2023-11-01T17:25:12Z | true | true | unknown | github | [
{
"commit": "6094869e3e845e90e1e8ae41b98e889fb3e13e78.tar.gz",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/6094869e3e845e90e1e8ae41b98e889fb3e13e78.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
}
] | Zig "Life" Expriements
Inspired by and adapted from <a>Create Artificial Life From Simple Rules - Particle Life</a> from <a>@brainxyz</a>
Build
<code>bash
git submodule update --init --recursive
zig build run</code> | [] |
https://avatars.githubusercontent.com/u/23489037?v=4 | zmq-z | lacc97/zmq-z | 2023-12-21T22:57:39Z | null | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/lacc97/zmq-z/tags | MPL-2.0 | [
"zeromq",
"zig",
"ziglang",
"zmq"
] | 50 | false | 2023-12-21T23:05:10Z | true | true | unknown | github | [
{
"commit": "master",
"name": "zeromq",
"tar_url": "https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/zeromq/libzmq/releases/download/v4.3.5/zeromq-4.3.5.tar.gz"
}
] | 404 | [] |
https://avatars.githubusercontent.com/u/76999048?v=4 | zig | bellshade/zig | 2023-11-28T03:47:21Z | Repositori untuk belajar Zig dalam bahasa Indonesia | main | 1 | 0 | 3 | 0 | https://api.github.com/repos/bellshade/zig/tags | MIT | [
"bellshade",
"hacktoberfest",
"indonesia",
"zig"
] | 47 | false | 2023-11-30T10:18:56Z | true | false | unknown | github | [] |
Part of Bellshade Project, managed by <a> WPU Discord Community</a> and <a> Kelas terbuka Discord Community</a>
Repositori ini berisi kumpulan berbagai macam <em>source code</em> struktur data, algorithm, analisis matematika, serta tutorial yang diimplementasikan dengan menggunakan bahasa pemograman Zig
Baru Belajar? Mulai dari <a>sini</a> ๐
Untuk menggunakan repositori dengan maksimal, kalian perlu belajar programming dasar dahulu. Silahkan ikuti alur belajar berikut untuk mempelajari dasar - dasar pemograman langsung menggunakan Zig
| Langkah | Topik | Target Pembelajaran | Materi Rujukan |
| :-----: | :---------------------------: | :-------------------------------------------------------------------------------: | :---------------------------------------------: |
| 01 | Introduksi Pemograman dan Zig | Memahami apa itu membuat program dan apa peran Zig dalam proses pembuatan program | <a>Materi</a> |
| 02 | Tipe data | Memahami apa itu tipe data | <a>Materi</a> |
| 03 | Var & Const | Memahami apa itu var dan const | <a>Materi</a> |
| 04 | Latihan | Latihan dari materi sebelumnya | <a>Materi</a> |
| 05 | Format Panggilan Variabel | Memahami cara memanggil variabel | <a>Materi</a> |
| 06 | Operator | Memahami Operator yang terdapat pada zig | <a>Materi</a> |
| 07 | Logika | Memahami cara kerja logika pada zig | <a>Materi</a> |
๐คฉ Ayo ikut kami dan berkontribusi! ๐คฉ
Bantuan kalian diperlukan Agar Bellshade dapat lebih jauh lagi membantu anak-anak Indonesia belajar <em>programming</em>, kita butuh tenaga kalian!
<blockquote>
"Dengan Bellshade, aku jadi bisa <em>ngoding</em>! Terima kasih Bellshade!"
</blockquote>
Kami sangat senang bila kalian ingin melakukan kontribusi pada repositori <strong>Zig</strong> ini. Tapi, sebelum itu, silahkan baca terlebih dahulu <a>peraturan dan pedomannya</a> yang telah kami siapkan. Terima kasih!
Untuk informasi lebih lanjut, mari gabung dalam komunitas <a>Discord Channel WPU</a> dan <a>Discord Channel Kelas Terbuka</a> | [] |
https://avatars.githubusercontent.com/u/106715298?v=4 | simple-raytracer | imalexlee/simple-raytracer | 2024-01-08T23:25:30Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/imalexlee/simple-raytracer/tags | - | [
"graphics",
"raytracing",
"zig"
] | 5,940 | false | 2024-06-16T21:51:19Z | true | true | unknown | github | [] | Simple Raytracer built with Zig!
| [] |
https://avatars.githubusercontent.com/u/14164311?v=4 | AdventOfCode | cactusbento/AdventOfCode | 2023-12-01T23:31:44Z | Holds my code for Advent of Code | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/cactusbento/AdventOfCode/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"zig"
] | 25 | false | 2023-12-01T23:33:22Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/50797868?v=4 | zsimd | maolonglong/zsimd | 2023-11-12T10:25:23Z | Some functions optimized with simd | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/maolonglong/zsimd/tags | MIT | [
"simd",
"zig"
] | 8 | false | 2024-12-11T08:36:48Z | true | false | unknown | github | [] | zsimd
```plaintext
Benchmark Iterations Min(ns) Max(ns) Variance Mean(ns)
std_indexOfScalar(block=128) 10000 166 417 952 243
std_indexOfScalar(block=256) 10000 333 9542 13486 418
std_indexOfScalar(block=512) 10000 708 5500 3253 824
std_indexOfScalar(block=1024) 10000 1375 17042 41232 1619
std_indexOfScalar(block=4096) 10000 3875 21833 335049 4634
simd_indexOfScalar(block=128) 10000 0 83 99 2
simd_indexOfScalar(block=256) 10000 0 208 437 49
simd_indexOfScalar(block=512) 10000 0 208 442 59
simd_indexOfScalar(block=1024) 10000 41 250 453 105
simd_indexOfScalar(block=4096) 10000 208 500 750 308
std_lastIndexOfScalar(block=128) 10000 83 7459 6004 142
std_lastIndexOfScalar(block=256) 10000 208 1417 917 270
std_lastIndexOfScalar(block=512) 10000 458 15083 22112 524
std_lastIndexOfScalar(block=1024) 10000 875 6667 7350 991
std_lastIndexOfScalar(block=4096) 10000 3791 16458 79846 3879
simd_lastIndexOfScalar(block=128) 10000 0 7417 5641 4
simd_lastIndexOfScalar(block=256) 10000 0 417 429 49
simd_lastIndexOfScalar(block=512) 10000 0 416 523 59
simd_lastIndexOfScalar(block=1024) 10000 41 250 497 102
simd_lastIndexOfScalar(block=4096) 10000 250 625 781 313
Benchmark Iterations Min(ns) Max(ns) Variance Mean(ns)
std_eql(block=128) 10000 125 667 879 224
std_eql(block=256) 10000 333 5500 3672 432
std_eql(block=512) 10000 750 10042 21258 827
std_eql(block=1024) 10000 1500 29333 248342 1659
std_eql(block=4096) 10000 6333 26250 321814 6553
zsimd_eql(block=128) 10000 0 1375 519 44
zsimd_eql(block=256) 10000 0 208 438 59
zsimd_eql(block=512) 10000 41 375 471 104
zsimd_eql(block=1024) 10000 84 11709 18440 187
zsimd_eql(block=4096) 10000 583 7625 11451 642
``` | [] |
https://avatars.githubusercontent.com/u/5885545?v=4 | AdventOfCode-2023 | JacobCrabill/AdventOfCode-2023 | 2023-11-24T18:12:38Z | Advent Of Code 2023 Solutions | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/JacobCrabill/AdventOfCode-2023/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"zig"
] | 139 | false | 2024-11-28T18:55:09Z | false | false | unknown | github | [] | Advent Of Code 2023
Advent Of Code 2023 Solutions in Zig (version 0.11.0)
Basic Usage
The <code>template</code> folder contains, obviously, the template for a single day's problems. The
<code>create_day</code> script will conveniently copy-paste the template to a new day for you, including
changing the output binary name to match the day.
For example: <code>create_day 5</code> creates a folder named <code>5</code> which contains a Zig project setup to build a
<code>day5</code> binary.
Using the templates
Each day is a standalone Zig project, containing a <code>build.zig</code> file, a <code>main.zig</code> file, and <code>.txt</code>
files for the problem input. The <code>test.txt</code> file is intended for the sample input, while the
<code>input.txt</code> file is intended for your unique input.
Within <code>main.zig</code> there are placeholder functions for <code>part1</code> and <code>part2</code>, and a <code>main()</code> which runs
both parts (and helpfully times them for you). There are also two tests, one for each part; you can
use these to check your solution against the sample input and solution given in the problem
statements. Just change the line <code>const answer: usize = 0;</code> to the expected answer.
The template also creates a <code>utils</code> module from the <code>common</code> folder in the root; this can be used to
store generically useful algorithms and data structures to speed up your problem solving. The
template <code>main.zig</code> file imports this module as <code>utils</code>.
Build & Run
<code>sh
./create_day 5
cd 5
zig build test # Build and run the tests
zig build run # Build and run main()</code>
Sample output for unit tests:
<code>sh
AdventOfCode2023/5$ zig build test --summary all
run test: error: [aoc] (warn): -- Running Tests --
[aoc] (warn): [Test] Part 1: 0
[aoc] (warn): [Test] Part 2: 0
Build Summary: 3/3 steps succeeded; 2/2 tests passed
test success
โโ run test 2 passed 829us MaxRSS:1M
โโ zig test Debug native cached 5ms MaxRSS:36M</code>
Sample output for for the full input:
<code>sh
AdventOfCode2023/5$ zig build run
info(aoc): Part 1 answer: << 0 >>
info(aoc): Part 1 took 0.000010s
info(aoc): Part 2 answer: << 0 >>
info(aoc): Part 2 took 0.000004s</code> | [] |
https://avatars.githubusercontent.com/u/43040593?v=4 | zig-sqlite-dynamic-ext | dantecatalfamo/zig-sqlite-dynamic-ext | 2023-02-18T06:38:08Z | Test sqlite dynamically loadable extension written in zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/dantecatalfamo/zig-sqlite-dynamic-ext/tags | - | [
"sqlite",
"zig"
] | 1 | false | 2023-02-18T06:39:33Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/82161241?v=4 | canidoom | Kerplunkx/canidoom | 2023-05-20T21:15:31Z | Can I doom? | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Kerplunkx/canidoom/tags | - | [
"doom",
"raycasting",
"sdl",
"sdl2",
"zig",
"ziglang"
] | 10 | false | 2023-11-01T17:12:05Z | true | false | unknown | github | [] | Can I DOOM?
Not yet
Final Product?
Coming soon...
Current Status
Resources
<ul>
<li>https://github.com/vinibiavatti1/RayCastingTutorial</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/135217?v=4 | monkey_islang | gthvn1/monkey_islang | 2023-12-14T08:42:45Z | ๐๏ธ Ahoy and welcome, dear voyager, to the shores of Monkey Islang! | master | 1 | 0 | 0 | 0 | https://api.github.com/repos/gthvn1/monkey_islang/tags | MIT | [
"interpreter",
"kernel",
"ocaml",
"zig"
] | 18 | false | 2023-12-23T10:18:16Z | false | false | unknown | github | [] | Monkey Islang
Ahoy and welcome, dear voyager, to the shores of Monkey Islang! A curious haven nestled amidst the vast expanse of the digital ocean. Islang, reminiscent of the tales spun around the mystical Island, hosts within its embrace two grand endeavors tethered to the legendary <a>MonkeyLang</a>.
These pursuits unfold as an ersatz of a kernel, akin to the core of an enigmatic engine, and an interpreterโan ethereal conduit to the realms of syntax and semantics.
Verily, it is an expedition of pure exploration, where the only aspiration is the ceaseless unraveling of these twin universes.
For this wondrous odyssey, we embark with three delightful vehicles, chariots of innovation: <a>Ocaml</a>, <a>Rust</a>, <a>Zig</a>... each bearing its own flair and enchantment. With these, we shall chart our course through the uncharted.
Ah, the mysteries that await, the uncharted territories we shall traverse! Join us, dear reader, as we unravel the unknown and set sail toward the unexplored horizons of possibility... | [] |
https://avatars.githubusercontent.com/u/24524492?v=4 | zig-project | laqudee/zig-project | 2023-06-20T07:40:15Z | Zig Language Note and Action | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/laqudee/zig-project/tags | - | [
"learn-to-code",
"zig",
"ziglang"
] | 11,569 | false | 2023-11-01T17:11:17Z | false | false | unknown | github | [] | zig-project
<blockquote>
note
example
simple init-exe demo
</blockquote>
<ul>
<li>ๆฒกๆ้ๅผๆงๅถๆต๏ผๆฒกๆ้ๅผๅ
ๅญๅ้
๏ผๆฒกๆ้ขๅค็ๅจ๏ผๆฒกๆๅฎ</li>
<li>
ๅฆๆ zig ไปฃ็ ็่ตทๆฅไธๅๅจ่ฐ็จไธไธชๅฝๆฐ๏ผ้ฃไนๅฎๅฐฑไธๆฏ
</li>
<li>
Zig ๅฐๆๆ็ๆงๅถๆตๅฎๅ
จ็จ่ฏญ่จๅ
ณ้ฎๅญๅๅฝๆฐ่ฐ็จๆฅ่กจ่พพ
</li>
<li>
ๅ็งๆๅปบๆจกๅผ๏ผ
</li>
<li>
debug
</li>
<li>release safe</li>
<li>release fast</li>
<li>
release small
</li>
<li>
ๅ ๆ ่ท่ธช
</li>
<li>
่ฃธ้ๅฑ ๏ผ
</li>
<li>
ๅฏ็จๅฎๅ
จๆฃๆฅ็ๆๅปบๆจกๅผ
</li>
<li>
ๅฐๆชๅฎไนไฝไธบไธไธชๅฉๅจ๏ผๆขๅฏไปฅ้ข้ฒ bug๏ผๅๅฏไปฅๆๅๆง่ฝ
</li>
<li>
ๅ่ๅฎ็ฐไฝฟ็จ LLVM ไฝไธบๅ็ซฏ่ฟ่กๆๅ
่ฟ็ไผๅ
</li>
<li>้พๆฅๆถไผๅๅจ zig ไธญ่ชๅจ่พพๆ</li>
<li>ๅฏนไบคๅ็ผ่ฏ็ไธๆตๆฏๆ๏ผๅฏนไบๅ็ๆๅปบ็ฎๆ ใ้ซ็บง CPU ็นๆงๅฏไปฅ่ขซๅฏ็จ</li>
<li>ๆชๅฎไน่กไธบ</li>
<li>
Zig ็ดๆฅๆด้ฒไบ SIMD ๅ้็ฑปๅ๏ผ็ผๅ่ทจๅนณๅฐ็ๅ้ๅไปฃ็ ๆดๅฎนๆ
</li>
<li>
้กบๅบๆ ๅ
ณ็้กถๅฑๅฃฐๆ
</li>
<li>
ๅ
จๅฑๅ้็ญ้กถๅฑๅฃฐๆไธ้กบๅบๆ ๅ
ณ๏ผๅนถ่ฟ่กๆฐๆงๅๆใๅ
จๅฑๅ้็ๅๅงๅผๅจ็ผ่ฏๆถ่ฟ่กๆฑๅผ
</li>
<li>
ๅฏ้็ฑปๅไปฃๆฟ็ฉบๆ้
</li>
<li>
ไธๅ ไฟฎ้ฅฐ็ Zig ๆ้ไธๅฏไธบ็ฉบ
</li>
<li>?ๅฏ้็ฑปๅ</li>
<li>orelse</li>
<li>if</li>
<li>
while
</li>
<li>
ๆๅจๅ
ๅญ็ฎก็
</li>
<li>็จZig็ผๅ็ๅบๅฏไปฅ็จๅจไปปไฝๅฐๆน๏ผ<ul>
<li>ๆก้ข็จๅบ</li>
<li>ไฝๅปถ่ฟๆๅกๅจ</li>
<li>ๆไฝ็ณป็ปๅ
ๆ ธ</li>
<li>ๅตๅ
ฅๅผ่ฎพๅค</li>
<li>ๅฎๆถ่ฝฏไปถ</li>
<li>ๆต่งๅจๆ่
ๅ
ถไปไฝฟ็จWebAssemblyไฝไธบๆไปถ็็จๅบ</li>
<li>้่ฟC ABI็ปๅ
ถไป่ฏญ่จ่ฐ็จ</li>
</ul>
</li>
<li>Zig็จๅบๅๅฟ
้กป่ชๅทฑ็ฎก็่ชๅทฑ็ๅ
ๅญ๏ผๅฟ
้กปๅค็ๅ
ๅญๅ้
ๅคฑ่ดฅ</li>
<li>้่ฆๅ้
ๅ
ๅญ็ๅฝๆฐ้ฝไผๆฅๅไธไธชๅ้
ๅจๅๆฐใๅ ๆญคZigๆ ๅๅบ็่ณๅฏไปฅ็จไบ่ฃธ้ๅฑ็็ฎๆ </li>
<li>defer</li>
<li>
errdefer
</li>
<li>
้่ฏฏๆฏๅผ๏ผไธๅฏๅฟฝ็ฅ
</li>
<li>catch</li>
<li>ๅ
ณ้ฎ่ฏtry ๆฏ catch |err| return err็็ฎๅ<ul>
<li>้่ฏฏ่ฟๅ่ท่ธช</li>
<li>ๅ ๆ ่ท่ธช</li>
</ul>
</li>
<li>ๅจ้่ฏฏๅผไธไฝฟ็จswitchๅ
ณ้ฎ่ฏๅฏไปฅ็จไบ็กฎไฟๆๆๅฏ่ฝ็้่ฏฏ้ฝ่ขซๅค็</li>
<li>
unreachable็จไบๆญ่จไธไผๅ็้่ฏฏ
</li>
<li>
ๅจๆๆ็ฎๆ ไธๅฏ็จๅ ๆ ่ท่ธช
</li>
<li>
ๆณๅๆฐๆฎ็ปๆไธๅฝๆฐ
</li>
<li>็ฑปๅๅๅผๅฟ
้กปๅจ็ผ่ฏๆๅทฒ็ฅ</li>
<li>
ๆณๅๆฐๆฎ็ปๆ็ฎๅๆฅ่ฏดๅฐฑๆฏไธไธชๅฝๆฐ่ฟๅไธไธช็ฑปๅ
</li>
<li>
็ผ่ฏๆๅๅฐๅ็ผ่ฏๆไปฃ็ ๆง่ก
</li>
<li>
@typeInfoๅ
็ฝฎๅฝๆฐๅฏไปฅ็จไบๆไพ็ผ่ฏๆๅๅฐ
</li>
<li>
zigๆ ๅๅบไฝฟ็จ่ฟ็งๆๆฏๆฅๅฎ็ฐๆ ผๅผๅๆๅฐ๏ผzig็ๆ ผๅผๅๆๅฐๅฎๅ
จๆฏๅจzigไธญๅฎ็ฐ็
</li>
<li>
zig่ฟๅฏไปฅๅจ็ผ่ฏๆๅฏนๅฝๆฐๅไปฃ็ ๅๆฑๅผ
</li>
<li>
ๆ ้FFI/bindings็Cๅบ้ๆ
</li>
<li>@cimportๅฏไปฅ็ดๆฅๅฏผๅ
ฅ็ฑปๅใๅ้ใๅฝๆฐๅ็ฎๅ็ๅฎใ</li>
<li>
็่ณ่ฝๅฐCๅ
่ๅฝๆฐ็ฟป่ฏไธบZigๅฝๆฐ
</li>
<li>
ZigไนๆฏC็็ผ่ฏๅจ
</li>
<li>
zigไธlibcไธ่ตทๅๅธ๏ผๆไปฅๅฏไปฅไฝฟ็จzigไฝไธบc็็ผ่ฏๅจ
</li>
<li>
ๅฏผๅบๅฝๆฐใๅ้ๅ็ฑปๅไพCไปฃ็ ไฝฟ็จ
</li>
<li>
ไบคๅ็ผ่ฏ็ไธๆตๆฏๆ
</li>
<li>
Zigๆๅปบ็ณป็ป
</li>
<li>
zig init-exe
</li>
<li>
ไฝฟ็จๅผๆญฅๅฝๆฐ่ฟ่กๅนถๅ
</li>
<li>่ฏฅๅ่ฝไธไพ่ตๅฎฟไธปๆไฝ็ณป็ป๏ผ็่ณไธไพ่ตๅ ๅ้
็ๅ
ๅญ๏ผๅฏ็จไบ่ฃธ้ๅฑ็ฎๆ </li>
<li>zig่ชๅจๆจๅฏผๅฝๆฐๆฏๅฆไธบๅผๆญฅ๏ผๅนถๅ
่ฎธๅจ้ๅผๆญฅๅฝๆฐไธ่ฟ่กasync/await๏ผ่ฟๆๅณ็ Zig ๅบๅฏน้ปๅกไธๅผๆญฅ I/O ๆฏไธๅฏ็ฅ็</li>
<li>ๅฎ็ฐไบไธไธชไบไปถๅพช็ฏ</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/139556443?v=4 | Zig | IDriver/Zig | 2023-07-21T13:17:03Z | Drivers In Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/IDriver/Zig/tags | - | [
"driver",
"drivers",
"io",
"zig"
] | 5 | false | 2024-03-02T03:32:22Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/124872?v=4 | areion | jedisct1/areion | 2023-09-14T21:46:37Z | Experiments with the AREION AES-based permutation. | main | 0 | 0 | 1 | 0 | https://api.github.com/repos/jedisct1/areion/tags | - | [
"aes",
"areion",
"areion512-md",
"hash",
"permutation",
"zig",
"zig-package"
] | 4 | false | 2025-04-17T23:55:55Z | true | false | unknown | github | [] | Areion
This is an implementation of the <a>Areion</a> permutation presented at CHES2023, as well as the Areion512-MD hash function.
Areion512-MD is a very fast hash function, even for small inputs.
~~Note that the output of this implementation doesn't match the test vectors of the paper. There are two bugs in the example code of the paper that was also used to produce the test vectors, which are thus incorrect.
The authors have been informed.~~
Following this, a new version of the paper has been published, with these issues fixed. | [] |
https://avatars.githubusercontent.com/u/50251875?v=4 | binny.sh | eighty4/binny.sh | 2023-12-11T23:40:44Z | Install scripts for GitHub release binaries | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/eighty4/binny.sh/tags | - | [
"c",
"cpp",
"cross-platform",
"devtools",
"go",
"rust",
"supply-chain-management",
"zig"
] | 391 | false | 2025-04-28T22:01:42Z | false | false | unknown | github | [] | binny.sh
Development
The frontend and lambdas packages will require environment variables
with <a>GitHub client credentials for a GitHub OAuth application</a>.
See each package's .env file for environment variable names.
Use these commands to run Binny.sh locally:
| Package | Command |
| -------- | -------- |
| lambdas | l3 sync |
| frontend | pnpm dev |
APIs are deployed to AWS Lambdas with <a>eighty4/l3</a>.
For development, Vite will proxy API requests to AWS Lambda.
<code>l3 sync</code> must be run before starting the frontend Vite server.
Database features are currently disabled to migrate the backend to a serverless deployment.
Unit tests, however, are still ran against Postgres.
Use <code>docker compose up -d --wait</code> and run <code>backend/sql/v001-init-schema.sql</code> before running <code>pnpm test</code> for the backend.
Offline development
Auth and features are dependent on GitHub APIs and thus require network connectivity during development.
Offline mode is used by e2e tests and also for developing with static and predictable data.
Data for offline mode is stubbed out in <a>//offline/src/data.ts</a>.
These commands will stub API dependencies for offline development of the frontend:
| Package | Command |
| -------- | ---------------- |
| frontend | pnpm dev:offline |
| offline | pnpm start |
Selfies and #binnysh tweets while developing on an airplane, on safari, or in a James Cameron-funded submersible
expedition are appreciated!
Interactive update with <code>pnpm</code>
The update command can be used interactively and recursively to upgrade project dependencies:
<code>bash
pnpm update --interactive --latest --recursive</code>
Example install scripts in the wild
Here is a list of install scripts for popular applications that inspired Binny.sh:
<ul>
<li><a>Astral uv</a></li>
<li><a>Astral ruff</a></li>
<li><a>Homebrew</a></li>
<li><a>pnpm</a></li>
<li><a>rustup</a></li>
<li><a>Wasmtime</a></li>
<li><a>wasm-pack</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/66319773?v=4 | syncrt | deadManAlive/syncrt | 2023-04-07T15:50:20Z | A Zig learning project to nudge srt file's time | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/deadManAlive/syncrt/tags | GPL-3.0 | [
"srt",
"subtitle",
"video",
"zig"
] | 24 | false | 2023-04-09T07:22:12Z | true | false | unknown | github | [] | syncrt
A Zig learning project to nudge <code>.srt</code> file's time.
Usage:
<code>syncrt <filename> <nudge (in signed seconds OR current-target)></code>
Example:
<code>syncrt 2012.srt +4.04</code> (delay by 4.04 seconds)
<code>syncrt PoM.srt 01:67:23-01:43:00</code> (advance by 1463 seconds) | [] |
https://avatars.githubusercontent.com/u/107583552?v=4 | polymurhash-zig | e4m2/polymurhash-zig | 2023-06-22T09:31:15Z | PolymurHash port in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/e4m2/polymurhash-zig/tags | Zlib | [
"hash",
"hash-functions",
"hashing",
"hashing-algorithm",
"polymur",
"polymurhash",
"universal-hash",
"universal-hashing",
"zig"
] | 12 | false | 2024-05-29T09:11:29Z | true | false | unknown | github | [] | polymurhash-zig
Zig port of <a>PolymurHash</a> by <a>Orson Peters</a>.
Usage
<ol>
<li>
Create or modify the <code>build.zig.zon</code> file in the project root to include <code>polymurhash-zig</code> as a dependency.
<code>build.zig.zon</code> example
<code>zig
.{
.name = "<name of your program>",
.version = "<version of your program>",
.dependencies = .{
.polymurhash = .{
.url = "https://github.com/e4m2/polymurhash-zig/archive/refs/tags/<git tag>.tar.gz",
.hash = "<package hash>",
},
},
}</code>
If unsure what to fill out for <code><package hash></code>, remove the field entirely and Zig will tell you the correct value in an error message.
</li>
<li>
Add <code>polymurhash-zig</code> as a dependency in <code>build.zig</code>.
<code>build.zig</code> example
<code>zig
const polymurhash = b.dependency("polymurhash", .{});
exe.addModule("polymurhash", polymurhash.module("polymurhash"));</code>
</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | zig-webp-viewer | tetsu-koba/zig-webp-viewer | 2023-05-12T04:51:32Z | Simple WebP image viewer written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tetsu-koba/zig-webp-viewer/tags | - | [
"image-processing",
"zig"
] | 30 | false | 2025-03-07T03:37:18Z | true | false | unknown | github | [] | WebP Image Viewer written in Zig
Actually this is my practice to use libsdl2 and libwebp in Zig
Dependency
You need to install libsdl2 and libwebp developer package.
On the Debian/Ubuntu:
<code>$ sudo apt install -y libwebp-dev libsdl2-dev</code>
On Mac with HomeBrew
<code>% brew update
% brew install webp sdl2</code>
Build
<code>% zig version
0.11.0-dev.3132+465272921
% zig build</code>
Usage
<code>% zig-out/bin/webp-viewer
Usage: zig-out/bin/webp-viewer image.webp...</code>
You can specify multiple fies.
Key operation
SPACE, RIGHT, DOWN, RETURN: show the next image.
LEFT, UP: show the previous image.
q: quit. | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | jpegdec | tetsu-koba/jpegdec | 2023-04-27T06:55:25Z | JPEG decoder with libturbojpeg written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tetsu-koba/jpegdec/tags | - | [
"video-streaming",
"zig"
] | 45 | false | 2025-03-06T05:54:33Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/14164311?v=4 | libinput-zig | cactusbento/libinput-zig | 2023-08-01T21:02:38Z | A Zig wrapper for libinput. | master | 0 | 0 | 1 | 0 | https://api.github.com/repos/cactusbento/libinput-zig/tags | MIT | [
"zig"
] | 21 | false | 2024-12-09T20:34:49Z | true | false | unknown | github | [] | libinput-zig
A libinput wrapper library for zig.
It packs a bunch of functions into various structs to make the resulting library more "ziggy".
Usage
Add the package url to <code>build.zig.zon</code> and link libc, libinput, and libudev.
```zig
pub fn build(b: *std.Build) void {
const dep = b.dependency("libinput-zig", .{});
exe.root_module.addImport("libinput", dep.module());
}
```
Of course, you'll need both libinput and libudev installed on your system to build. | [] |
https://avatars.githubusercontent.com/u/1151033?v=4 | zfunge | cwesson/zfunge | 2023-03-18T22:50:05Z | Simple Befunge interpreter written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/cwesson/zfunge/tags | GPL-3.0 | [
"befunge",
"befunge-93",
"befunge-interpreter",
"befunge93",
"zig"
] | 35 | false | 2024-12-17T01:28:01Z | true | false | unknown | github | [] | zFunge
zFunge is a basic Befunge interpreter written in Zig. zFunge is a work-in-progress, it is currently being developed for Zig 0.13.0. | [] |
https://avatars.githubusercontent.com/u/4645331?v=4 | svd-gen | chaoyangnz/svd-gen | 2023-09-04T08:00:34Z | CMSIS-SVD parser & generator: peripherals and register access for language bindings like Zig, Rust, C.. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/chaoyangnz/svd-gen/tags | - | [
"cmsis-svd",
"embeded",
"svd",
"zig"
] | 16,994 | false | 2024-12-28T09:11:43Z | false | false | unknown | github | [] | svd-gen
CMSIS-SVD file language bindings - a generator of periperals and register for easy access.
Usage
<code>svd-gen -i fe310.svd -o fe310.zig -l Zig</code>
Support:
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Zig
<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> Rust
<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> C | [] |
https://avatars.githubusercontent.com/u/71147926?v=4 | adventOfCode2022 | littleBobbyTablez/adventOfCode2022 | 2023-09-19T16:06:25Z | My Solutions for Advent Of Code 2022 written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/littleBobbyTablez/adventOfCode2022/tags | - | [
"advent-of-code",
"zig"
] | 67 | false | 2023-11-01T17:11:38Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/39071861?v=4 | AoC2023 | MrPicklePinosaur/AoC2023 | 2023-12-04T09:19:47Z | advent of code 2023 in ziglang | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/MrPicklePinosaur/AoC2023/tags | - | [
"advent-of-code-2023",
"zig"
] | 56 | false | 2023-12-04T10:20:56Z | false | false | unknown | github | [] |
# Advent of Code 2023
Writeups
Day1
I have only had very minor exposure to programming in Zig, and was excited to
learn the language a lot better this year. Some immediate things that stood out
to me was how much was checked by the compiler. It feels like a mini-rust of
sorts. The optional and error types are also highly appreciated. Some slight
annoyances with the langauge include unsued variables being a compile error and
the slightly wacky loops.
In part b, I also discovered that the sentinel value of a pointer or slice is
also included in the type, which I found pretty neat. The saturating
subtracting operator is also some nice sugar.
Day2
Day 2 involved a bit of parsing. My solution for this just involved string
splitting over and over again. I wonder how efficient this is? Perhaps a better
approach would be to make a single pass across the line using an iterator and
have a state machine to decide what we are parsing?
Day3
Day 3 in all honesty gave me quite a hard time. This was perhaps due to lack of
understanding of the containers in the standard library, leading to perhaps
some really bad code. I also struggled quite a lot with writing nice code using
zig's loops, which behave slightly different to what you would expect from most
other languages. I would like to revisit this question when I get a bit better
at the language perhaps.
Day4
Pretty clean solution using hashmap to check for winning numbers. Second part
of question was also a nice 1D DP solution. I did misunderstand the question
and thought you win a copy of the card of the number that you matched, leading
to an unnecessary topological sort implmenatation :P. | [] |
https://avatars.githubusercontent.com/u/114303361?v=4 | me | ryuapp/me | 2023-12-28T00:35:01Z | A minimal cat(1) clone for Windows. | main | 3 | 0 | 0 | 0 | https://api.github.com/repos/ryuapp/me/tags | MIT | [
"cli",
"windows",
"zig"
] | 33 | false | 2024-08-19T14:48:10Z | true | true | unknown | github | [] |
me
<strong>me</strong> is a minimal cat(1) clone for Windows.\
Print FILE(s) to standard output.
Usage
<code>bash
me [OPTION]... [FILE]...</code>
Installation
<a>Scoop</a>:
<code>bash
scoop install https://raw.githubusercontent.com/ryuapp/me/main/me.json</code> | [] |
https://avatars.githubusercontent.com/u/135145066?v=4 | once | dying-will-bullet/once | 2023-06-14T10:28:21Z | OnceCell and Lazy in Zig | master | 1 | 0 | 1 | 0 | https://api.github.com/repos/dying-will-bullet/once/tags | - | [
"global-variables",
"lazy-initialization",
"zig",
"ziglang"
] | 10 | false | 2024-05-29T09:11:17Z | true | true | unknown | github | [] | once โณ
<a></a>
This library implements the concepts of <code>Cell</code> and <code>Lazy</code> in Rust, which are used for lazy initialization of variables.
Examples
<code>Lazy</code>: A value which is initialized on the first access.
```zig
const std = @import("std");
const Lazy = @import("once").Lazy;
const allocator = std.heap.page_allocator;
var global_map = Lazy(
// Type of Cell
std.StringHashMap(i32),
// Cell Init Function
struct {
fn f() std.StringHashMap(i32) {
var map = std.StringHashMap(i32).init(allocator);
map.put("a", 1) catch @panic("unable to put a");
return map;
}
}.f,
).init();
pub fn main() !void {
var map_ptr = global_map.get();
try map_ptr.*.put("b", 2);
<code>std.debug.assert(map_ptr.*.get("a").? == 1);
std.debug.assert(map_ptr.*.get("b").? == 2);
</code>
}
```
<code>OnceCell</code>: A thread-safe cell which can be written to only once.
```zig
const std = @import("std");
const OnceCell = @import("once").OnceCell;
var shared: usize = 0;
pub fn main() !void {
var cell = OnceCell([]const u8).empty();
<code>std.debug.assert(cell.get() == null);
// Both try to init a cell
var threads: [8]std.Thread = undefined;
for (&threads) |*handle| {
handle.* = try std.Thread.spawn(.{}, struct {
fn thread_fn(c: *OnceCell([]const u8)) !void {
_ = c.getOrInit(struct {
fn f() []const u8 {
shared += 1;
return "Hello";
}
}.f);
}
}.thread_fn, .{&cell});
}
for (threads) |handle| handle.join();
std.debug.assert(std.mem.eql(u8, cell.get().?.*, "Hello"));
// Only init once
std.debug.assert(shared == 1);
</code>
}
```
Installation
LICENSE
MIT License Copyright (c) 2023, Hanaasagi | [] |
https://avatars.githubusercontent.com/u/11492844?v=4 | farbe | fjebaker/farbe | 2024-01-23T21:33:23Z | More Zig (ANSI) colours for the terminal. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/fjebaker/farbe/tags | MIT | [
"ansi",
"cli",
"color",
"rainbow",
"terminal",
"zig"
] | 24 | false | 2025-03-16T15:00:35Z | true | true | unknown | github | [] | Farbe
Colour for the <em>terminal</em> user.
References
This project draws enormous inspiration from <a>tr1ckydev/chameleon</a>. | [] |
https://avatars.githubusercontent.com/u/6756180?v=4 | c2z | kassane/c2z | 2023-06-26T12:02:42Z | C++ to Zig bindings and transpiler (forked) | upstream | 0 | 0 | 0 | 0 | https://api.github.com/repos/kassane/c2z/tags | - | [
"cpp",
"ffi",
"zig"
] | 3,710 | true | 2024-11-04T18:19:38Z | true | false | unknown | github | [] | inspeired by this <a>article</a> uses zig to create zig bindgens for c++
<code>zig cc -x c++ -std=c++11 -Xclang -ast-dump=json {input_file}</code>
Notes
<ul>
<li>Glue is invitable ... snap ... and needed to make the bindings cross platform</li>
<li>Transpiled code can leak memory (implicit destructors aren't called)</li>
<li>Manual adjustments are required, specially to make bindings idiomatic and easer to read</li>
<li>Meant to work with libraries that follow the <em>C with classes</em> coding style</li>
<li>No Zig side inheritance, instead create bindings of a C++ implementation</li>
</ul>
Usage
Setup
<ol>
<li>make sure <code>zig</code> in your PATH, you will need the version <code>0.13</code> and up</li>
<li>build the project and copy the <code>c2z</code> executable from <code>zig-out</code> to your desired location</li>
<li>or just run the project using <code>zig build run -- ARGS</code></li>
</ol>
Running it
<ol>
<li><code>zig build run -- lib.h</code> or <code>c2z lib.h</code></li>
<li>pass any clang argument like include and defines e.g. <code>zig build run -- -DNDEBUG -I.\include -target x86-linux -- .\include\lib.h</code></li>
<li>modify the generated bindings until it works ;) you might need to import <code>cpp.zig</code> it is located in the src folder</li>
</ol>
Misc
<ul>
<li><code>msvc</code> has a second tier support, just pass it as target tuple like as: <code>-no-glue -target x86_64-windows-msvc</code> to generate a target specifc binding for it. Debug builds aren't fully supported, use <code>ReleaseFast</code> or at least <code>-O1</code>, you might also wan't to find a way of define <code>_ITERATOR_DEBUG_LEVEL</code> to something different than <code>2</code>.</li>
</ul>
Todo
<ul>
<li>transpile inline or constexpr constructors when the class isn't polymorphic</li>
<li>use function pointers to handle varidact functions</li>
<li>(hard) <code>#include</code> -> <code>@import</code></li>
<li>
(easy) walk a directory tree
</li>
<li>
transpile vector of vectors
</li>
<li>(easy) better input file not found error</li>
<li>(easy) verbose option</li>
<li>(easy) handle <code>BlockCommandComment</code> and <code>ParamCommandComment</code> in <code>FullComment</code></li>
<li>(easy) resolve return of function with a aliased return type</li>
<li>(easy) fail when clang ast-bump has failed, because missing headers or wrong code</li>
<li>(hard) <code>if (*data++ == v) { ... }</code> should generate <code>{ const __tmp0 = data; data += 1; if (__tmp0.* == v) { ... } }</code></li>
<li>(hard) solve <code>UnresolvedMemberExpr</code>, maybe when integrating clang ast directly</li>
<li>(hard) solve implicit destructors calls</li>
<li>(easy) handle private members, class is default private, struct default public, in code is referenced as <code>self.public</code></li>
<li>(hard) handle varidact functions <code>myFunction(va_args) -> myFunction(args: [*c]u8) and myFunction__VA(...)</code></li>
<li>(hard) apply <code>keywordFix</code></li>
<li>use <code>@compileError</code> for objects that couldn't be transpiled</li>
<li>write layout tests</li>
</ul>
Test cases
C++ libs
<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> fpng (99.99 %)
<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> xatlas (86.40 %)
<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> imgui (67.21 %)
<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> msdfgen (~80% ish)
<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> box2d
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> basis_universal
<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> JoltPhysics
<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> astc-encoder
C libs (or with builtin C bindings)
<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> SDL2
<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> stbi
<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> raylib
<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> meshoptimizer
<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> tinyexr
<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> minimp3 | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.