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/40577357?v=4 | DeferExpression | jvyden/DeferExpression | 2023-08-26T02:54:40Z | Defer from Zig in C#. Cursed as hell. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/jvyden/DeferExpression/tags | - | [
"csharp",
"cursed",
"defer",
"stack",
"zig",
"ziglang"
] | 8 | false | 2023-08-26T03:09:38Z | false | false | unknown | github | [] | DeferExpression
Defer from Zig in C#. Cursed as hell.
```csharp
public static void Main()
{
using var d1 = new Defer(() => Console.WriteLine("1"));
using var d2 = new Defer(() => Console.WriteLine("2"));
using var d3 = new Defer(() => Console.WriteLine("3"));
using var d4 = new Defer(() => Console.WriteLine("4"));
<code> Console.WriteLine("Hello, World!");
using var d5 = new Defer(() => Console.WriteLine("5"));
}
</code>
<code>Outputs:</code>
Hello, World!
5
4
3
2
1
```
Or you can use the stack version for the same result:
```csharp
public static void Main()
{
using DeferStack stack = new(capacity: 5);
<code> stack.Defer(() => Console.WriteLine("1"));
stack.Defer(() => Console.WriteLine("2"));
stack.Defer(() => Console.WriteLine("3"));
stack.Defer(() => Console.WriteLine("4"));
Console.WriteLine("Hello, World!");
stack.Defer(() => Console.WriteLine("5"));
}
</code>
``` | [] |
https://avatars.githubusercontent.com/u/27034173?v=4 | eriz | baioc/eriz | 2023-09-25T03:48:40Z | Data structures and utilities | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/baioc/eriz/tags | - | [
"b-tree",
"zig"
] | 5,521 | false | 2024-12-03T18:20:36Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/576065?v=4 | aoc-2023-zig | thekorn/aoc-2023-zig | 2023-12-03T06:06:29Z | Advent of code 2023 in zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/thekorn/aoc-2023-zig/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"aoc",
"aoc-2023",
"zig"
] | 82 | false | 2023-12-03T12:09:43Z | true | false | unknown | github | [] | Advent of Code 2023 in zig
See <a>Advent of Code 2023</a> for more information.
how to run
You need zig 0.11 or later to run this code.
If you dont have zig installed, you can use a nix shell which includes all required dependencies.
<code>bash
$ nix-shell --run zsh</code>
Within the shell you have can run every day, by
<code>bash
$ zig build day01</code>
and the test for each day by
<code>bash
$ zig build test_day01</code>
(Replace <code>day01</code> with the day you want to run.)
run all tests
<code>bash
$ zig build test</code>
Reference
<ul>
<li>project setup is based on <a>this template</a></li>
<li><a>blog post with inspiration</a></li>
</ul> | [] |
https://avatars.githubusercontent.com/u/31693262?v=4 | dpll-solver | leifhelm/dpll-solver | 2023-04-04T22:08:05Z | null | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/leifhelm/dpll-solver/tags | - | [
"dpll",
"logic",
"zig"
] | 10 | false | 2023-04-04T22:10:50Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/6188189?v=4 | adventofcode.zig | scnewma/adventofcode.zig | 2023-12-01T17:33:50Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/scnewma/adventofcode.zig/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"zig"
] | 22 | false | 2023-12-01T17:51:19Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/145841395?v=4 | conway | htanmo/conway | 2023-09-30T14:43:15Z | Conway's Game of Life. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/htanmo/conway/tags | GPL-3.0 | [
"gamedev",
"gameoflife",
"zig",
"ziglang"
] | 506 | false | 2024-09-22T18:07:20Z | true | true | 0.13.0 | github | [] | Conway's Game of Life
This is a simple implementation of Conway's Game of Life written in Zig,
utilizing the SDL library for graphics rendering.
Screenshot
Build Instructions
Make sure you have Zig installed on your system. If not, you can download and install it from the official Zig website.
Ensure SDL2 is installed on your system. You can install it using your package manager or download it from the SDL website.
<ul>
<li>
Clone this repository:
</li>
</ul>
<code>bash
git clone https://github.com/htanmo/conway.git</code>
<ul>
<li>
Navigate to the project directory:
</li>
</ul>
<code>bash
cd conway</code>
<ul>
<li>
Build the project using Zig:
</li>
</ul>
<code>bash
zig build -Doptimize=ReleaseSafe</code>
<ul>
<li>
Run the executable:
</li>
</ul>
<blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
Executable will be found under ./zig-out/bin directory after compilation.
</blockquote>
<code>bash
./conway</code>
Keybindings
<code>text
Spacebar: Start/Pause the simulation.
C / Middle Mouse: Clear the board (kill all cells).
Right Mouse: Changes cursor mode.
Left Mouse: Change Cell state.
Esc: Exit the game.</code>
<a>LICENSE</a> | [] |
https://avatars.githubusercontent.com/u/11302774?v=4 | advent-of-code-2022 | TheFunctionalGuy/advent-of-code-2022 | 2023-09-13T17:29:09Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/TheFunctionalGuy/advent-of-code-2022/tags | - | [
"advent-of-code",
"advent-of-code-2022",
"zig",
"ziglang"
] | 29 | false | 2024-11-13T23:08:06Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/29209552?v=4 | zig-exp-a | wa1tnr/zig-exp-a | 2023-10-12T20:08:39Z | zig - local experimentation - 12 Oct 2023 | main | 1 | 0 | 0 | 0 | https://api.github.com/repos/wa1tnr/zig-exp-a/tags | - | [
"c",
"compiler",
"cplusplus",
"cpp",
"zig"
] | 2 | false | 2023-11-01T17:11:36Z | false | false | unknown | github | [] | Thu Oct 12 21:31:52 UTC 2023 | [] |
https://avatars.githubusercontent.com/u/65970513?v=4 | pooper-snake | earthtraveller1/pooper-snake | 2023-09-22T16:19:49Z | snake but with can pooper | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/earthtraveller1/pooper-snake/tags | GPL-3.0 | [
"game",
"neng-li",
"raylib",
"snake-game",
"zig"
] | 1,142 | false | 2023-11-01T17:24:57Z | true | false | unknown | github | [] | Pooper Snake
Snake, but with Can Pooper.
QuickStart
Due to reasons, this project targets the latest nightly build of Zig. As a result, this is assuming that you have that installed.
<code>zig build run -Doptimize=ReleaseFast</code> | [] |
https://avatars.githubusercontent.com/u/24524492?v=4 | Exercism | laqudee/Exercism | 2023-12-27T07:30:28Z | Solve coding exercises and get mentored to develop fluency in your chosen programming languages. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/laqudee/Exercism/tags | - | [
"c",
"exercism",
"nodejs",
"rust",
"typescript",
"zig"
] | 2,788 | false | 2024-02-26T04:19:46Z | false | false | unknown | github | [] | EXERCISM
<a>EXERCISM PROGRAMMING</a>
TypeScript
<ul>
<li>armstrong-numbers</li>
<li>Bob</li>
<li>clock</li>
<li>collatz-conjecture</li>
<li>darts</li>
<li>difference-of-squares</li>
<li>dnd-character</li>
<li>gigasecond</li>
<li>hamming</li>
<li>isogram</li>
<li>leap</li>
<li>pangram</li>
<li>raindrops</li>
<li>resistor-color-duo</li>
<li>resistor-color-trio</li>
<li>rna-transcription</li>
<li>space-age</li>
<li>triangle</li>
</ul>
C
<ul>
<li>armstrong-numbers</li>
<li>binary-search</li>
<li>circular-buffer</li>
<li>clock</li>
<li>darts</li>
<li>difference-of-squares</li>
<li>gigasecond</li>
<li>grade-school</li>
<li>grains</li>
<li>hamming</li>
<li>hello-world</li>
<li>isogram</li>
<li>list-ops</li>
<li>pangram</li>
<li>rational-numbers</li>
<li>resistor-color</li>
<li>resistor-color-duo</li>
<li>reverse-string</li>
<li>space-age</li>
<li>square-root</li>
<li>two-fer</li>
</ul>
Rust
<ul>
<li>armstrong-numbers</li>
<li>beer-song</li>
<li>bob</li>
<li>clock</li>
<li>collatz-conjecture</li>
<li>different-of-squares</li>
<li>gigasecond</li>
<li>grains</li>
<li>hamming</li>
<li>isogram</li>
<li>leap</li>
<li>nth-prime</li>
<li>pangram</li>
<li>prime-factors</li>
<li>proverb</li>
<li>raindrops</li>
<li>reverse-string</li>
<li>space-age</li>
<li>sum-of-multiples</li>
</ul>
Zig
<ul>
<li>armstrong-numbers</li>
<li>binary-search</li>
<li>bob</li>
<li>collatz-conjecture</li>
<li>darts</li>
<li>difference-of-squares</li>
<li>dnd-character</li>
<li>grains</li>
<li>hamming</li>
<li>isogram</li>
<li>leap</li>
<li>pangram</li>
<li>resistor-color</li>
<li>resistor-color-duo</li>
<li>rna-transcription</li>
<li>scrabble-score</li>
<li>space-age</li>
<li>sum-of-multiples</li>
<li>triangle</li>
<li>two-per</li>
</ul>
JavaScript
<ul>
<li>amusement-park</li>
<li>annalyns-infiltrate</li>
<li>bird-watcher</li>
<li>darts</li>
<li>elyses-enchantments</li>
<li>freelancer-rates</li>
<li>gigasecond</li>
<li>high-score-board</li>
<li>lasagna</li>
<li>leap</li>
<li>mixed-juices</li>
<li>poetry-club-door-policy</li>
<li>raindrops</li>
<li>vehicle-club-door-policy</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/79972089?v=4 | zig_pro_learn | ATLAS-B28/zig_pro_learn | 2023-11-21T07:30:30Z | Learning zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ATLAS-B28/zig_pro_learn/tags | - | [
"zig",
"zig-lang"
] | 7,623 | false | 2024-10-19T06:13:30Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/565124?v=4 | w4-balls | peterhellberg/w4-balls | 2023-11-23T22:47:53Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/peterhellberg/w4-balls/tags | - | [
"game",
"gamedev",
"wasm4",
"zig"
] | 12 | false | 2023-11-23T22:52:21Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "w4",
"tar_url": "https://github.com/peterhellberg/w4/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/peterhellberg/w4"
}
] | w4-balls :zap:
Using <a>Zig</a> to compile a <code>.wasm</code> cart for use in <a>WASM-4</a>
Development
File watcher can be started by calling:
<code>sh
zig build spy</code>
Running the cart in WASM-4:
<code>sh
zig build run</code>
Deploy:
<code>make Deploy</code> | [] |
https://avatars.githubusercontent.com/u/87582318?v=4 | zig-rlottie | koenigskraut/zig-rlottie | 2023-10-19T04:18:33Z | Zig binding for rlottie library | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/koenigskraut/zig-rlottie/tags | - | [
"lottie",
"rlottie",
"telegram",
"telegram-stickers",
"zig"
] | 6 | false | 2023-11-10T00:16:50Z | true | true | unknown | github | [
{
"commit": "08f1e15a61a97f4bae37041c2ea742f517b2824c.tar.gz",
"name": "librlottie",
"tar_url": "https://github.com/koenigskraut/rlottie-tg/archive/08f1e15a61a97f4bae37041c2ea742f517b2824c.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/koenigskraut/rlottie-tg"
}
] | zig-rlottie
Basic binding for rlottie C API targeting its <a>Telegram</a> fork. | [] |
https://avatars.githubusercontent.com/u/50055?v=4 | adventofcode2023 | milanaleksic/adventofcode2023 | 2023-12-02T06:27:07Z | My AOC2023 solutions. Read-only mirror of https://git.milanaleksic.net/milanaleksic/adventofcode2023 | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/milanaleksic/adventofcode2023/tags | - | [
"advent-of-code",
"zig"
] | 284 | false | 2023-12-09T08:18:02Z | true | false | unknown | github | [] | Advent of Code 2023
done by: milan@aleksic.dev
Using: zig v0.11.0
<blockquote>
Note: I am a Zig newbie & using AoC to learn as-I-go
</blockquote>
```bash
➜ ./run.sh
...
no dependencies beyond system
➜ otool -L zig-out/bin/adventofcode2023
zig-out/bin/adventofcode2023:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1336.0.0)
➜ mls zig-out/bin/adventofcode2023
.rwxr-xr-x milan staff 233 KB Wed Dec 6 12:55:08 2023 zig-out/bin/adventofcode2023
```
Improvements
<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> stable naming of functions and tests
<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> multi-line test source instead of manual <code>append</code> calls
<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> ~switch places for equals comparison in tests, figure out the comptime error cause~ (https://github.com/ziglang/zig/issues/4437)
<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> named structs as function results in day2
<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> use test allocator in prod code as arg to verify no leaks occur
<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> try different allocators (arena maybe?)
Days I reached out for help
<ul>
<li>day 8, part 2 (decision to use LCM)</li>
<li>day 18, part 2 (Pick's theorem and Shoelace formula)</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | av1enc | tetsu-koba/av1enc | 2023-05-08T13:50:55Z | AV1 video encoder for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tetsu-koba/av1enc/tags | - | [
"video-streaming",
"zig"
] | 1,585 | false | 2024-05-18T07:03:01Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | vp8dec | tetsu-koba/vp8dec | 2023-07-12T05:26:26Z | VP8 video decoder written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tetsu-koba/vp8dec/tags | - | [
"live-streaming",
"zig"
] | 3,019 | false | 2025-03-06T05:47:44Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/30342951?v=4 | BlendImages | MzaxnaV/BlendImages | 2023-06-03T05:42:28Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/MzaxnaV/BlendImages/tags | - | [
"raygui",
"raylib",
"zig"
] | 954 | false | 2024-05-23T16:32:42Z | true | true | unknown | github | [
{
"commit": "d9c5066382615644137b4f65479c65c44820027a.tar.gz",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/d9c5066382615644137b4f65479c65c44820027a.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
},
{
"commit": "7bb66e5c7f3e283995a... | BlendImages
Small project to test image blending, made with zig (0.12) and raylib (5.0-dev) | [] |
https://avatars.githubusercontent.com/u/132974257?v=4 | .github | optimism-java/.github | 2023-10-18T08:51:41Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/optimism-java/.github/tags | - | [
"eip-4844",
"eth2",
"eth2-beacon-chain",
"eth2-clients",
"ethereum",
"java",
"op-stack",
"opstack",
"optimism",
"rust",
"rust-lang",
"zig",
"ziglang"
] | 8 | false | 2024-10-15T13:15:23Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/50797868?v=4 | zig-ksuid | maolonglong/zig-ksuid | 2023-09-19T14:06:06Z | K-Sortable Globally Unique IDs | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/maolonglong/zig-ksuid/tags | MIT | [
"coordination",
"ksuid",
"unique-id",
"uuid",
"zig",
"ziglang"
] | 5 | false | 2023-11-01T17:11:46Z | true | true | unknown | github | [
{
"commit": "34e068756e69e7ee51ba6f27eb9036e19984a128.tar.gz",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/34e068756e69e7ee51ba6f27eb9036e19984a128.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | zig-ksuid
Zig implementation of <a>segmentio/ksuid</a>. | [] |
https://avatars.githubusercontent.com/u/88176012?v=4 | doer-cli | seipan/doer-cli | 2023-09-12T08:10:27Z | doer cli written by Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/seipan/doer-cli/tags | MIT | [
"cli",
"zig"
] | 11 | false | 2023-11-01T17:25:21Z | true | true | unknown | github | [] | doer-cli
doer cli
Install
不明
Usage
<code>zig build run -- logo</code>
実行結果
<code>\````````````````````````````````````````````````````````````````````````````````````````````````````
``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.`
`.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.``````
``.``.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.`.
`.````.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.```
```.````.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>``.``.````.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``</code>.<code>.`.``.``````.`````.`````.`````.`````.`````.`````.`````.`````.`````.`````.`````.`````.`````.````</code>.<code>.``.`.`.``.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.`.```.``.
``.```.`````.```.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.``
`.``.``.`.````.````.``.`.</code>.<code>.```.</code>.<code>.`.</code>.<code>.```.</code>.<code>.`.</code>.<code>.```.</code>.<code>.`.</code>.<code>.```.</code>.<code>.</code>.<code>`````.````.``.``.```.````.```.``.</code>..<code>..</code>.<code>.</code>.<code>.`.`.```.```.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.````
`.</code>.<code>.``.`````.</code>.<code>.</code>.<code>.`..dHNmJ..`.`.````.``.``.````.`````.`````.`````.`````.`````.````.``.
``.</code>.<code>.</code>.<code>.``.``.``.``.```.```,HHHHHMNa.</code>.<code>.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.``.```
```.```.```````.``.````````.````.</code>,HHHHHHHH#Na,..<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.````.```.``
`.``.````.`.``.````.`.`.`.``.``.`.,HHHHHH##H##HMmJ.`.```.``.`.`.``.`.``.`.```.`.```.`.```.``.``.``.`</code>.<code>.```.```.`````.```.</code>.<code>,HHHHHHH#HHH#H#M#N&..``.`.`.``.``.``````.`````.`````.```.`````.```
`.`.``.```.``.```.``.`````````.`.`,HHHHHHH#H#H########Nm,.`.``.``.```.`.```.`.```.`.```.```.`.```.``
``.</code>.<code>.``.``.``.``.`.`.````.`,HHHHHHH#HH#HHHH#HH#H##MmJ..``.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.```.`
````.```.``````.```.````.```.``.``,HHHH#HH#H#H##############NNx,.``.``.``.````.</code>.<code>.`.```.</code>
<code>.``.``.``.</code>.<code>.````.````.``.</code>.,HHHHHHH#HH#H#H#H#H#######NNNNNg..<code>.</code>.<code>.`.</code>.<code>.````.```.``.``.</code>.<code>``.``.```.```.```.``.``.```.```.</code>.,HHHHHHH#H#H#H##H##H#######NNNNNNNmJ.<code>.``.``.``.</code>.<code>.</code>.<code>.</code>.
<code>.````.``.```.```.``.````.```,HHHHHHH#HH#H#H##H########NNNNNNNNNNNN&, . .`` ```.``.```.```.````
`.`.```.``.````.```.````.``.````.`,HHHHHHH#H#H#H#H#HH#H####NNNNNNNNNNNMNNMNm,. .`.</code>.<code>.</code>.<code>.</code>
<code>.</code>.<code>.```.</code>.<code>.</code>.<code>.``.``.`,HHHHHHHH#H#H#H#####Y"""""""""""""""""""""""!``.`.`.```.```.```.``</code>.<code>.``.```.```.`.``.``.``.``,HHHHH#HH#HH##H##H#MaJJ(((((((((((JJJJJJJJJ,~``.</code>.<code>.``.``.</code>
<code>.```.``.``.``.``.`````.``````.```,HHHHHH#H####H#############NNNNNNNNNNNNMM9!.``.```.``.``.```.```.</code>
<code>.```.``````.````.</code>.<code>.`.</code>.<code>.,HHHHHHH#H@77777777777777777777777TNM#=~</code> <code>.`.````.``.</code>.<code>.
``.``.``.`.````.</code>.<code>.```.``,HHHH#HHH#Ng&gg&&&&gggggggggggggggv=```..`.``.``.``.``````.```.```
`.``.````.``.``.``.``.`.``.``.``.`,HHHHHHHHHHH#H###########NM#NMMY!.``````````.``````.`.`.```.```.``
``````.````.``.``.````.``.````.``..<!!!!!!!!!!!!!!!!!!!!!!?MMB=~`````.`.`.``.```.`.`````.``.``.```.`
`.`.```.``.````````.</code>.<code>.`.mgggggggggggggggggggggmC^_``.`.``.```.``.```.```.`.</code>.<code>.```.</code>.<code>.```.`.`.</code>.<code>.`.</code>.<code>.</code>.<code>,HHHHHHHHH#H##H####MMY! ``.```.</code>.<code>.``````.```.```.</code>.<code>.``.``.``
``.``.``.`````.``.``.</code>.<code>.``.``,HHHHHHHH#HH###HMB"~.`.````.````````..`.</code>.<code>.````.``.``.</code>.<code>`.```````.``.</code>.<code>.``.````.``.,HHHHHHH#H#HMM9^`` ````.``.``.`.`.``````.```.```.``.``.````.````.`
```.`.`.``.``.````.``.````.`.```.`,HHHHHH#HMMY!`.```.`.``.````.```.``.``.``.``.``.``.</code>.<code>.``.``
``.</code>.<code>.``.``.``.``.```.```.``,HHHHHMB=~`..``.`.``.`.``.</code>.<code>.``.````.``.</code>.<code>.</code>.<code>.</code>.<code>.
`.``````.``````.</code>.<code>.</code>.<code>...WMM9=```.````.````.```.</code>.<code>.``.````.``.``````.``````.```.````.```
```.</code>.<code>.`.`.```.```.</code>.<code>.```.</code> .<code>.``.````.``.``.````.`````.````.``.```.</code>.<code>.```.</code>.<code>.</code>.<code>.</code>.<code></code>.<code>.````.``.``.</code>.<code>.``.</code>.<code>.``.`.```.</code>.<code>.</code>.<code>.```.```.```.````.``.````.```.```.``.``.</code>
<code>.```.``.````.````.```.````.```.``.</code>.<code>.```.````.```.`````.```.</code>.<code>.```.`````.</code>.<code>.````.</code>.<code>```.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.````.```.````.```.</code>.<code>.``.``.``.``.```.``.
``.``.``.``.</code>.<code>.</code>.<code>.````.``````.````.</code>.<code>.``````.``.``.</code>.<code>.</code>.<code>.``.````.``.```.```.``.</code>
<code>.````.``````.``.```.```.``.```.</code>.<code>.```.``````.````.</code>.<code>.</code>.<code>.``.``.`````.</code>.<code>.````.```.``
```.```.`.``.``.``.``.</code>.<code>.```.``.`.```.``.```.```.````.```.````.`.```.``.`.`.```.``.``.````
``.``.````.```.````.``.`.``.``.</code>.<code>.</code>.<code>.</code>.<code>.```.</code>.<code>.```.```.</code>.<code>.`````.</code>.<code>.``.``
`.````.``.``.</code>.<code>``.```.`.`.```.````.``.```.```.``.``.````.```.`.````.```.```.```.```.````.``.
```.``.````.```.``.`.`.```.`````.``.``.``.````.```.</code>.<code>.</code>.<code>.````.</code>.<code>.```.</code>.<code>.</code>.<code>.````.`</code>.<code>.</code>.<code>.````.</code>.<code>.</code>.<code>.```.````.```.</code>.<code>.</code>.<code>.``````.`````.````.`````.```.``.``.````.</code>.<code>`.`````.``.``.``.``````.</code>.<code>.````.```.</code>.<code>.</code>.<code>.`.`.``.`.</code>.<code>.``.</code>.<code>.`````````.``.</code>.<code>.
```.</code>.<code>.````.```.`.````.```.```.</code>.<code>.</code>.<code>.</code>.<code>.</code>.<code>.```.</code>.<code>.`.`.`.</code>.<code>``.</code>
``` | [] |
https://avatars.githubusercontent.com/u/63371699?v=4 | sdl2-zig-demo | adia-dev/sdl2-zig-demo | 2023-06-11T16:20:37Z | Showcase of Zig and SDL2 | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/adia-dev/sdl2-zig-demo/tags | - | [
"sdl2",
"zig",
"zig-lang"
] | 1,300 | false | 2023-06-11T16:23:26Z | true | false | unknown | github | [] | SDL2 Zig Demo
This repository contains an updated version of the SDL2 Zig Demo created by @andrewrk. The original repository can be found <a>here</a>.
Demo
Check out the demo of the SDL2 Zig Demo in action:
The demo showcases a simple application window created using SDL2 in Zig. The window allows user interaction and displays a red square that can be moved using arrow keys. Additionally, it renders text on the window to display information such as the position and speed of the square.
How to Build and Run
To build and run the SDL2 Zig Demo, follow these steps:
<ol>
<li>Clone the repository:</li>
</ol>
<code>bash
git clone https://github.com/adia-dev/sdl2-zig-demo.git</code>
<ol>
<li>Change into the project directory:</li>
</ol>
<code>bash
cd sdl2-zig-demo</code>
<ol>
<li>Build the project:</li>
</ol>
<code>bash
zig build run</code>
This will compile the code and execute the resulting binary, launching the SDL2 Zig Demo window.
Prerequisites
Before running the SDL2 Zig Demo, make sure you have the following dependencies installed:
<ul>
<li>Zig compiler (version 0.11 or later (the one the project was built with: <code>0.11.0-dev.3384+00ff65357</code>))</li>
<li>SDL2 development libraries</li>
</ul>
Ensure that you have the necessary dependencies installed before attempting to build and run the demo.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, feel free to open an issue or submit a pull request. | [] |
https://avatars.githubusercontent.com/u/11783357?v=4 | locus | SeedyROM/locus | 2023-11-29T11:10:49Z | Locus is a i18n and l10n tool written in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/SeedyROM/locus/tags | MIT | [
"gettext",
"i18n",
"l10n",
"zig"
] | 31 | false | 2023-12-02T08:11:49Z | true | true | unknown | github | [] | 📎 locus
Locus is a cli/library for l10n and i18n.
!!!TBD!!! | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | liby4m | tetsu-koba/liby4m | 2023-05-06T07:52:15Z | Library written in Zig for reading and writing Y4M files | main | 1 | 0 | 1 | 0 | https://api.github.com/repos/tetsu-koba/liby4m/tags | - | [
"video-streaming",
"zig"
] | 2,256 | false | 2024-06-13T04:41:59Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/118959?v=4 | monkeyz | vinymeuh/monkeyz | 2023-06-11T07:18:56Z | Reimplementing the Monkey language in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/vinymeuh/monkeyz/tags | - | [
"monkey",
"zig"
] | 10 | false | 2023-07-08T21:29:55Z | true | false | unknown | github | [] | monkeyZ 🐒 🦎
Learning <a>Zig</a> reimplementing the Monkey language interpreter from Thorsten Ball's <a>book</a>.
Work in progress:
<ul>
<li>
[x] Lexing
</li>
<li>
[x] Tokens and Lexer
</li>
<li>
[x] Start of a REPL
</li>
<li>
[ ] Parsing
</li>
<li>[ ] Evaluation</li>
<li>[ ] Extending the Interpreter</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/25110884?v=4 | monkey-zig | zdurham/monkey-zig | 2024-01-29T22:50:38Z | Implementation of monkey lang in zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/zdurham/monkey-zig/tags | MIT | [
"interpreters",
"monkey-language",
"zig",
"ziglang"
] | 67 | false | 2025-03-06T15:41:03Z | true | true | unknown | github | [] | Monkey Language Zig Implementation
This is an implementation of the interpreter from <a>Writing An Interpreter In Go</a> in zig. This is both an attempt to learn more about interpreters while also trying out a low level systems language. While the book doesn't include explicit steps to, I intend to also build a garbage collector to go along with the interpreter. | [] |
https://avatars.githubusercontent.com/u/36502791?v=4 | bootloader | 1nwf/bootloader | 2023-03-21T02:06:24Z | a WIP bootloader for x86 | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/1nwf/bootloader/tags | - | [
"assembly",
"assembly-x86",
"bootloader",
"zig"
] | 53 | false | 2023-08-18T03:03:30Z | true | false | unknown | github | [] | bootloader
a simple bootloader for a <a>zkernel</a> | [] |
https://avatars.githubusercontent.com/u/60308719?v=4 | SQL-Parser | Enriquefft/SQL-Parser | 2023-08-06T14:24:39Z | SQLite parser made in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Enriquefft/SQL-Parser/tags | MIT | [
"reinventing-the-wheel",
"sql-parser",
"zig"
] | 3 | false | 2023-08-14T09:16:06Z | true | false | unknown | github | [] | SQL-Parser
SQLite parser made in Zig | [] |
https://avatars.githubusercontent.com/u/3594035?v=4 | aoc | tsunaminoai/aoc | 2023-09-23T01:44:46Z | My Advent of Code for 2023 | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tsunaminoai/aoc/tags | - | [
"advent-of-code",
"zig",
"ziglang"
] | 180 | false | 2024-07-05T04:51:13Z | true | true | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/13811862?v=4 | maybe-zig | thechampagne/maybe-zig | 2023-09-30T03:51:10Z | A Rust compatible Result<T, E> and Option<T> types for Zig. [WIP] | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/thechampagne/maybe-zig/tags | MIT | [
"rust",
"rust-lang",
"zig",
"ziglang"
] | 17 | false | 2023-11-01T17:11:49Z | true | false | unknown | github | [] | maybe-zig
<a></a> <a></a>
A Rust compatible Result and Option< T > types for Zig.
References
<ul>
<li><a>Result</a></li>
<li><a>Option< T ></a></li>
</ul>
License
This repo is released under the <a>MIT License</a>. | [] |
https://avatars.githubusercontent.com/u/70723965?v=4 | meta_match | tomBoddaert/meta_match | 2024-01-01T18:25:12Z | A zig module to match types | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tomBoddaert/meta_match/tags | - | [
"metaprogramming",
"types",
"zig",
"ziglang"
] | 4,089 | false | 2024-05-17T00:39:15Z | true | true | 0.13.0 | github | [] | meta_match
<code>meta_match</code> is a <a>zig</a> module that can match types for you!
It is designed to assist with meta-programming of things like interfaces.
Adding meta_match to your project
Run
<code>sh
zig fetch --save https://github.com/tomBoddaert/meta_match/archive/{commit}.tar.gz</code>
Where <code>{commit}</code> is replaced with the commit (e.g. <code>4129996211edd30b25c23454520fd78b2a70394b</code>).
Example: go-like interfaces
Interfaces in go are implemented implicitly, this means that any type that has the required
functions and fields.
<code>``zig
/// An interface for deinitialising.
///
/// If the type does not have a</code>deinit<code>function, the</code>deinit` function
/// does nothing.
pub fn Deinit(comptime T: type) type {
return struct {
// This matches a compatable 'deinit' function
const DeinitMatch = TypeMatch{
.Fn = &FnMatch{
// Only accept zig and C functions
.calling_convention = .{ .options = &.{ .Unspecified, .C, .Inline } },
// Don't accept C variadic functions
.is_var_args = false,
// It must return void
.return_type = TypeMatch{ .Void = {} },
.params = &.{
// It must have a single pointer parameter
// Note that the 'constness' of this pointer is not specified,
// so functions that take '<em>const T' will also be accepted.
ParamMatch{
.type = TypeMatch{
.Pointer = &PointerMatch{
// The pointer must point to one value
.size = .{ .options = &.{Type.Pointer.Size.One} },
// It must not be volatile
.is_volatile = false,
// It must be pointing to a 'T'
.child = TypeMatch{ .by_type = T },
// It must not have a sentinel
// Note that if this was just 'null', meta_match would not
// check it.
.sentinel = @as(?</em>const anyopaque, null),
},
},
},
},
},
};
<code> /// The MetaMatch expression used to determine 'has_deinit'.
pub const MetaMatch = TypeMatch{
.container = &ContainerMatch{
// It must be a container with a 'deinit' declaration matching 'DeinitMatch' above
.decls = &.{DeclarationMatch{ .name = "deinit", .type = DeinitMatch }},
},
};
/// `true` if `T` has a `deinit` function.
pub const has_deinit: bool = MetaMatch.match(T);
/// Deinitialise a value.
pub inline fn deinit(value: *T) void {
if (has_deinit) {
T.deinit(value);
}
}
};
</code>
}
test {
try testing.expect(!Deinit(u8).has_deinit);
var n: u8 = 5;
// This will do nothing
Deinit(u8).deinit(&n);
<code>const S = struct {
pub fn deinit(_: *@This()) void {}
};
try testing.expect(Deinit(S).has_deinit);
var s = S{};
// This will run the deinit function
Deinit(S).deinit(&s);
</code>
}
```
In this example, if 'deinit' is called with a type that does not have a 'deinit' function, nothing happens but
you could add a compile error, or you could run a default function.
If 'deinit' is run with a type that does have a matching 'deinit' function, then the type's 'deinit' function is called. | [
"https://github.com/tomBoddaert/zig_structures"
] |
https://avatars.githubusercontent.com/u/11657140?v=4 | mnist | albert-yu/mnist | 2023-05-22T01:37:26Z | Simple Zig mnist | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/albert-yu/mnist/tags | - | [
"mnist",
"neural-network",
"zig"
] | 270 | false | 2024-06-20T03:58:35Z | true | false | unknown | github | [] | mnist
Zig implementation of a simple neural network for mnist
Getting started
First, follow the instructions at https://ziglang.org/download. I'm using version 0.13.0.
Then, download the dataset from http://yann.lecun.com/exdb/mnist/. The four files you need are:
<code>plain
train-images-idx3-ubyte: training set images
train-labels-idx1-ubyte: training set labels
t10k-images-idx3-ubyte: test set images
t10k-labels-idx1-ubyte: test set labels</code>
Without renaming the files, put them in a <code>data/</code> folder at the root of this project's directory.
<code>sh
zig build run</code>
To actually make it go fast:
<code>sh
zig build -Doptimize=ReleaseFast run</code>
On my machine, getting around 93% accuracy with 100 epochs.
To run tests:
<code>sh
zig build test</code>
Motivation
This project was a way for me to (1) learn the fundamentals of neural networks and (2) learn <a>Zig</a>.
I started with <a>Michael Nielsen's excellent introduction to neural networks</a> and the Python implementation within as a reference. But translating the Python code directly to Zig was a clumsy effort. By chance, I stumbled upon <a>this blog post implementing mnist in Zig</a>. Taking inspiration from there, I refactored my original implementation to hard-code the layers and feedforward/backprop them explicitly instead of using a loop. | [] |
https://avatars.githubusercontent.com/u/112193680?v=4 | resfs | nitrogenez/resfs | 2024-02-04T19:30:03Z | File system abstraction layer for Zig games and apps | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/nitrogenez/resfs/tags | BSD-3-Clause | [
"abstraction",
"files",
"filesystem",
"filesystem-library",
"gamedev",
"gamedev-library",
"games",
"zig",
"zig-lang",
"zig-language",
"zig-lib",
"zig-library",
"zig-package",
"ziglang"
] | 10 | false | 2024-11-16T19:33:54Z | true | true | unknown | github | [] | resfs
<strong>Res</strong>ource <strong>F</strong>ile <strong>S</strong>ystem, or ResFS is a file system abstraction layer made specifically for games and applications in Zig. It includes file type detection, resource lookup, etc.
To use it, just add it to your dependency tree in <code>build.zig.zon</code>.
TODO: Better README. | [] |
https://avatars.githubusercontent.com/u/147687?v=4 | mlge | smokku/mlge | 2023-03-07T19:15:59Z | My Little Game Engine | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/smokku/mlge/tags | - | [
"gameengine",
"javascript",
"zig"
] | 163 | false | 2023-04-06T17:05:22Z | true | false | unknown | github | [] | My Little Game Engine
Preparation
This project makes use of git submodules, so you need to <code>git clone --recursive</code>.
Building
<a><code>zig</code></a> v. 0.11 required.
<code>zig build
</code>
Running
Server
<code>zig build server
</code>
Client
<code>zig build client
</code> | [] |
https://avatars.githubusercontent.com/u/51542168?v=4 | sapper | mostik/sapper | 2023-05-06T20:37:25Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/mostik/sapper/tags | - | [
"game",
"opengl",
"zig"
] | 4 | false | 2023-05-07T18:29:41Z | true | false | unknown | github | [] |
<strong>WIP</strong>
Key <strong>r</strong> for restart
Run
<blockquote>
zig build run
</blockquote>
Requirements
<ul>
<li>Zig - 0.11.0</li>
<li>GLFW3</li>
<li>OpenGL 1.1</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | Zig-S-Records | bcrist/Zig-S-Records | 2023-10-28T04:12:02Z | Motorola S-Record library in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/bcrist/Zig-S-Records/tags | MIT | [
"encoding",
"s-record",
"srec",
"srecord",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 5 | false | 2024-07-02T18:52:28Z | true | true | 0.12.0 | github | [] | Zig-S-Records
Prints binary data into Motorola S-Record format.
TODO: S-Record parsing | [] |
https://avatars.githubusercontent.com/u/71920313?v=4 | gbm.zig | MidstallSoftware/gbm.zig | 2024-01-04T04:33:58Z | Port of GBM/GBO to Zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/MidstallSoftware/gbm.zig/tags | GPL-3.0 | [
"gbm",
"mesa",
"zig"
] | 45 | false | 2024-01-04T21:18:30Z | true | true | unknown | github | [
{
"commit": "c7461292dd9657d6b903cefe3cab8726f629fce6.tar.gz",
"name": "libdrm",
"tar_url": "https://github.com/MidstallSoftware/libdrm.zig/archive/c7461292dd9657d6b903cefe3cab8726f629fce6.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/MidstallSoftware/libdrm.zig"
}
] | gbm.zig
Port of GBM/GBO to Zig | [] |
https://avatars.githubusercontent.com/u/59521636?v=4 | loxz | calebarg/loxz | 2023-09-06T01:20:53Z | Crafting Interpreters lox implementation in zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/calebarg/loxz/tags | - | [
"craftinginterpreters",
"zig"
] | 7 | false | 2023-11-01T17:25:02Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/2700596?v=4 | ctecs | linkpy/ctecs | 2023-07-18T19:39:21Z | Mostly compile-time ECS for Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/linkpy/ctecs/tags | - | [
"ecs",
"entity-component-system",
"gamedev",
"gamedev-library",
"zig",
"ziglang"
] | 9 | false | 2023-11-01T17:12:12Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/12663605?v=4 | brainzag | vtan/brainzag | 2023-10-30T22:22:15Z | An interpreter and JIT compiler for the Brainfuck programming language, written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/vtan/brainzag/tags | - | [
"brainfuck",
"interpreter",
"jit-compiler",
"zig"
] | 38 | false | 2023-11-18T22:25:24Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | brainzag
An interpreter and JIT compiler for the Brainfuck programming language, written in Zig.
JIT compilation is implemented for the x86-64, ARM64 and 64-bit RISC-V CPU architectures.
<code>console
$ zig build run -- -o test/hello.bf # interpret with optimizations
$ zig build run -- -jo test/hello.bf # compile with optimizations</code> | [] |
https://avatars.githubusercontent.com/u/126189643?v=4 | Demineur | ThibaultPND/Demineur | 2023-11-16T21:12:03Z | Minesweeper | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ThibaultPND/Demineur/tags | - | [
"2d",
"minesweeper-game",
"zig",
"ziglang"
] | 8,220 | false | 2024-08-19T19:39:04Z | true | false | unknown | github | [] | Most of this project is the SDL2 C lib.
My major part is the zig code, my first graphic app using zig. | [] |
https://avatars.githubusercontent.com/u/88176012?v=4 | zig-toy-rendering-engine | seipan/zig-toy-rendering-engine | 2023-11-04T14:56:18Z | html Renderer written by Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/seipan/zig-toy-rendering-engine/tags | MIT | [
"html-renderer",
"zig"
] | 5 | false | 2023-11-05T16:31:54Z | true | false | unknown | github | [] | zig-toy-rendering-engine | [] |
https://avatars.githubusercontent.com/u/31827294?v=4 | xdg-terminal-nautilus | oupson/xdg-terminal-nautilus | 2023-11-21T10:20:23Z | Open terminal in current directory using xdg-terminal-open | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/oupson/xdg-terminal-nautilus/tags | MIT | [
"gnome",
"nautilus",
"zig"
] | 6 | false | 2023-11-21T12:26:11Z | true | false | unknown | github | [] | Xdg Terminal Nautilus
Open terminal in current directory using xdg-terminal-open.
License
Licensed under MIT license (<a>LICENSE</a> or http://opensource.org/licenses/MIT). | [] |
https://avatars.githubusercontent.com/u/14164311?v=4 | zps | cactusbento/zps | 2024-01-18T03:02:51Z | A simple front end for unprivileged pkgsrc installs. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/cactusbento/zps/tags | - | [
"pkgsrc",
"zig"
] | 10 | false | 2024-01-18T20:38:03Z | true | true | unknown | github | [] | zps
Just set the <code>PKGSRCLOC</code> environment variable to the <code>NetBSD/pkgsrc</code> repository on your
local drive.
```bash
There are 3 Commands:
zps search [terms...]
zps install [package names...]
zps uninstall [package names...]
```
<code>zps search</code> currently only filters the packages by checking if the package name or description
contains one of the search terms.
TODO
<ul>
<li>Implement a better way to store repository info. </li>
<li>Read/Store package versions.</li>
<li>Shell completions.</li>
<li>Add option flags.</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/5464072?v=4 | zig-bounded | nektro/zig-bounded | 2023-10-01T08:50:43Z | A runtime bounded integers library | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/nektro/zig-bounded/tags | MIT | [
"zig"
] | 14 | false | 2024-06-22T18:25:03Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/380158?v=4 | zig-gtk | frmdstryr/zig-gtk | 2023-10-16T13:02:49Z | Auto generated GTK4 Bindings for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/frmdstryr/zig-gtk/tags | - | [
"gtk4",
"zig"
] | 4,751 | true | 2025-02-07T13:41:11Z | true | false | unknown | github | [] | zig-gtk
Auto generated zig bindings for <a>GTK 4</a>.
Examples
Creating widgets
```zig
const window = gtk.ApplicationWindow.new(app).?;
window.setTitle("Console");
const header_bar = gtk.HeaderBar.new().?;
window.setTitlebar(header_bar.asWidget());
const box = gtk.Box.new(.Vertical, 10).?;
box.setMargins(.{.top=10, .bottom=10, .start=10, .end=10});
window.setChild(box.asWidget());
```
Signals
```zig
const view = gtk.ColumnView.new(null).?;
view.setModel(@ptrCast(selection));
view.setHexpand(true);
view.setVexpand(true);
if (gtk.SignalListItemFactory.new()) |f| {
_ = f.connectSetup(App, &PlacementWindow.onColSetupActive, app);
_ = f.connectBind(App, &PlacementWindow.onColBindActive, app);
view.appendColumn(
gtk.ColumnViewColumn.new("Active", f.asListItemFactory()).?
);
}
```
Structs
```zig
pub fn appendToBuffer(self: *Self, msg: []const u8) void {
if (self.text_view.getBuffer()) |text_buffer| {
var end_iter: gtk.TextIter = undefined;
text_buffer.getEndIter(&end_iter);
text_buffer.placeCursor(&end_iter);
text_buffer.insertAtCursor(msg.ptr, @intCast(msg.len));
}
}
```
Custom types
```zig
const PlacementEntryObject = gobject.registerType(PlacementEntry, "PlacementEntry");
const model = gio.ListStore.new(PlacementEntryObject.gType()).?;
if (app.document) |doc| {
for (doc.placements.items) |entry| {
const obj = PlacementEntryObject.new().?;
obj.data = entry.*; // Custom data is allocated by glib
model.append(obj.asObject());
}
}
```
Naming convention
Type names and method names of the original C library were changed to follow the <a>Zig Style Guide</a>. For example, a method like <code>gtk_grid_view_set_single_click_activate(grid_view, single_click_activate)</code> in GTK C becomes a method belonging to the <code>GridView</code> struct and can be called like <code>grid_view.setSingleClickActivate(single_click_activate)</code> in zig-gtk.
Status
Bindings are generated automatically using <code>python gen.py</code>.
You need to be on 3.10+ and install <a>PyGObject</a>
Usage
zig-gtk depends on <a>zig-wayland</a>.
See the <a>example</a> for usage. | [] |
https://avatars.githubusercontent.com/u/1671644?v=4 | advent-of-code | arrufat/advent-of-code | 2023-12-01T10:30:44Z | My attempts at Advent of Code | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/arrufat/advent-of-code/tags | Unlicense | [
"advent-of-code",
"zig",
"ziglang"
] | 65 | false | 2024-12-03T12:14:49Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/6332937?v=4 | zigStringUtil | SuSonicTH/zigStringUtil | 2023-08-04T21:56:52Z | a small library with little helpers for String handling | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/SuSonicTH/zigStringUtil/tags | MIT | [
"library",
"string",
"utility",
"zig"
] | 12 | false | 2025-04-16T23:45:49Z | true | false | unknown | github | [] | zigStringUtil
a small library with little helpers for String handling.
Builder
can be used to concatinate strings together
Joiner
simmilar to Builder used to concatenate strings but it can add a prefix, suffix and insert delimiter
zig module
To use this as a module in you project create a <code>build.zig.zon</code> file, adding zigStringUtil as dependency.
The url and hash are from the current master version, tested with zig 0.11.0
<code>zig
.{
.name = "myProject",
.version = "0.0.1",
.dependencies = .{
.zigStringUtil = .{
.url = "https://github.com/SuSonicTH/zigStringUtil/archive/66577eecdd273b626fe59b6d46b3349331fda632.tar.gz",
.hash = "1220024750ad8df560a590919c57725eda68f68f7756d443aa32a3a8be8ee21905a9",
}
}
}</code>
and in your <code>build.zig</code> add the module as dependecy
<code>zig
const zigStringUtil = b.dependency("zigStringUtil", .{
.target = target,
.optimize = optimize,
});</code>
and add it as a module to your exe/lib
```zig
//sample exe
const exe = b.addExecutable(.{
.name = "zli",
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
});
//add module
exe.addModule("zigStringUtil", zigStringUtil.module("zigStringUtil"));
``` | [] |
https://avatars.githubusercontent.com/u/5464072?v=4 | zig-errno | nektro/zig-errno | 2024-02-01T02:39:45Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/nektro/zig-errno/tags | MIT | [
"zig",
"zig-package"
] | 38 | false | 2025-05-21T20:33:14Z | true | false | unknown | github | [] | zig-errno
<a></a>
<a></a>
<a></a>
<a></a>
Convert C-style threadlocal errno to and from Zig error values.
Supports
<ul>
<li>Linux</li>
<li>macOS</li>
<li>FreeBSD</li>
<li>OpenBSD</li>
<li>NetBSD</li>
<li>Windows</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/17755880?v=4 | rtt.zig | rjsberry/rtt.zig | 2023-09-19T21:30:41Z | Target-side implementation of the Real-Time Transfer protocol in Zig. | main | 1 | 0 | 1 | 0 | https://api.github.com/repos/rjsberry/rtt.zig/tags | 0BSD | [
"debugging",
"embedded",
"logging",
"rtt",
"segger-rtt",
"zig"
] | 4 | false | 2023-11-01T17:11:48Z | true | false | unknown | github | [] | <em>rtt.zig</em>
A Real-Time Transfer (target side) implementation in Zig.
Dual licensed under the 0BSD and MIT licenses.
Usage
```zig
const rtt = @import("rtt");
export fn main(void) callconv(.C) noreturn {
rtt.println("Hello from {s}", .{"Zig!"});
while (true) {}
}
``` | [] |
https://avatars.githubusercontent.com/u/11048462?v=4 | advent-of-code-2023 | eckelon/advent-of-code-2023 | 2023-12-03T23:24:15Z | I'm trying to resolve the advent of code in the Zig programming language. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/eckelon/advent-of-code-2023/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"zig",
"ziglang"
] | 14 | false | 2023-12-03T23:25:21Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/145422627?v=4 | zocket | crispy-strawberry/zocket | 2023-09-19T05:13:55Z | Websocket implementation in zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/crispy-strawberry/zocket/tags | Apache-2.0 | [
"websocket",
"websockets",
"zig"
] | 6 | false | 2023-11-01T17:25:05Z | true | false | unknown | github | [] | zocket
Websocket implementation in zig | [] |
https://avatars.githubusercontent.com/u/60553286?v=4 | ziglings-solutions | thedevbirb/ziglings-solutions | 2023-11-25T18:28:54Z | Solutions to the exercises of ziglings.org | exercises_done | 0 | 0 | 0 | 0 | https://api.github.com/repos/thedevbirb/ziglings-solutions/tags | MIT | [
"zig",
"ziglang"
] | 262 | false | 2023-11-25T18:30:36Z | true | false | unknown | github | [] | Ziglings
⚠️ Ziglings has moved from GitHub to Codeberg!
You are looking at the current Ziglings repo if you are viewing
this at https://codeberg.org/ziglings/exercises/
You can also use the handy URL https://ziglings.org to get here!
Welcome to Ziglings! This project contains a series of tiny
broken programs (and one nasty surprise). By fixing them, you'll
learn how to read and write <a>Zig</a> code.
Those broken programs need your help! (You'll also save the
planet from evil aliens and help some friendly elephants stick
together, which is very sweet of you.)
This project was directly inspired by the brilliant and fun
<a>rustlings</a>
project for the <a>Rust</a> language.
Indirect inspiration comes from <a>Ruby Koans</a>
and the Little LISPer/Little Schemer series of books.
Intended Audience
This will probably be difficult if you've <em>never</em> programmed
before. But no specific programming experience is required. And
in particular, you are <em>not</em> expected to have any prior
experience with "systems programming" or a "systems" level
language such as C.
Each exercise is self-contained and self-explained. However,
you're encouraged to also check out these Zig language resources
for more detail:
<ul>
<li>https://ziglang.org/learn/</li>
<li>https://ziglearn.org/</li>
<li>https://ziglang.org/documentation/master/</li>
</ul>
Also, the <a>Zig community</a>
is incredibly friendly and helpful!
Getting Started
Install a <a>development build</a> of
the Zig compiler. (See the "master" section of the downloads
page.)
Verify the installation and build number of <code>zig</code> like so:
<code>$ zig version
0.12.0-dev.xxxx+xxxxxxxxx</code>
Clone this repository with Git:
<code>$ git clone https://ziglings.org
$ cd ziglings.org</code>
Then run <code>zig build</code> and follow the instructions to begin!
<code>$ zig build</code>
Note: The output of Ziglings is the unaltered output from the Zig
compiler. Part of the purpose of Ziglings is to acclimate you to
reading these.
A Note About Versions
<strong>Hint:</strong> To check out Ziglings for a stable release of Zig, you can use
the appropriate tag.
The Zig language is under very active development. In order to be
current, Ziglings tracks <strong>development</strong> builds of the Zig
compiler rather than versioned <strong>release</strong> builds. The last
stable release was <code>0.11.0</code>, but Ziglings needs a dev build with
pre-release version "0.12.0" and a build number at least as high
as that shown in the example version check above.
It is likely that you'll download a build which is <em>greater</em> than
the minimum.
Once you have a build of the Zig compiler that works with
Ziglings, they'll continue to work together. But keep in mind
that if you update one, you may need to also update the other.
Version Changes
Version-0.12.0-dev.1243
* <em>2023-10-24</em> zig 0.12.0-dev.1243 - changes in <code>std.ChildProcess</code>: renamed exec to run - see<a>#5853</a>
* <em>2023-06-26</em> zig 0.11.0-dev.4246 - changes in compile step (now it can be null)
* <em>2023-06-26</em> zig 0.11.0-dev.3853 - removal of destination type from all cast builtins
* <em>2023-06-20</em> zig 0.11.0-dev.3747 - <code>@enumToInt</code> is now <code>@intFromEnum</code> and <code>@intToFloat</code> is now <code>@floatFromInt</code>
* <em>2023-05-25</em> zig 0.11.0-dev.3295 - <code>std.debug.TTY</code> is now <code>std.io.tty</code>
* <em>2023-04-30</em> zig 0.11.0-dev.2704 - use of the new <code>std.Build.ExecutableOptions.link_libc</code> field
* <em>2023-04-12</em> zig 0.11.0-dev.2560 - changes in <code>std.Build</code> - remove run() and install()
* <em>2023-04-07</em> zig 0.11.0-dev.2401 - fixes of the new build system - see <a>#212</a>
* <em>2023-02-21</em> zig 0.11.0-dev.2157 - changes in <code>build system</code> - new: parallel processing of the build steps
* <em>2023-02-21</em> zig 0.11.0-dev.1711 - changes in <code>for loops</code> - new: Multi-Object For-Loops + Struct-of-Arrays
* <em>2023-02-12</em> zig 0.11.0-dev.1638 - changes in <code>std.Build</code> cache_root now returns a directory struct
* <em>2023-02-04</em> zig 0.11.0-dev.1568 - changes in <code>std.Build</code> (combine <code>std.build</code> and <code>std.build.Builder</code> into <code>std.Build</code>)
* <em>2023-01-14</em> zig 0.11.0-dev.1302 - changes in <code>@addWithOverflow</code> (now returns a tuple) and <code>@typeInfo</code>; temporary disabled async functionality
* <em>2022-09-09</em> zig 0.10.0-dev.3978 - change in <code>NativeTargetInfo.detect</code> in build
* <em>2022-09-06</em> zig 0.10.0-dev.3880 - Ex 074 correctly fails again: comptime array len
* <em>2022-08-29</em> zig 0.10.0-dev.3685 - <code>@typeName()</code> output change, stage1 req. for async
* <em>2022-07-31</em> zig 0.10.0-dev.3385 - std lib string <code>fmt()</code> option changes
* <em>2022-03-19</em> zig 0.10.0-dev.1427 - method for getting sentinel of type changed
* <em>2021-12-20</em> zig 0.9.0-dev.2025 - <code>c_void</code> is now <code>anyopaque</code>
* <em>2021-06-14</em> zig 0.9.0-dev.137 - std.build.Id <code>.Custom</code> is now <code>.custom</code>
* <em>2021-04-21</em> zig 0.8.0-dev.1983 - std.fmt.format() <code>any</code> format string required
* <em>2021-02-12</em> zig 0.8.0-dev.1065 - std.fmt.format() <code>s</code> (string) format string required
Advanced Usage
It can be handy to check just a single exercise:
<code>zig build -Dn=19</code>
You can also run without checking for correctness:
<code>zig build -Dn=19 test</code>
Or skip the build system entirely and interact directly with the
compiler if you're into that sort of thing:
<code>zig run exercises/001_hello.zig</code>
Calling all wizards: To prepare an executable for debugging,
install it to zig-cache/bin with:
<code>zig build -Dn=19 install</code>
To get a list of all possible options, run:
```
zig build -Dn=19 -l
install Install 019_functions2.zig to prefix path
uninstall Uninstall 019_functions2.zig from prefix path
test Run 019_functions2.zig without checking output
...
```
What's Covered
The primary goal for Ziglings is to cover the core Zig language.
It would be nice to cover the Standard Library as well, but this
is currently challenging because the stdlib is evolving even
faster than the core language (and that's saying something!).
Not only would stdlib coverage change very rapidly, some
exercises might even cease to be relevant entirely.
Having said that, there are some stdlib features that are
probably here to stay or are so important to understand that they
are worth the extra effort to keep current.
Conspicuously absent from Ziglings are a lot of string
manipulation exercises. This is because Zig itself largely avoids
dealing with strings. Hopefully there will be an obvious way to
address this in the future. The Ziglings crew loves strings!
Zig Core Language
<ul>
<li>[x] Hello world (main needs to be public)</li>
<li>[x] Importing standard library</li>
<li>[x] Assignment</li>
<li>[x] Arrays</li>
<li>[x] Strings</li>
<li>[x] If</li>
<li>[x] While</li>
<li>[x] For</li>
<li>[x] Functions</li>
<li>[x] Errors (error/try/catch/if-else-err)</li>
<li>[x] Defer (and errdefer)</li>
<li>[x] Switch</li>
<li>[x] Unreachable</li>
<li>[x] Enums</li>
<li>[x] Structs</li>
<li>[x] Pointers</li>
<li>[x] Optionals</li>
<li>[x] Struct methods</li>
<li>[x] Slices</li>
<li>[x] Many-item pointers</li>
<li>[x] Unions</li>
<li>[x] Numeric types (integers, floats)</li>
<li>[x] Labelled blocks and loops</li>
<li>[x] Loops as expressions</li>
<li>[x] Builtins</li>
<li>[x] Inline loops</li>
<li>[x] Comptime</li>
<li>[x] Sentinel termination</li>
<li>[x] Quoted identifiers @""</li>
<li>[x] Anonymous structs/tuples/lists</li>
<li>[ ] Async <--- ironically awaiting upstream Zig updates</li>
<li>[X] Interfaces</li>
<li>[X] Bit manipulation</li>
<li>[X] Working with C</li>
<li>[ ] Interfaces part 2</li>
</ul>
Zig Standard Library
<ul>
<li>[X] String formatting</li>
<li>[X] Testing</li>
<li>[X] Tokenization</li>
</ul>
Contributing
Contributions are very welcome! I'm writing this to teach myself
and to create the learning resource I wished for. There will be
tons of room for improvement:
<ul>
<li>Wording of explanations</li>
<li>Idiomatic usage of Zig</li>
<li>Additional exercises</li>
</ul>
Please see <a>CONTRIBUTING</a>
in this repo for the full details. | [] |
https://avatars.githubusercontent.com/u/3594035?v=4 | zcloc | tsunaminoai/zcloc | 2024-01-16T20:39:01Z | An exercise in code-knitting to replace cloc.pl with zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tsunaminoai/zcloc/tags | - | [
"cloc",
"zig",
"ziglang"
] | 11 | false | 2024-01-18T21:35:55Z | true | true | unknown | github | [
{
"commit": "9c23bcb5aebe0c2542b4de4472f60959974e2222.tar.gz",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/9c23bcb5aebe0c2542b4de4472f60959974e2222.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
}
] | zcloc
An exercise in code-kitting to replace <a>cloc.pl</a> with zig.
Installation
Using zig master.
<code>bash
zig build -Doptimize=ReleaseFast run -- .</code>
Usage
<blockquote>
-h, --help
Display this help and exit.
-x, --exclude PATH
Exclude directories from search
</blockquote>
Timing
```sh
❱ time zig-out/bin/zcloc .
Getting list of files
Files to consider: 9
Ignored files: 141
Language Files Blank Comment Code
Perl 1 701 1351 12403
zig 6 42 67 315
Python 1 133 74 472
Sum 8 876 1492 13190
Executed in 286.92 millis fish external
usr time 65.06 millis 51.00 micros 65.01 millis
sys time 250.62 millis 707.00 micros 249.91 millis
```
For reference:
```sh
❱ time cloc .
76 text files.
36 unique files.
159 files ignored.
github.com/AlDanial/cloc v 1.98 T=1.15 s (31.2 files/s, 31616.3 lines/s)
Language files blank comment code
JavaScript 15 990 1027 15654
Perl 1 701 1357 12397
HTML 6 129 0 2396
Text 7 0 0 515
Zig 6 67 58 486
Python 1 133 272 274
SUM: 36 2020 2714 31722
Executed in 1.57 secs fish external
usr time 1.15 secs 66.00 micros 1.15 secs
sys time 0.12 secs 871.00 micros 0.12 secs
``` | [] |
https://avatars.githubusercontent.com/u/20625305?v=4 | capstone | axojhf/capstone | 2023-05-26T12:27:24Z | Using Zig to compile Capstone | zig | 0 | 0 | 0 | 0 | https://api.github.com/repos/axojhf/capstone/tags | NOASSERTION | [
"zig"
] | 45,357 | true | 2023-05-27T11:28:04Z | true | false | unknown | github | [] | Capstone Engine
<a></a>
<a></a>
<a></a>
<a></a>
Capstone is a disassembly framework with the target of becoming the ultimate
disasm engine for binary analysis and reversing in the security community.
Created by Nguyen Anh Quynh, then developed and maintained by a small community,
Capstone offers some unparalleled features:
<ul>
<li>
Support multiple hardware architectures: ARM, ARM64 (ARMv8), BPF, Ethereum VM,
M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ,
TMS320C64X, TriCore, Webassembly, XCore and X86 (16, 32, 64).
</li>
<li>
Having clean/simple/lightweight/intuitive architecture-neutral API.
</li>
<li>
Provide details on disassembled instruction (called “decomposer” by others).
</li>
<li>
Provide semantics of the disassembled instruction, such as list of implicit
registers read & written.
</li>
<li>
Implemented in pure C language, with lightweight bindings for Swift, D, Clojure, F#,
Common Lisp, Visual Basic, PHP, PowerShell, Emacs, Haskell, Perl, Python,
Ruby, C#, NodeJS, Java, GO, C++, OCaml, Lua, Rust, Delphi, Free Pascal & Vala
ready either in main code, or provided externally by the community).
</li>
<li>
Native support for all popular platforms: Windows, Mac OSX, iOS, Android,
Linux, *BSD, Solaris, etc.
</li>
<li>
Thread-safe by design.
</li>
<li>
Special support for embedding into firmware or OS kernel.
</li>
<li>
High performance & suitable for malware analysis (capable of handling various
X86 malware tricks).
</li>
<li>
Distributed under the open source BSD license.
</li>
</ul>
Further information is available at https://www.capstone-engine.org
Compile
See COMPILE.TXT file for how to compile and install Capstone.
Documentation
See docs/README for how to customize & program your own tools with Capstone.
Hack
See HACK.TXT file for the structure of the source code.
Fuzz
See suite/fuzz/README.md for more information.
License
This project is released under the BSD license. If you redistribute the binary
or source code of Capstone, please attach file LICENSE.TXT with your products. | [
"https://github.com/jhark/dizazm"
] |
https://avatars.githubusercontent.com/u/70723965?v=4 | zig_minion | tomBoddaert/zig_minion | 2023-08-08T17:33:46Z | A Little Minion Computer implementation in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tomBoddaert/zig_minion/tags | - | [
"zig"
] | 5,491 | false | 2023-08-08T17:47:22Z | true | false | unknown | github | [] | zig_minion
This is a zig implementation of my variant of the Little Minion Computer.
The <a>Little Minion Computer</a> model was created by <a>Professor Magnus Bordewich</a> of <a>Durham University</a>, based on the <a>Little Man Computer</a> created by <a>Dr. Stuart Madnick</a> of <a>M.I.T.</a> in 1965.
For a more featureful and better written implementation, see my <a>LMinC</a> project, which is written in Rust.
Examples
There are examples in the <a>examples directory</a>;
License
<a>zig_minion</a> is dual-licensed under either the Apache License Version 2.0 OR MIT license at your option. | [] |
https://avatars.githubusercontent.com/u/19322406?v=4 | AoC-2023 | edmBernard/AoC-2023 | 2023-11-24T19:48:16Z | My Code for Advent of Code 2023 | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/edmBernard/AoC-2023/tags | Apache-2.0 | [
"advent-of-code",
"zig"
] | 119 | false | 2024-10-25T10:23:57Z | true | false | unknown | github | [] | AoC-2023
My solutions to <a>Advent of Code 2023</a>. This year, I'm going to try doing the challenges mainly in <a>Zig</a> and <a>Rust</a>
<ul>
<li>Github : <a>https://github.com/edmBernard/AoC-2023</a></li>
</ul>
Getting Started
<code>bash
git clone git@github.com:edmBernard/AoC-2023.git
cd AoC-2023
zig build -Drelease
cargo build --release</code>
Run
<code>bash
./zig-out/bin/day01 data/day01.txt
./target/release/day01 data/day01.txt</code>
Problem
| Day | Solution | Description | Tips |
|-- |-- |-- |-- |
| Day01 <a>puzzle</a> | <a>Zig</a> <a>Rust</a> <a>C++</a> | Find digit and literal digit | Store only useful digits, do the search in both direction, digit name can overlap |
| Day02 <a>puzzle</a> | <a>Zig</a> | Find number of colored cube | |
| Day03 <a>puzzle</a> | <a>Zig</a> | Find engine part and gear | nothing just hard |
| Day04 <a>puzzle</a> | <a>Zig</a> | Scratch card | |
| Day05 <a>puzzle</a> | <a>Zig</a> | Seeds planting | directly work on range |
| Day06 <a>puzzle</a> | <a>Zig</a> | Boat race | |
| Day07 <a>puzzle</a> | <a>Zig</a> | Poker | |
| Day08 <a>puzzle</a> | <a>Zig</a> | Graph | inputs are particular enough to use LCM |
| Day09 <a>puzzle</a> | <a>Zig</a> | time serie prediction | |
| Day11 <a>puzzle</a> | <a>Zig</a> | Galaxy and universe expansion | work directly on galaxy coordinate |
| Day12 <a>puzzle</a> | <a>Zig</a> | Count pattern matching | recursive and memoization |
Some Timing :
```
In Zig
Zig day01 in 64.88 us : part1=54304 part2=54418
Zig day02 in 44.50 us : part1=2348 part2=76008
Zig day03 in 117.06 us : part1=527364 part2=79026871
Zig day04 in 82.68 us : part1=21558 part2=10425665
Zig day05 in 50.07 us : part1=600279879 part2=20191102
Zig day06 in 8.45 us : part1=114400 part2=21039729
Zig day07 in 1964.08 us : part1=250946742 part2=251824095
Zig day08 in 3258.56 us : part1=22357 part2=10371555451871
Zig day09 in 106.85 us : part1=1731106378 part2=1087
...
Zig day11 in 148.00 us : part1=9599070 part2=842645913794
Zig day12 in 5256.85 us : part1=6949 part2=51456609952403
Zig day13 in 9522.00 us : part1=33728 part2=0
In Rust
Rust day01 in 66.89 us : part1=54304 part2=54418
In C++
C++ day01 in 49.191 us : part1=54304 part2=54418
```
Versions
<ul>
<li>Zig : 0.13.0</li>
<li>Rust : rustc 1.76.0</li>
<li>C++ : clang 15.0.0</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/2477952?v=4 | adventofcode-2023-zig | applejag/adventofcode-2023-zig | 2023-11-30T15:20:47Z | My attempt at Advent of Code 2023 using Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/applejag/adventofcode-2023-zig/tags | BSD-3-Clause | [
"advent-of-code",
"advent-of-code-2023",
"advent-of-code-zig",
"zig",
"ziglang"
] | 122 | false | 2025-03-17T23:24:52Z | true | true | 0.12.0-dev.1767 | github | [] |
Advent of Code 2022 via Zig
<a></a>
This repo contains my attempt at Advent of Code 2023
(<a>https://adventofcode.com/2023</a>).
Running
Requires Zig v0.12.0-dev.1769, 2023-12-01 (or later): <a>https://ziglang.org/download/</a>
```console
$ zig build run
info: Usage: adventofcode-2023-zig [flags]
Flags:
-d, --day=int Advent calendar day. Number between 1 and 5
-p, --part=int Part of day, 1 or 2 (default 1)
```
<code>console
$ zig build run -- --day 1
info: Running day 01 part 1
info: Sum = 54990</code>
The code to run the different days are a bit overkill, but I wanted to try
how far I could get with Zig's type system.
On the plus side, very far! On the down side, the LSP starts failing to
understand quite quickly once you do some inline switches and comptime.
License
This repository is licensed under multiple licenses, following the
<a>REUSE</a> specification (version 3.0).
<ul>
<li>All Zig files uses BSD-3-Clause</li>
<li>Some documentation uses CC-BY-4.0</li>
<li>Other miscellaneous files uses CC0-1.0</li>
</ul>
See the file header or accompanying <code>.license</code> file on a per-file basis
for a more exact answer. | [] |
https://avatars.githubusercontent.com/u/156190012?v=4 | jmp | Drust0/jmp | 2024-01-28T17:38:39Z | utility to jump arround filesystem | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/Drust0/jmp/tags | MIT | [
"command-line",
"command-line-tool",
"zig"
] | 20 | false | 2024-01-29T20:18:24Z | true | true | 0.12.0-dev.2705 | github | [
{
"commit": "9c23bcb5aebe0c2542b4de4472f60959974e2222",
"name": "clap",
"tar_url": "https://github.com/Hejsil/zig-clap/archive/9c23bcb5aebe0c2542b4de4472f60959974e2222.tar.gz",
"type": "remote",
"url": "https://github.com/Hejsil/zig-clap"
},
{
"commit": "2aa7f2e9855d45b20072e15107fb379b9... | jmp
I was tired of <code>cd</code>'ing arround my filesystem. I could've just defined
some shell aliases on my <code>.shellprofile</code> but they are awkward to mantain.
As such I made a simple utility that allows one to move to recorded directories.
Usage
<code>jmp</code> keeps a list of files on a <code>jumptable</code>, when you run:
<code>jmp somefile</code>
It will fuzzily search for a file on that table by comparing the <code>somefile</code>
string to the <strong>basename</strong> of the file. The comparison algorithm is such
that you probabily only need to type <code>som</code> and it will match.
You can quickly add any path to your <code>jumptable</code> by running:
<code>jmp -a path/to/your/directory/here</code>
You can remove a path from the table with:
<code>jmp -d path/to/remove</code>
You can query the location of the table with:
<code>jmp -T</code>
On Linux the <code>jumptable</code> will be looked up on one of the following places:
<code>$XDG_DATA_HOME/jumptable
$XDG_CONFIG_HOME/jumptable
$HOME/.jumptable</code>
For other operating systems it depends on
<a>this library</a>.
In any case, you can always override the default path with:
<code>jmp -t /path/to/table</code>
And thats it.
How it works
The distance between two strings is the cheapest path, by deleting
and inserting characters where, deleting a character at
position <code>k</code> costs <code>1/k</code>. <em>Insertions cost the same as if you deleted
the character you just inserted.</em> This algorithm favors matching
prefixes of a string, the distance between <code>ta</code> and <code>table</code>
is just <code>0.78</code>, but between <code>ble</code> and <code>table</code> it is <code>1.50</code> despite
having a greater number of character matches.
If you want to test the comparison algorithm you can run
<code>jmp -c string1 string2</code>
Aditionally you can see how your pattern measures against your table by running
<code>jmp -C patternhere</code>
Note
<code>jmp</code> jumps into the directory by <code>execve()</code>'ing your <code>$SHELL</code> in that directory.
However the previous shell process will still be running, waiting for the new shell to exit.
This means that once you <code>jmp</code> you can <code>exit</code> to return to where you started. You
can query how deeply you have jumped with the <code>JUMP_DEPTH</code> environmental variable. | [] |
https://avatars.githubusercontent.com/u/5484864?v=4 | aoc23 | TM90/aoc23 | 2023-12-01T20:39:05Z | Advent of Code in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/TM90/aoc23/tags | MIT | [
"advent-of-code",
"advent-of-code-2023",
"zig"
] | 60 | false | 2023-12-02T11:48:15Z | false | false | unknown | github | [] | aoc23
Advent of Code in Zig
Uses Zig 0.12.0-dev.1536+6b9f7e26c | [] |
https://avatars.githubusercontent.com/u/499599?v=4 | translate_c_extract | liyu1981/translate_c_extract | 2024-01-24T05:33:15Z | a simple tool to clean zig translate-c result with annotation. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/liyu1981/translate_c_extract/tags | - | [
"zig",
"zig-package"
] | 5 | false | 2024-03-23T03:27:35Z | true | true | unknown | github | [
{
"commit": "refs",
"name": "jstring",
"tar_url": "https://github.com/liyu1981/jstring.zig/archive/refs.tar.gz",
"type": "remote",
"url": "https://github.com/liyu1981/jstring.zig"
},
{
"commit": "refs",
"name": "zcmd",
"tar_url": "https://github.com/liyu1981/zcmd.zig/archive/refs... | translate-c-extract
a simple tool to clean <code>zig translate-c</code> result with annotation.
see it by example
example <code>hello.h</code>
```c
ifndef <strong>HELLO_H</strong>
define <strong>HELLO_H</strong>
include
include
// translate-c provide-begin: /#define\s(?\S+)\s.+/
define CONST_A 'a'
define CONST_ONE 1
// translate-c provide-end: /#define\s(?\S+)\s.+/
// translate-c provide: RegexMatchResult
typedef struct {
size_t start;
size_t len;
} Loc;
// translate-c provide: get_last_error_message
void get_last_error_message(Loc<em> loc);
// translate-c provide: my_create_a_hello_string
int my_create_a_hello_string(char</em>* buf);
endif
```
if <code>zig build run -- tests/hello.h</code>, will produce
<code>``zig
// generated by:</code> zig-cache/o/b211bd45d7e3d2d5cee3d2849990c1b8/translate_c_extract tests/hello.h `
// timestamp: 1706073955549678
pub extern fn get_last_error_message(loc: [*c]Loc) void;
pub extern fn my_create_a_hello_string(buf: [<em>c][</em>c]u8) c_int;
pub const CONST_A = 'a';
pub const CONST_ONE = @as(c_int, 1);
```
annotation syntax
if use "// translate-c provide: ", the then will be looked up in <code>zig translate-c</code> result for filtering.
if use <code>// translate-c provide-begin:</code>, then follow a <code>PCRE2</code> regex, and must with a name group called <code>tk</code>. the matched names will be searched in <code>zig translate-c</code> result for filtering. The <code>// translate-c provide-end</code> part must match previous regex.
and
MIT License :) | [] |
https://avatars.githubusercontent.com/u/71920313?v=4 | vizops | MidstallSoftware/vizops | 2023-10-24T23:38:29Z | Vizops is a Zig library for performing various mathematical operations for graphics | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/MidstallSoftware/vizops/tags | GPL-3.0 | [
"glm",
"vector",
"zig"
] | 185 | false | 2024-05-29T09:08:07Z | true | true | unknown | github | [
{
"commit": "9f8c3828e3c4445b80185dd24eeb61d0386b23dc.tar.gz",
"name": "metaplus",
"tar_url": "https://github.com/MidstallSoftware/meta-plus/archive/9f8c3828e3c4445b80185dd24eeb61d0386b23dc.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/MidstallSoftware/meta-plus"
}
] | Vizops
Introduction
Vizops is a Zig library for performing various mathematical operations for graphics.
Features
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Vector types
<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> Matrix types
<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> Quaternion types
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Box constraint types | [] |
https://avatars.githubusercontent.com/u/18192844?v=4 | advent-of-code-2023 | Darkness4/advent-of-code-2023 | 2023-12-02T15:39:53Z | Advent of code 2023 in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Darkness4/advent-of-code-2023/tags | - | [
"advent-of-code",
"advent-of-code-2023",
"zig"
] | 115 | false | 2024-11-25T11:57:55Z | true | false | unknown | github | [] | Advent of code in Zig
Run
```shell
zig build
zig build day1
```
Compatibility
Tested on <code>0.14.0-dev.1632+d83a3f174</code>. | [] |
https://avatars.githubusercontent.com/u/99132213?v=4 | projavu | DISTREAT/projavu | 2023-08-03T14:34:16Z | A program for on-disk storing and managing of project ideas. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/DISTREAT/projavu/tags | LGPL-3.0 | [
"idea-management-tool",
"project-management",
"zig",
"zig-lib",
"zig-library",
"zig-package"
] | 4,322 | false | 2023-08-20T04:11:41Z | true | false | unknown | github | [] | projavu
A program for on-disk storing and managing of project ideas.
<em>Build using zig version: <code>0.10.1</code></em>
Features
<ul>
<li>Display ideas similar to <a>taskwarrior</a></li>
<li>Filter ideas to only show relevant entries</li>
<li>Categorize projects based on development progress</li>
<li>Assign tags to projects</li>
<li>Editor-focused workflow</li>
</ul>
Backend
<ul>
<li>All noted ideas are stored on-disk via a hash-calculated path</li>
<li>A CSV table is used to reference ideas, store tags, and progress</li>
<li>On-disk content is only deleted when not referenced anymore and the garbage collector is manually run</li>
<li>The underlying library is undergoing decent integration-testing.</li>
</ul>
Binaries
Binaries and checksums are provided with every release.
<a>Releases</a>
Documentation
This repository contains both a CLI and library interface.
The documentation for the library is created in the directory <code>docs/</code> when running <code>zig build</code>.
<a>Documentation</a> | [] |
https://avatars.githubusercontent.com/u/62891481?v=4 | compressor-zig | ishan-karmakar/compressor-zig | 2023-02-12T10:21:47Z | A compressor/decompressor using Huffman coding | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/ishan-karmakar/compressor-zig/tags | MIT | [
"compressor",
"zig"
] | 46 | false | 2024-03-01T04:20:56Z | true | false | unknown | github | [] | A Compressor in C++
A compressor/decompressor using Huffman coding
How It Works
The compressor follows the following steps:
- Read the input file(s)
- Generate frequencies of each character
- Generate a <a>huffman tree</a> from the frequencies
- Write huffman tree to output file
- Read input file(s) again
- Get corresponding bits from huffman tree
- Write bits to output file
The decompressor works in a similar way:
- Read input file (compressed)
- Read <a>huffman tree</a> from input file
- Read bits from input file
- Get corresponding character from huffman tree
- Write character to output file
Build
Building is extremely easy with Zig.
<code>bash
$ zig build -Doptimize=ReleaseSafe</code>
How to Use
Compressing a Directory
Say you have a directory structure like this:
<code>bash
├── directory_to_compress
│ ├── file1.txt
│ ├── file2.txt
│ ├── file3.txt</code>
Compress the directory like this:
<code>bash
./compressor directory_to_compress/ # Creates a file called directory_to_compress.cmp
./decompressor directory_to_compress.cmp # Recreates the directory_to_compress directory</code> | [] |
https://avatars.githubusercontent.com/u/60897190?v=4 | timestamp | Remy2701/timestamp | 2023-06-16T09:42:27Z | Zig time & date library based on the C `time.h`. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/Remy2701/timestamp/tags | - | [
"datetime",
"zig"
] | 7 | false | 2023-06-16T09:45:49Z | true | false | unknown | github | [] | Timestamp
This library is a date & time library based on the C <code>time.h</code>.\
Keep in mind that this library links with LibC!
Installation
Clone this repository in your libs folder.
<code>sh
git clone https://github.com/Remy2701/timestamp</code>
Then add the following line in the <code>build.zig</code>:
```zig
const timestamp = @import("libs/timestamp/build.zig");
pub fn build(b: *Build) !void {
...
exe.addModule("timestamp", timestamp.module(b));
try timestamp.link(exe);
}
```
Usage
```zig
const std = @import("std");
const timestamp = @import("timestamp");
const Timestamp = timestamp.Timestamp;
pub fn main() void {
// Get the current UTC time & date
const utc_now = Timestamp.now_utc();
std.debug.print("{}/{}/{} {}:{}:{}\n", .{
utc_now.date.month_day,
@enumToInt(utc_now.date.month),
utc_now.date.year,
<code> utc_now.time.hour,
utc_now.time.minute,
utc_now.time.second
});
// Get the current local time & date
const local_now = Timestamp.now_local();
std.debug.print("{}/{}/{} {}:{}:{}\n", .{
local_now.date.month_day,
@enumToInt(local_now.date.month),
local_now.date.year,
local_now.time.hour,
local_now.time.minute,
local_now.time.second
});
</code>
}
``` | [] |
https://avatars.githubusercontent.com/u/252122?v=4 | zig-install-action | shavit/zig-install-action | 2023-05-14T12:41:28Z | Action to download and use Zig | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/shavit/zig-install-action/tags | - | [
"github-actions",
"zig"
] | 96 | false | 2025-04-20T13:23:55Z | false | false | unknown | github | [] | Zig Install
<blockquote>
Use Zig in GitHub Actions.
</blockquote>
Examples
<ol>
<li>Compile and test a project</li>
</ol>
```
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: shavit/zig-install-action@v0.1.0
- name: Run tests
run: |
zig build test
```
<ol>
<li>Install a specific build
<code>$ . install.sh master x86_64-linux</code></li>
</ol>
```
Usage: install.sh [version] [flavour]
Version:
master
0.9.1
0.9.0
0.8.1
0.8.0
0.7.1
0.7.0
0.6.0
0.5.0
0.4.0
0.3.0
0.2.0
0.10.1
0.10.0
0.1.1
Flavour:
x86_64-macos
aarch64-macos
x86_64-linux
aarch64-linux
riscv64-linux
powerpc64le-linux
powerpc-linux
x86-linux
x86_64-windows
aarch64-windows
x86-windows
``` | [] |
https://avatars.githubusercontent.com/u/6756180?v=4 | ziglibc | kassane/ziglibc | 2023-07-10T12:37:00Z | LibC written on Zig | v0.12.0 | 0 | 0 | 0 | 0 | https://api.github.com/repos/kassane/ziglibc/tags | - | [
"libc",
"zig"
] | 171 | true | 2023-08-19T17:54:58Z | true | false | unknown | github | [] | ziglibc
An exploration on creating a libc implementation in Zig.
"libc" includes implementations for the C Standard and the Posix Standard.
How to Use
This is a little ugly and should change but I'm documenting it here for the adventurous.
You can use ziglibc by running <code>zig build</code> on this repository. Then add these arguments
to your <code>zig cc</code> command line:
<code>zig cc \
-nostdlib \
-I PATH_TO_ZIGLIBC_SRC/inc/libc \
-I PATH_TO_ZIGLIBC_SRC/inc/posix \
-I PATH_TO_ZIGLIBC_SRC/inc/linux \
-L PATH_TO_ZIGLIBC_INSTALL/lib \
-lstart \
-lc</code>
Currently builds with zig version <code>0.12.0-dev.1845+21ae64852</code>.
Thoughts
I'd like a common codebase that can create libc headers that emulate various libc implementations.
For this I'd like to create a database for the libc API that includes information about features,
versions, behavior changes, etc. From this database, headers can be generated for any combination
of parameters based on the database.
I'd also like to support static and dynamic linking. Static linking means providing a full
implementation for all of libc and dynamic means emulating whatever libc target the project needs.
Test Projects
The following is a list of C projects that I could use to test ziglibc with:
<ul>
<li>libc-test: https://wiki.musl-libc.org/libc-test.html (use to test our libc)</li>
<li>Lua</li>
<li>sqlite</li>
<li>zlib</li>
<li>Make/Autotools</li>
<li>BASH</li>
<li>SDL</li>
<li>GTK</li>
<li>raylib</li>
<li>my morec project, tools directory</li>
<li>c4</li>
<li>busybox/sed</li>
<li>m4 preprocessor</li>
<li>ncurses</li>
<li>games in ncurses?</li>
<li>https://github.com/superjer/tinyc.games</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/65970513?v=4 | raytracing | earthtraveller1/raytracing | 2023-12-23T22:08:06Z | Me following the Ray Tracing in a Weekend tutorial in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/earthtraveller1/raytracing/tags | GPL-3.0 | [
"raylib",
"raytracing",
"raytracing-in-one-weekend",
"zig"
] | 24 | false | 2023-12-23T22:09:37Z | true | false | unknown | github | [] | Ray Tracing
Me following the Ray Tracing in a Weekend tutorial in Zig.
Quick Start
Here's a basic way to get started. It currently targets the latest stable release of Zig (0.11.0).
<code>bash
git submodule update --init
cd raylib
mkdir build
cd build
cmake .. -D CMAKE_BUILD_TYPE=Release
cmake --build .
cd ../..
zig build -Doptimize=ReleaseFast run</code> | [] |
https://avatars.githubusercontent.com/u/17755880?v=4 | cortex_m.zig | rjsberry/cortex_m.zig | 2023-10-08T17:50:07Z | Startup code and low level abstraction layer in Zig for Cortex-M based microcontrollers. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/rjsberry/cortex_m.zig/tags | 0BSD | [
"arm",
"cortex-m",
"embedded",
"firmware",
"runtime",
"startup",
"zig"
] | 12 | false | 2023-11-01T17:10:49Z | true | false | unknown | github | [] | <em>cortex_m.zig</em>
Startup code and low level abstraction layer for Cortex-M microcontrollers.
Dual licensed under the 0BSD and MIT licenses. | [] |
https://avatars.githubusercontent.com/u/8464038?v=4 | zig-vb6_x86 | ezekielbaniaga/zig-vb6_x86 | 2023-09-23T12:40:30Z | Discover the compatibility of Zig and VB6 in this interoperability test. This project serves as a proof of concept, demonstrating how these technologies can work together effectively. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/ezekielbaniaga/zig-vb6_x86/tags | NOASSERTION | [
"dll",
"vb6",
"zig",
"ziglang"
] | 549 | false | 2023-11-01T17:24:56Z | false | false | unknown | github | [] |
Proof of Concept: Testing Interoperability Between <a>Zig</a> and <a>VB6</a>
Discover the compatibility of Zig and VB6 in this interoperability test. This project serves as a proof of concept, demonstrating how these technologies can work together effectively.
Code Features
This code demonstrates several important concepts, including the implementation of callback functions, the seamless exchange of String or u8 slices between Zig and VB6, the passing of integers (i32) in both directions, and the utilization of the CopyMemory API from the kernel32 library.
Note
To run this code successfully, it's essential to create an executable from it. Simply running it inside VB6 IDE won't suffice. An error "Bad DLL calling convention" might occur when running inside VB6 IDE.
If you come across a solution to the 'Bad DLL calling convention' error, please don't hesitate to reach out and share your findings. Your insights and expertise could greatly benefit our community, and we appreciate your willingness to contribute to the resolution of this issue.
DLL Output Using Zig
<b>Default Target:</b> This project is configured with Windows X86 and the MSVC ABI as the default target for the `zig build` command. If your project is intended for this target, you can simply use:
```
zig build
```
Zig will automatically build your project for Windows X86 with the MSVC ABI when you run the command without specifying a target.
Check build.zig for more info.
VB6 Note:
Installing Visual Basic 6 (VB6) on modern operating systems can be a bit challenging due to compatibility issues. However, there are several helpful tutorials available on the internet that guide you through the installation process and offer workarounds to make VB6 run smoothly on the latest platforms.
| [] |
https://avatars.githubusercontent.com/u/17755880?v=4 | xtest.zig | rjsberry/xtest.zig | 2023-10-04T20:56:59Z | Run Zig tests on your microcontroller. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/rjsberry/xtest.zig/tags | 0BSD | [
"debugging",
"embedded",
"framework",
"microcontrollers",
"testing",
"tools",
"zig"
] | 455 | false | 2023-11-01T17:11:47Z | true | true | unknown | github | [
{
"commit": "d62df600900ec0e5a2856c43ea61d11c230567b5.tar.gz",
"name": "rtt",
"tar_url": "https://github.com/rjsberry/rtt.zig/archive/d62df600900ec0e5a2856c43ea61d11c230567b5.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/rjsberry/rtt.zig"
}
] | <em>xtest.zig</em>
An on-target testing framework for microcontrollers.
Dual licensed under the 0BSD and MIT licenses.
In Action
<code>xtest</code> is designed to be used with [<code>xrun</code>] to make it easy for you to run
your firmware tests. Use these two tools together to flash firmware onto your
microcontroller and monitor test progress directly from your <code>build.zig</code> with
a single command:
If a tests fails the backtrace will be reported:
| [] |
https://avatars.githubusercontent.com/u/20910059?v=4 | zig_regex | AS400JPLPC/zig_regex | 2023-07-10T09:43:56Z | PCRE2-POSIX REGEX-ZIG | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/AS400JPLPC/zig_regex/tags | - | [
"pcre-regex",
"posix",
"regex-match",
"zig"
] | 5,848 | false | 2025-03-12T02:24:12Z | false | false | unknown | github | [] | ZIG_REGEX
PCRE2-POSIX
Using "regex" from the new PCRE2-Posix standard
https://github.com/mnemnion/mvzr new regex form ZIG
example:
Pay attention to the flag that is incumbent on you.
/i ignore case
/g global
/m multiline
```
const std = @import("std");
// tools regex
const reg = @import("match");
const allocatorPrint = std.heap.page_allocator;
pub fn main() !void {
const stdin = std.io.getStdIn().reader();
var buf : [3]u8 = undefined;
buf = [_]u8{0} ** 3;
std.debug.print("Macth abc {} \r\n",.{reg.isMatch("p1","^[A-Z]{1,1}[a-zA-Z0-9]{0,}$/g")}) ;
std.debug.print("Macth abc {} \r\n",.{reg.isMatch("p1","^[a-zA-Z]{1,1}[a-zA-Z0-9]{0,}$")}) ;
std.debug.print("Macth digit {} \r\n",.{reg.isMatch(
"423",
"^[1-9]{1,1}?[0-9]{0,}$")}) ;
std.debug.print("Macth tel fr{} \r\n",.{reg.isMatch(
"+(33)6.12.34.56.78",
"^[+]{1,1}[(]{0,1}[0-9]{1,3}<a>)</a>{1,1}([-. ]?[0-9]{2,3}){2,4}$")}) ;
std.debug.print("Macth tel us{} \r\n",.{reg.isMatch(
"+(001)456.123.789",
"^[+]{1,1}<a>(</a><a>)</a>{2,4}$")}) ;
std.debug.print("Macth date fr{} \r\n",.{reg.isMatch(
"12/10/1951",
"^(0[1-9]|[12][0-9]|3[01])<a>\/</a>[\/][0-9]{4,4}$")});
std.debug.print("Macth date us{} \r\n",.{reg.isMatch(
"10/12/1951",
"^(0[1-9]|1[012])<a>\/</a>[\/][0-9]{4,4}$")});
std.debug.print("Macth date iso{} \r\n",.{reg.isMatch(
"2003-02-25",
"^([0-9]{4,4})<a>-</a><a>-</a>$")});
// https://stackoverflow.com/questions/201323/how-can-i-validate-an-email-address-using-a-regular-expression
// chapitre RFC 6532 updates 5322 to allow and include full, clean UTF-8.
std.debug.print("Macth Mail{} \r\n",.{reg.isMatch(
"myname.myfirstname@gmail.com",
"^([-!#-\'<em>+\/-9=?A-Z^-~]{1,64}(\.[-!#-\'</em>+\/-9=?A-Z^-~]{1,64})*|\"([]!#-[^-~ \t]|(\[\t -~]))+\")@<a>0-9A-Za-z</a>?(\.<a>0-9A-Za-z</a>?)+$")});
//oreilly
std.debug.print("Macth Mail{} \r\n",.{reg.isMatch(
"myname.myfirstname@gmail.com",
"^[A-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[A-Z0-9.-]+$")});
var width :usize = 5;
// unsigned digit
std.debug.print("Macth digit unsigned{} \r\n",.{reg.isMatch(
"123",
std.fmt.allocPrint(allocatorPrint,"^[0-9]{s}{d}{s}$",.{"{1,",width,"}"},) catch unreachable)});
// unsigned digit
std.debug.print("Macth digit {} \r\n",.{reg.isMatch(
"+12345",
std.fmt.allocPrint(allocatorPrint,"^[+-][0-9]{s}{d}{s}$",.{"{1,",width,"}"},) catch unreachable)});
// decimal unsigned scal = 0
std.debug.print("Macth decimal unsigned scal = 0 {} \r\n",.{reg.isMatch(
"12345",
std.fmt.allocPrint(allocatorPrint,"^[0-9]{s}1,{d}{s}$",.{"{",width,"}"},) catch unreachable)});
var scal :usize = 2;
// decimal unsigned scal > 0
std.debug.print("Macth decimal unsigned scal > 0 {} \r\n",.{reg.isMatch(
"12345.02",
std.fmt.allocPrint(allocatorPrint,
"^[0-9]{s}1,{d}{s}[.][0-9]{s}{d}{s}$",.{"{",width,"}","{",scal,"}"}
) catch unreachable)});
_= try stdin.readUntilDelimiterOrEof(buf[0..], '\n');
// decimal signed scal = 0
std.debug.print("Macth decimal signed scal = 0 {} \r\n",.{reg.isMatch(
"+12345",
std.fmt.allocPrint(allocatorPrint,"^[+-][0-9]{s}1,{d}{s}$",.{"{",width,"}"},) catch unreachable)});
// decimal unsigned scal > 0
std.debug.print("Macth decimal signed scal > 0 {} \r\n",.{reg.isMatch(
"+12345.02",
std.fmt.allocPrint(allocatorPrint,
"^[+-][0-9]{s}1,{d}{s}[.][0-9]{s}{d}{s}$",.{"{",width,"}","{",scal,"}"}
) catch unreachable)});
var i: usize = 0 ;
while(i < 5000) : ( i += 1 ) {
_=reg.isMatch(
"1951-10-12",
"^([0-9]{4,4})<a>-</a><a>-</a>$");
}
buf = [<em>]u8{0} ** 3;
</em>= try stdin.readUntilDelimiterOrEof(buf[0..], '\n');
}
```
<ul>
<li>
•upgrade 2024-03-23.
</li>
<li>
•upgrade 2024-06-29.
← zig version 0.13.0
</li>
<li>
•upgrade 2024-07-01.
← Test Fluent and PCRE "C" Zregex
</li>
<li>
•upgrade 2024-07-22.
← Test MVZR and PCRE "C" Zregex
</li>
<li>
•upgrade 2025-03-12.
← zig version 0.14.0
</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/252122?v=4 | zig-base32 | shavit/zig-base32 | 2023-05-12T07:59:41Z | Base32 encoder and decoder | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/shavit/zig-base32/tags | - | [
"base32",
"cli",
"zig"
] | 10 | false | 2024-07-14T02:53:49Z | true | false | unknown | github | [] | Zig Base32
<blockquote>
Base32 library
</blockquote>
Usage
<ol>
<li>
Encode
<code>$ zbase32 Hello
JBSWY3DP</code>
</li>
<li>
Decode
<code>$ zbase32 -d JBSWY3DP
Hello</code>
</li>
</ol> | [] |
https://avatars.githubusercontent.com/u/27089165?v=4 | subleq-linear | DivergentClouds/subleq-linear | 2023-05-05T15:11:31Z | An implementation of the Subleq OISC using only linear operations on half-precision (16 bit) IEEE-754 floats (and a loop). | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/DivergentClouds/subleq-linear/tags | BSD-3-Clause | [
"floating-point",
"half-precision",
"hfluint8",
"subleq",
"zig"
] | 19 | false | 2025-05-15T13:19:40Z | true | false | unknown | github | [] | An implimentation of the Subleq OISC using only linear operations on
half-precision (16 bit) IEEE-754 floats (and a loop).
Also contains a hfluint8 implimentation.
Dependencies:
- zig
- Built on 0.14.0
Instructions:
$ zig build -Doptimize=ReleaseSafe
$ zig-out/bin/subleq-linear [iterations [output file]]
Based on http://tom7.org/grad/murphy2023grad.pdf | [] |
https://avatars.githubusercontent.com/u/7703829?v=4 | pubsuffix | jefromyers/pubsuffix | 2023-12-06T03:44:06Z | TLD & Domain parsing for URLs | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/jefromyers/pubsuffix/tags | MIT | [
"zig"
] | 85 | false | 2023-12-06T03:47:40Z | false | false | unknown | github | [] | Zig URL Parser with Domain and TLD Support
What's going on here?
This package is my first foray into Zig and is an ongoing project. It adds
domain and TLD parsing on top of the standard URI parser. The implementation
leverages the <a>Public Suffix List</a> to accurately
parse and identify the effective TLD and domains of URLs.
As I'm new to Zig, any feedback, suggestions, or contributions are greatly
appreciated!
License
MIT | [] |
https://avatars.githubusercontent.com/u/11048462?v=4 | iptv-tools | eckelon/iptv-tools | 2023-02-26T21:07:18Z | Just a toy project to learn Zig (and to manage my m3u8 playlists) | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/eckelon/iptv-tools/tags | - | [
"iptv",
"iptv-m3u",
"zig",
"ziglang"
] | 2 | false | 2023-02-26T21:09:11Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/73784979?v=4 | hasm | pdegama/hasm | 2023-07-05T12:49:30Z | Computer Assembler For x86_64 / amd64 | Dev line... | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/pdegama/hasm/tags | Apache-2.0 | [
"amd64",
"asm",
"assembly",
"computer",
"x86-64",
"zig"
] | 52 | false | 2023-11-01T17:12:09Z | true | false | unknown | github | [] | hasm
Computer Assembler | [] |
https://avatars.githubusercontent.com/u/372301?v=4 | ziglings | hiroaqii/ziglings | 2023-11-18T09:07:36Z | Fork from https://codeberg.org/ziglings/exercises | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/hiroaqii/ziglings/tags | MIT | [
"zig",
"ziglang"
] | 1,320 | false | 2023-12-16T12:43:35Z | true | false | unknown | github | [] | Ziglings
⚠️ Ziglings has moved from GitHub to Codeberg!
You are looking at the current Ziglings repo if you are viewing
this at https://codeberg.org/ziglings/exercises/
You can also use the handy URL https://ziglings.org to get here!
Welcome to Ziglings! This project contains a series of tiny
broken programs (and one nasty surprise). By fixing them, you'll
learn how to read and write <a>Zig</a> code.
Those broken programs need your help! (You'll also save the
planet from evil aliens and help some friendly elephants stick
together, which is very sweet of you.)
This project was directly inspired by the brilliant and fun
<a>rustlings</a>
project for the <a>Rust</a> language.
Indirect inspiration comes from <a>Ruby Koans</a>
and the Little LISPer/Little Schemer series of books.
Intended Audience
This will probably be difficult if you've <em>never</em> programmed
before. But no specific programming experience is required. And
in particular, you are <em>not</em> expected to have any prior
experience with "systems programming" or a "systems" level
language such as C.
Each exercise is self-contained and self-explained. However,
you're encouraged to also check out these Zig language resources
for more detail:
<ul>
<li>https://ziglang.org/learn/</li>
<li>https://ziglearn.org/</li>
<li>https://ziglang.org/documentation/master/</li>
</ul>
Also, the <a>Zig community</a>
is incredibly friendly and helpful!
Getting Started
Install a <a>development build</a> of
the Zig compiler. (See the "master" section of the downloads
page.)
Verify the installation and build number of <code>zig</code> like so:
<code>$ zig version
0.12.0-dev.xxxx+xxxxxxxxx</code>
Clone this repository with Git:
<code>$ git clone https://ziglings.org
$ cd ziglings.org</code>
Then run <code>zig build</code> and follow the instructions to begin!
<code>$ zig build</code>
Note: The output of Ziglings is the unaltered output from the Zig
compiler. Part of the purpose of Ziglings is to acclimate you to
reading these.
A Note About Versions
<strong>Hint:</strong> To check out Ziglings for a stable release of Zig, you can use
the appropriate tag.
The Zig language is under very active development. In order to be
current, Ziglings tracks <strong>development</strong> builds of the Zig
compiler rather than versioned <strong>release</strong> builds. The last
stable release was <code>0.11.0</code>, but Ziglings needs a dev build with
pre-release version "0.12.0" and a build number at least as high
as that shown in the example version check above.
It is likely that you'll download a build which is <em>greater</em> than
the minimum.
Once you have a build of the Zig compiler that works with
Ziglings, they'll continue to work together. But keep in mind
that if you update one, you may need to also update the other.
Version Changes
Version-0.12.0-dev.1243
* <em>2023-10-24</em> zig 0.12.0-dev.1243 - changes in <code>std.ChildProcess</code>: renamed exec to run - see<a>#5853</a>
* <em>2023-06-26</em> zig 0.11.0-dev.4246 - changes in compile step (now it can be null)
* <em>2023-06-26</em> zig 0.11.0-dev.3853 - removal of destination type from all cast builtins
* <em>2023-06-20</em> zig 0.11.0-dev.3747 - <code>@enumToInt</code> is now <code>@intFromEnum</code> and <code>@intToFloat</code> is now <code>@floatFromInt</code>
* <em>2023-05-25</em> zig 0.11.0-dev.3295 - <code>std.debug.TTY</code> is now <code>std.io.tty</code>
* <em>2023-04-30</em> zig 0.11.0-dev.2704 - use of the new <code>std.Build.ExecutableOptions.link_libc</code> field
* <em>2023-04-12</em> zig 0.11.0-dev.2560 - changes in <code>std.Build</code> - remove run() and install()
* <em>2023-04-07</em> zig 0.11.0-dev.2401 - fixes of the new build system - see <a>#212</a>
* <em>2023-02-21</em> zig 0.11.0-dev.2157 - changes in <code>build system</code> - new: parallel processing of the build steps
* <em>2023-02-21</em> zig 0.11.0-dev.1711 - changes in <code>for loops</code> - new: Multi-Object For-Loops + Struct-of-Arrays
* <em>2023-02-12</em> zig 0.11.0-dev.1638 - changes in <code>std.Build</code> cache_root now returns a directory struct
* <em>2023-02-04</em> zig 0.11.0-dev.1568 - changes in <code>std.Build</code> (combine <code>std.build</code> and <code>std.build.Builder</code> into <code>std.Build</code>)
* <em>2023-01-14</em> zig 0.11.0-dev.1302 - changes in <code>@addWithOverflow</code> (now returns a tuple) and <code>@typeInfo</code>; temporary disabled async functionality
* <em>2022-09-09</em> zig 0.10.0-dev.3978 - change in <code>NativeTargetInfo.detect</code> in build
* <em>2022-09-06</em> zig 0.10.0-dev.3880 - Ex 074 correctly fails again: comptime array len
* <em>2022-08-29</em> zig 0.10.0-dev.3685 - <code>@typeName()</code> output change, stage1 req. for async
* <em>2022-07-31</em> zig 0.10.0-dev.3385 - std lib string <code>fmt()</code> option changes
* <em>2022-03-19</em> zig 0.10.0-dev.1427 - method for getting sentinel of type changed
* <em>2021-12-20</em> zig 0.9.0-dev.2025 - <code>c_void</code> is now <code>anyopaque</code>
* <em>2021-06-14</em> zig 0.9.0-dev.137 - std.build.Id <code>.Custom</code> is now <code>.custom</code>
* <em>2021-04-21</em> zig 0.8.0-dev.1983 - std.fmt.format() <code>any</code> format string required
* <em>2021-02-12</em> zig 0.8.0-dev.1065 - std.fmt.format() <code>s</code> (string) format string required
Advanced Usage
It can be handy to check just a single exercise:
<code>zig build -Dn=19</code>
You can also run without checking for correctness:
<code>zig build -Dn=19 test</code>
Or skip the build system entirely and interact directly with the
compiler if you're into that sort of thing:
<code>zig run exercises/001_hello.zig</code>
Calling all wizards: To prepare an executable for debugging,
install it to zig-cache/bin with:
<code>zig build -Dn=19 install</code>
To get a list of all possible options, run:
```
zig build -Dn=19 -l
install Install 019_functions2.zig to prefix path
uninstall Uninstall 019_functions2.zig from prefix path
test Run 019_functions2.zig without checking output
...
```
What's Covered
The primary goal for Ziglings is to cover the core Zig language.
It would be nice to cover the Standard Library as well, but this
is currently challenging because the stdlib is evolving even
faster than the core language (and that's saying something!).
Not only would stdlib coverage change very rapidly, some
exercises might even cease to be relevant entirely.
Having said that, there are some stdlib features that are
probably here to stay or are so important to understand that they
are worth the extra effort to keep current.
Conspicuously absent from Ziglings are a lot of string
manipulation exercises. This is because Zig itself largely avoids
dealing with strings. Hopefully there will be an obvious way to
address this in the future. The Ziglings crew loves strings!
Zig Core Language
<ul>
<li>[x] Hello world (main needs to be public)</li>
<li>[x] Importing standard library</li>
<li>[x] Assignment</li>
<li>[x] Arrays</li>
<li>[x] Strings</li>
<li>[x] If</li>
<li>[x] While</li>
<li>[x] For</li>
<li>[x] Functions</li>
<li>[x] Errors (error/try/catch/if-else-err)</li>
<li>[x] Defer (and errdefer)</li>
<li>[x] Switch</li>
<li>[x] Unreachable</li>
<li>[x] Enums</li>
<li>[x] Structs</li>
<li>[x] Pointers</li>
<li>[x] Optionals</li>
<li>[x] Struct methods</li>
<li>[x] Slices</li>
<li>[x] Many-item pointers</li>
<li>[x] Unions</li>
<li>[x] Numeric types (integers, floats)</li>
<li>[x] Labelled blocks and loops</li>
<li>[x] Loops as expressions</li>
<li>[x] Builtins</li>
<li>[x] Inline loops</li>
<li>[x] Comptime</li>
<li>[x] Sentinel termination</li>
<li>[x] Quoted identifiers @""</li>
<li>[x] Anonymous structs/tuples/lists</li>
<li>[ ] Async <--- ironically awaiting upstream Zig updates</li>
<li>[X] Interfaces</li>
<li>[X] Bit manipulation</li>
<li>[X] Working with C</li>
<li>[ ] Interfaces part 2</li>
</ul>
Zig Standard Library
<ul>
<li>[X] String formatting</li>
<li>[X] Testing</li>
<li>[X] Tokenization</li>
</ul>
Contributing
Contributions are very welcome! I'm writing this to teach myself
and to create the learning resource I wished for. There will be
tons of room for improvement:
<ul>
<li>Wording of explanations</li>
<li>Idiomatic usage of Zig</li>
<li>Additional exercises</li>
</ul>
Please see <a>CONTRIBUTING</a>
in this repo for the full details. | [] |
https://avatars.githubusercontent.com/u/43842467?v=4 | cheesle | nonk123/cheesle | 2023-12-10T04:43:26Z | Cheesle is a Wordle clone imbued with cheese! | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/nonk123/cheesle/tags | MIT | [
"backend",
"cheese",
"css",
"frontend",
"html",
"javascript",
"web",
"wordle",
"zig"
] | 3,440 | false | 2025-03-18T09:14:31Z | true | false | unknown | github | [] | cheesle
A Worlde clone imbued with cheese! | [] |
https://avatars.githubusercontent.com/u/13604262?v=4 | yazbg | pkdindustries/yazbg | 2023-10-06T17:25:22Z | yet another zig block game | main | 4 | 0 | 0 | 0 | https://api.github.com/repos/pkdindustries/yazbg/tags | - | [
"blocks",
"game",
"linux",
"osx",
"raylib",
"tetraminos",
"windows",
"zig",
"ziglang"
] | 18,916 | false | 2025-05-22T05:23:59Z | true | true | unknown | github | [
{
"commit": "master",
"name": "raylib",
"tar_url": "https://github.com/raysan5/raylib/archive/master.tar.gz",
"type": "remote",
"url": "https://github.com/raysan5/raylib"
},
{
"commit": "master",
"name": "entt",
"tar_url": "https://github.com/prime31/zig-ecs/archive/master.tar.gz... | yazbg
yet another zig block game!
block games [tm] have always been my goto project for learning a new language. so here we are, my first zig program.
(it started as my first zig program, now it's also has a bunch of claude vibes)
raylib is used for graphics and input
zig-ecs for entities
https://www.raylib.com/
https://github.com/prime31/zig-ecs
install
```bash
git clone https://github.com/pkdindustries/yazbg
cd yazbg
native
zig build run
wasm
zig build -Dtarget=wasm32-emscripten -Doptimize=ReleaseSmall --sysroot
```
controls
<code>left/right: move
up: rotate
z: rotate
down: drop
space: hard drop
c: swap piece
b: next background
m: mute
n: next music
p: pause
r: reset</code>
tested with zig version: <code>0.14.0</code> | [] |
https://avatars.githubusercontent.com/u/121770001?v=4 | zig-znippets | levenrok/zig-znippets | 2023-10-18T11:32:13Z | Zig Code Snippets for VSCode | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/levenrok/zig-znippets/tags | MIT | [
"snippets",
"visual-studio-code",
"vscode",
"vscode-extension",
"zig"
] | 249 | false | 2024-01-19T12:39:53Z | false | false | unknown | github | [] | <a></a>
<a></a>
<a></a>
Znippets
This extension contains code snippets for Ziglang for <a>VSCode</a>.
Snippets
Below is a list of all available snippets and the triggers of each one. Snippets are categorized into the following 📑:
<ul>
<li>Standard Library</li>
<li>Variables</li>
<li>Pointers</li>
<li>Types</li>
<li>Loops</li>
</ul>
These snippets also contain a helpful description that can further provide you with more information to help you code better 😎
Some snippets have not been added since ZLS provides an ergonomic and always updated version of them 💪
<blockquote>
<strong><em>NOTE:</em></strong> The <strong>⇥</strong> means the <code>TAB</code> key.
</blockquote>
Standard Library
| Trigger | Content | Preview |
| :-------: | ------- | -------- |
| <code>imstd⇥</code> | import the standard library into the current scope | <code>const std = @import ("std");</code> |
| <code>writer⇥</code> | add the writer to the standard output | <code>const stdout = std.io.getStdOut.writer();</code> |
Variables
| Trigger | Content | Preview |
| :-------: | ------- | -------- |
| <code>const⇥</code> | declare a constant | <code>const name: type = ;</code> |
| <code>var⇥</code> | declare a variable | <code>var name: type = ;</code> |
Pointers
| Trigger | Content | Preview |
| :-------: | ------- | -------- |
| <code>ptr⇥</code> | declare a pointer | <code>const name_ptr: *type = &;</code> <code>var name_ptr: *type = &;</code> |
| <code>ptrλ⇥</code> | declare a pointer constants | <code>const name_ptr: *const type = &;</code> |
Types
| Trigger | Content | Preview |
| :-------: | ------- | -------- |
| <code>fn⇥</code> | declare a function | <code>fn name() void {}</code> |
| <code>fn!⇥</code> | declare a function with an error union type | <code>fn name() !void {}</code> |
| <code>pfn⇥</code> | declare a public function | <code>pub fn name() void {}</code> |
| <code>pfn!⇥</code> | declare a public function with an error union type | <code>pub fn name() !void {}</code> |
| <code>arr⇥</code> | declare an array | <code>const name = [_]type{};</code> <code>var name = [_]type{};</code> |
| <code>matrix⇥</code> | declare a multidimensional array | <code>const name = [_][_]type{[_]u8{}};</code> <code>var name = [_][_]type{[_]u8{}};</code> |
| <code>err⇥</code> | declare an error set | <code>const Error = error {};</code> |
| <code>opt⇥</code> | declare a optional | <code>const name: ?type = ;</code> <code>var name: ?type = ;</code> |
| <code>enum⇥</code> | declare an enum | <code>const Enum = enum {};</code> |
| <code>union⇥</code> | declare an union | <code>const Union = union {};</code> |
| <code>struct⇥</code> | declare a struct | <code>const Struct = struct {};</code> |
Loops
| Trigger | Content | Preview |
| :-------: | ------- | -------- |
| <code>while⇥</code> | add a while loop | <code>while() : () {}</code> |
| <code>switch⇥</code> | add a switch statement | <code>switch () {}</code> | | [] |
https://avatars.githubusercontent.com/u/2828351?v=4 | Zig-ROM-Compress | bcrist/Zig-ROM-Compress | 2023-10-28T15:56:51Z | Simple compression scheme for sparse ROM data | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/bcrist/Zig-ROM-Compress/tags | MIT | [
"compression",
"compression-algorithm",
"embedded",
"encoding",
"rom",
"zig",
"zig-library",
"zig-package",
"ziglang"
] | 10 | false | 2024-06-22T15:18:22Z | true | true | 0.12.0-dev.2063+804cee3b9 | github | [
{
"commit": "98cfaaae0abfe7a8bc396846dcca148a75e0b6ed.tar.gz",
"name": "Zig-BitHelper",
"tar_url": "https://github.com/bcrist/Zig-BitHelper/archive/98cfaaae0abfe7a8bc396846dcca148a75e0b6ed.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/bcrist/Zig-BitHelper"
}
] | Zig-Rom-Compress
A simple algorithm for in-storage compression of potentially sparse data where the data will be fully uncompressed before usage.
The motivating use case is when using a microcontroller to bootstrap an SRAM at reset, which will thereafter function as a lookup table/ROM.
Often times such lookup tables may contain several megabytes of highly patterned data, but you'd like to initialize it with just a small/cheap microcontroller, and typically these will have much less than 1MB of flash memory.
Note for most data, an LZ-based compressor like DEFLATE will achieve a better compression ratio, but doesn't support sparse data without adding additional metadata.
The decompressor for this scheme is also very simple and requires only a few bytes of working RAM.
Algorithm
The key insight that we make use of is that many data words are likely to be repeated many times,
and there may be many "don't care" addresses that we need not initialize at all.
Furthermore, the data need not be reconstructed in linear order.
The compressor begins by partitioning the data into lists of addresses which point to the same data value.
Then it sorts the addresses within those lists, and sorts the partitions based on the data value.
It can then use delta compression and RLE on the transformed data.
The algorithm works well in most real-world cases where there are many addresses with the same data value,
and even better if those addresses appear in contiguous blocks.
It is possible, however, (particularly with encrypted or random-like data) that the compressed version may actually be larger. | [] |
https://avatars.githubusercontent.com/u/8930210?v=4 | ztl | jacksonsalopek/ztl | 2024-01-10T01:45:28Z | Zig HTML templating -- made easy | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/jacksonsalopek/ztl/tags | - | [
"html",
"html-template",
"zig"
] | 33 | false | 2025-03-25T08:57:33Z | true | false | unknown | github | [] | ztl - Zig Templating Language
Zig HTML templating with no dependencies.
Core Features
<ol>
<li>HTML5-compatible</li>
<li>Accessible - <code>.aria</code> key available on Props</li>
<li>HTMX-compatible - <code>.hx</code> key available on Props</li>
<li>(Relatively) Easy to use.</li>
</ol>
Using ztl
Section in progress. Please refer to the tests in <code>src/main.zig</code> for example usage.
```zig
const std = @import("std");
const ztl = @import("ztl");
pub fn main() !void {
const alloc = std.testing.allocator;
var z = ztl.ZTLBuilder.init(alloc);
defer z.deinit();
<code>const markup = z.html(Props{
.lang = "en-US",
}, &[_]El{
z.head(null, null).el(),
z.body(null, null).el(),
});
var buf = std.ArrayList(u8).init(alloc);
defer buf.deinit();
try markup.render(&buf, true);
const renderedText = try buf.toOwnedSlice();
try std.testing.expectEqualStrings("<!DOCTYPE html><html lang=\"en-US\"><head></head><body></body></html>", renderedText);
alloc.free(renderedText);
</code>
}
```
Benchmarks
Production-ready benchmarks are available in <code>src/main.zig</code>, which can be compiled with <code>zig build -Doptimize=ReleaseFast</code>.
On M1 Max (Mac Studio 2022):
<code>ztl.zig average render time: 2248ns, TPS: ~444,839
ztlc.zig average render time: 2790ns, TPS: ~358,423</code>
It is expected that the ztlc implementation will outperform the ztl implementation in most cases, but the ztl implementation is still faster in some cases. In static cases, such as the benchmark above, the ztl implementation is faster.
In large dynamic cases, it is expected that the ztlc implementation will outperform the ztl implementation due to comptime tag caching. | [
"https://github.com/BratishkaErik/zig-ebuilder"
] |
https://avatars.githubusercontent.com/u/135217?v=4 | zanzibar | gthvn1/zanzibar | 2023-11-24T09:21:39Z | 🐵 An interpreter of Monkey lang in Zig 🦎 | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/gthvn1/zanzibar/tags | GPL-3.0 | [
"interpreter",
"monkeyislang",
"zig"
] | 54 | false | 2024-08-18T19:17:25Z | true | false | unknown | github | [] | Zanzibar Red Colobus
Monkey Islang
The <strong>Zanzibar Red Colobus</strong> is a monkey endemic to Unguja, the main island of the Zanzibar Archipelago.
The name was chosen by reference to <a>Monkeylang</a>. And as you probably notice its
name starts with a 'Z' and its a reference to <a>Ziglang</a>.
Monkey is a programming language that you can build yourself by reading through
<a>Writing An Interpreter In Go</a> and
<a>Writing A Compiler In Go</a>. So let's give it a try...
Thus <a>Zanzibar</a> is an implementation of <a>Monkey</a> in <a>Zig</a>
Travel to Monkey Islang
<ul>
<li>As easy as <code>zig build run</code></li>
<li>We will visit
<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> <strong>Lexer</strong> islang: <code>zig test src/lexer.zig</code>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> <strong>Parser</strong> islang
<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> <strong>AST</strong> islang
<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> <strong>IOS</strong> islang also known as Internal Object System islang
<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> <strong>Evaluator</strong> islang</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/57828948?v=4 | mini-bb | ikasoba/mini-bb | 2023-03-13T13:27:17Z | small busybox like application | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/ikasoba/mini-bb/tags | - | [
"zig"
] | 6 | false | 2023-03-13T14:34:38Z | true | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/49893724?v=4 | minigame-raylib | purple4pur/minigame-raylib | 2023-10-12T10:10:57Z | Minigames written in Zig and raylib. Practice Zig. Play with Zig. | master | 6 | 0 | 0 | 0 | https://api.github.com/repos/purple4pur/minigame-raylib/tags | MIT | [
"game",
"osu",
"raylib",
"zig"
] | 101 | false | 2023-11-01T17:10:58Z | 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"
}
] | Minigames in Zig and raylib
Practice Zig. Play with Zig.
Tested under:
<ul>
<li>Zig 0.11.0 <a><code>67709b6</code></a></li>
<li>raylib-zig <a><code>239d3a2</code></a></li>
<li>raylib v4.6-dev <a><code>6094869</code></a></li>
</ul>
To list all build targets:
<code>zig build -l</code>
Track progress: purple4pur/minigame-raylib#2. Checkout dev branch for latest changes!
Current Available
<ul>
<li><strong>Pallete</strong>: a simple pallete to go through all named colors in raylib</li>
<li><strong>Speedtest</strong>: designed for osu!standard players, which aims to test how well a player can hit streams in game. <a>[Homepage]</a></li>
</ul>
License
MIT. Please read <code>/licenses</code> folder for used/related projects' licenses! | [] |
https://avatars.githubusercontent.com/u/71951273?v=4 | llvmball | garrisonhh/llvmball | 2023-09-26T17:51:00Z | nix flake to make development with llvm painless | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/garrisonhh/llvmball/tags | - | [
"llvm",
"llvm-project",
"nix",
"zig"
] | 5 | false | 2023-11-01T17:24:33Z | false | false | unknown | github | [] | llvmball
I don't want to build or even really touch llvm ever, if I can avoid it. this is
a nix flake that produces a nicely packaged llvm tarball for your project.
usage
llvmball unzips to contain the following structure:
- <code>llvmball/include</code> - llvm headers
- <code>llvmball/libs</code> - llvm static libraries | [] |
https://avatars.githubusercontent.com/u/89562141?v=4 | nuko | markjoshwel/nuko | 2023-10-25T22:31:39Z | nuko is a small file uploader to [litterbox.]catbox.moe | main | 1 | 0 | 0 | 0 | https://api.github.com/repos/markjoshwel/nuko/tags | Unlicense | [
"catbox",
"litterbox",
"zig"
] | 15 | false | 2024-09-06T11:14:09Z | true | true | unknown | github | [] | nuko
nuko is a small file uploader to and .
it is also an exercise in learning and writing <a>Zig</a>.
installing
TODO
usage
<blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
album creation and management is not implemented yet.
</blockquote>
```text
usage: nuko [-h] [-l] [-t {1,12,24,72}] [file, ...]
a small file uploader to [litter.]catbox.moe
positional arguments:
file path(s) to file to read
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-l, --litterbox use litterbox.catbox.moe instead of catbox.moe
-t {1,12,24,72}, --time {1,12,24,72}
(for litterbox) how long the file should be kept
-u USERHASH, --userhash USERHASH
(for catbox) specify a userhash for non-anonymous uploads
-a [SHORT], --album [SHORT]
(for catbox) create a new album if short is not specified
add an '/edit' '/add' or 'remove' suffix to edit images,
add images to and remove images from an already existing
album respectively.
when given, files parameter are shorts of files already on
catbox.
<code> shorts are the short identifiers of catbox files.
e.g., the short of 'https://files.catbox.moe/0k6bpc.jpg'
is '0k6bpc.jpg'
same goes for albums, but without the preceding '.../c/'
</code>
```
examples
<blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
the command line parsing in nuko is written from scratch, and as such is not thorough.
chaining of flags such as <code>-lt</code> is not supported.
</blockquote>
<ol>
<li>upload a file to catbox.moe anonymously</li>
</ol>
<code>text
nuko file.webm</code>
<ol>
<li>upload a file to litter.catbox.moe anonymously</li>
</ol>
<code>text
nuko -l file.webm</code>
<ol>
<li>upload a file to litter.catbox.moe anonymously and set an expiration of 24 hours</li>
</ol>
<code>text
nuko -l -t 24 file.webm</code>
<ol>
<li>make an album on catbox.moe with two files</li>
</ol>
<blockquote>
<span class="bg-green-100 text-green-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-green-900 dark:text-green-300">IMPORTANT</span>
albums can only be modified if a userhash is given.
</blockquote>
<code>text
nuko -a -u a_unique_user_hash 7lbgmz.jpg wgg3yb.jpg v7u0xs.jpg</code>
<ol>
<li>remove an image from an album on catbox.moe</li>
</ol>
<blockquote>
<span class="bg-blue-100 text-blue-800 text-xs font-medium me-2 px-2.5 py-0.5 rounded dark:bg-blue-900 dark:text-blue-300">NOTE</span>
when an album has a modification suffix like <code>/edit</code>, <code>/add</code> and <code>remove</code>, files
given to nuko are treated as shorts (shortened versions of a catbox URL) of files
already on catbox.
</blockquote>
<code>text
nuko -a v90wjs/remove -u a_unique_user_hash 7lbgmz.jpg</code>
note on album modification suffixes:
<ul>
<li>
<code>/edit</code> is used to completely change the contents of an album, the list of shorts
given to nuko will be the new contents of the album.
</li>
<li>
<code>/add</code> is used to add files to an album, the list of shorts given to nuko will be
added to the album.
</li>
<li>
<code>/remove</code> is used to remove files from an album, the list of shorts given to nuko
will be removed from the album.
</li>
</ul>
developing
TODO
licence
nuko is free and unencumbered software released into the public domain. For more
information, please refer to <a>http://unlicense.org/</a> or the <a>UNLICENCE</a> file. | [] |
https://avatars.githubusercontent.com/u/337093?v=4 | vp8enc | tetsu-koba/vp8enc | 2023-05-07T14:02:39Z | VP8 video encoder for Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/tetsu-koba/vp8enc/tags | - | [
"video-streaming",
"zig"
] | 1,592 | false | 2025-03-06T05:33:22Z | true | false | unknown | github | [] | VP8 video encoder for Zig with libvpx
Build
It requires header and lib files of libvpx.
For example, on Ubuntu:
<code>sudo apt install libvpx-dev</code>
Then,
<code>zig build</code>
How to use
See test files.
ToDo
Make this into a package when the official zig package manager is released. | [] |
https://avatars.githubusercontent.com/u/137691550?v=4 | octopus | octopus-os-org/octopus | 2023-06-25T10:32:41Z | An os writen in zig, regard linux as model, the vision is that be simple to understand and change while reliable and powerful, currently on the way going to v0.0.1 | dev | 0 | 0 | 0 | 0 | https://api.github.com/repos/octopus-os-org/octopus/tags | Apache-2.0 | [
"os",
"zig"
] | 5,486 | false | 2024-06-01T03:29:05Z | false | false | unknown | github | [] | octopus
on the way going to v 0.0.1
WIP | [] |
https://avatars.githubusercontent.com/u/6756180?v=4 | CMake | kassane/CMake | 2023-05-26T13:00:27Z | Mirror of CMake - Builded by Zig | zig | 0 | 0 | 0 | 0 | https://api.github.com/repos/kassane/CMake/tags | NOASSERTION | [
"cmake",
"zig"
] | 162,646 | true | 2024-10-29T16:26:45Z | false | false | unknown | github | [] | 404 | [] |
https://avatars.githubusercontent.com/u/50266711?v=4 | zig-spall | Altagos/zig-spall | 2023-12-06T19:45:10Z | [mirror] Zig library for generating spall-web profiling reports. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/Altagos/zig-spall/tags | MIT | [
"zig"
] | 20 | false | 2024-02-12T11:46:52Z | true | true | 0.12.0-dev.3522+b88ae8dbd | github | [] | zig-spall
<a></a>
Zig library for generating <a>spall-web</a> profiling reports.
Tested with Zig version <code>0.12.0-dev.2043+6ebeb85ab</code>
Installation
First add it as dependencie to your <code>build.zig.zon</code> file:
<code>zig
.dependencies = .{
.spall = .{
.url = "https://git.sr.ht/~altagos/zig-spall/archive/{{COMMIT}}.tar.gz"
.hash = "{{HASH}}"
},
}</code>
Replace <code>{{COMMIT}}</code> with the latest commit, and <code>{{HASH}}</code> will get generated during the next build (and displayed for you to copy and replace).
Then in <code>build.zig</code> add it to your Compile step like this:
```zig
const spall = b.dependency("spall", .{
.target = target,
.optimize = optimize,
.enable = true, // Disabling spall will make any function call a nop (no operation), default: false
});
exe.addModule("spall", spall.module("spall"));
```
Usage
In your program:
```zig
const std = @import("std");
const spall = @import("spall");
pub fn main() !void {
try spall.init("./trace/example.spall");
defer spall.deinit();
<code>while (true) {
try spall.init_thread();
defer spall.deinit_thread();
const span = spall.trace(@src(), "Hello World", .{});
std.debug.print("Hello World!\n");
span.end();
}
</code>
}
```
An example with threads is in the <a>example folder</a>.
Similar libraries & other profiling libraries
<ul>
<li><a>zig-tracer</a>: Generic tracing library for Zig, supports multiple backends.</li>
</ul>
zig-spall is based on <a>zig-tracer</a>'s design.
<ul>
<li><a>zig-tracy</a>: Easy to use bindings for the tracy client C API.</li>
<li><a>ztracy</a>: performance markers for Tracy 0.10</li>
</ul>
<blockquote>
part of <a>michal-z/zig-gamedev</a>
</blockquote>
TODO
<br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> add enable and disable options
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> add compatibility with <a>zig-tracer</a>
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> add documentation
<br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> add test (?)
License
MIT, see <a>LICENSE</a> | [] |
https://avatars.githubusercontent.com/u/17755880?v=4 | rpi_pico_examples.zig | rjsberry/rpi_pico_examples.zig | 2023-10-13T18:27:51Z | Example project in Zig for the Raspberry Pi Pico. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/rjsberry/rpi_pico_examples.zig/tags | 0BSD | [
"embedded",
"example",
"firmware",
"raspberry-pi",
"raspberry-pi-pico",
"zig"
] | 361 | false | 2023-11-01T17:11:35Z | true | true | unknown | github | [
{
"commit": "473e797fcc1a890aa13299ebdd22526eb5618193.tar.gz",
"name": "rp2040",
"tar_url": "https://github.com/rjsberry/rpi_pico.zig/archive/473e797fcc1a890aa13299ebdd22526eb5618193.tar.gz.tar.gz",
"type": "remote",
"url": "https://github.com/rjsberry/rpi_pico.zig"
},
{
"commit": "530db... | <em>rpi_pico_examples.zig</em>
Example Zig project for the Raspberry Pi Pico microcontroller.
Building
To build the firmware:
<code>zig build</code>
The firmware will be placed in <code>zig-out/bin</code>.
Running the code
While you could upload code the USB bootloader, it's more fun to do everything
from <code>zig</code> instead!
You will need:
<ol>
<li>A Raspberry Pi Pico.</li>
<li>A Raspberry Pi Debug Probe <em><strong>or</strong></em> a second Pico running [<code>picoprobe</code>]. </li>
<li>An installation of OpenOCD.</li>
<li>An installation of the GNU ARM embedded toolchain for <code>arm-none-eabi-gdb</code>.</li>
</ol>
Connect your hardware up as follows:
Then run:
<code>zig build xrun</code>
This will flash the firmware onto your device, then monitor for <a>RTT</a> output.
You should see:
<code>hello world</code>
Printed to the terminal.
License
The examples in this repository and all other <code>rp2040.zig</code> code is dual licensed
under the 0BSD and MIT licenses.
The examples contain binary second stage boot code which is licensed by
Raspberry Pi (Trading) Ltd. under the terms of the 3-clause BSD license. | [] |
https://avatars.githubusercontent.com/u/16360444?v=4 | zig-bytepusher | hax0kartik/zig-bytepusher | 2023-12-30T09:34:22Z | VM for bytepusher in zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/hax0kartik/zig-bytepusher/tags | Unlicense | [
"bytepusher",
"zig"
] | 616 | false | 2023-12-31T04:31:38Z | true | true | unknown | github | [] | Zig-BytePusher
This is a WIP BytePusher VM written in zig as a exploratory exercise done to learn zig.
To know more about BytePusher, please read <a>this</a> page.
Building
This was most recently tested on Windows and confirmed working with Zig 0.12.0-dev.1849+bb0f7d55e
Dependencies
This project requires SDL2 to compile successfully.
What's implemeneted
The following subsystems have been implemented:
| Subsystem | Status |
| :---: | :---: |
| Video | ✔ |
| Audio | ✔ |
| Controls | ✔ | | [] |
https://avatars.githubusercontent.com/u/6429037?v=4 | zig_aoc | pascalruscher/zig_aoc | 2023-05-02T11:06:48Z | 🎄"Advent of Code" in Zig ⚡ | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/pascalruscher/zig_aoc/tags | - | [
"advent-of-code",
"advent-of-code-2015",
"adventofcode",
"adventofcode2015",
"aoc",
"aoc2015",
"zig",
"ziglang"
] | 32 | false | 2023-05-02T18:21:17Z | true | false | unknown | github | [] | Advent of Code
Personal solutions for <a>Advent of Code</a> in <a>Zig</a>.
How to run
<code>zig build -- <year> <day> <a|b></code>
<code>zig build run -- <year> <day> <a|b></code>
<code>zig build test -- <year> <day> <a|b></code>
<code>zig test <path_to_file.zig></code>
TODO
<ul>
<li>Add build to run tests for shared code.</li>
<li>Add hints and errors for build</li>
</ul>
About
Advent of Code is an annual event created by <a>Eric Wastl</a> and free for anyone to join. You can read more about it <a>here</a>. | [] |
https://avatars.githubusercontent.com/u/24578855?v=4 | zpem | deatil/zpem | 2023-08-14T08:52:51Z | A pem parse and encode library for Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/deatil/zpem/tags | Apache-2.0 | [
"ecdsa-pem",
"parse-pem",
"pem",
"rsa-pem",
"zig",
"zig-pem"
] | 19 | false | 2025-03-07T11:15:20Z | true | true | 0.14.0-dev.3451+d8d2aa9af | github | [] | zpem
A pem parse and encode library for Zig.
Env
<ul>
<li>Zig >= 0.14.0-dev.3451+d8d2aa9af</li>
</ul>
### Adding zpem as a dependency
Add the dependency to your project:
<code>sh
zig fetch --save=zpem git+https://github.com/deatil/zpem#main</code>
or use local path to add dependency at <code>build.zig.zon</code> file
<code>zig
.{
.dependencies = .{
.zpem = .{
.path = "./lib/zpem",
},
...
},
...
}</code>
And the following to your <code>build.zig</code> file:
<code>zig
const zpem_dep = b.dependency("zpem", .{});
exe.root_module.addImport("zpem", zpem_dep.module("zpem"));</code>
The <code>zpem</code> structure can be imported in your application with:
<code>zig
const zpem = @import("zpem");</code>
Get Starting
<ul>
<li>parse pem</li>
</ul>
~~~zig
const std = @import("std");
const zpem = @import("zpem");
pub fn main() !void {
const bytes =
"-----BEGIN RSA PRIVATE-----\n" ++
"ABC: thsasd \n" ++
"\n" ++
"MIIBmTCCAUegAwIBAgIBKjAJBgUrDgMCHQUAMBMxETAPBgNVBAMTCEF0bGFudGlz\n" ++
"MB4XDTEyMDcwOTAzMTAzOFoXDTEzMDcwOTAzMTAzN1owEzERMA8GA1UEAxMIQXRs\n" ++
"YW50aXMwXDANBgkqhkiG9w0BAQEFAANLADBIAkEAu+BXo+miabDIHHx+yquqzqNh\n" ++
"Ryn/XtkJIIHVcYtHvIX+S1x5ErgMoHehycpoxbErZmVR4GCq1S2diNmRFZCRtQID\n" ++
"AQABo4GJMIGGMAwGA1UdEwEB/wQCMAAwIAYDVR0EAQH/BBYwFDAOMAwGCisGAQQB\n" ++
"gjcCARUDAgeAMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDAzA1BgNVHQEE\n" ++
"LjAsgBA0jOnSSuIHYmnVryHAdywMoRUwEzERMA8GA1UEAxMIQXRsYW50aXOCASow\n" ++
"CQYFKw4DAh0FAANBAKi6HRBaNEL5R0n56nvfclQNaXiDT174uf+lojzA4lhVInc0\n" ++
"ILwpnZ1izL4MlI9eCSHhVQBHEp2uQdXJB+d5Byg=\n" ++
"-----END RSA PRIVATE-----\n";
<code>const allocator = std.heap.page_allocator;
var p = try zpem.decode(allocator, bytes);
defer p.deinit();
std.debug.print("pem type: {s}\n", .{p.type});
std.debug.print("pem bytes: {x}\n", .{p.bytes});
// get header data
const header = p.headers.get("ABC").?;
std.debug.print("pem header: {s}\n", .{header});
</code>
}
~~~
<ul>
<li>encode pem</li>
</ul>
~~~zig
const std = @import("std");
const zpem = @import("zpem");
pub fn main() !void {
const alloc = std.heap.page_allocator;
<code>// var pp = zpem.Block.initWithType(alloc, "RSA PRIVATE");
var pp = zpem.Block.init(allocator);
pp.type = "RSA PRIVATE";
try pp.headers.put("TTTYYY", "dghW66666");
try pp.headers.put("Proc-Type", "4,Encond");
pp.bytes = "pem bytes";
const allocator = std.heap.page_allocator;
var encoded_pem = try zpem.encode(allocator, pp);
std.debug.print("pem encoded: {s}\n", .{encoded_pem});
</code>
}
~~~
LICENSE
<ul>
<li>The library LICENSE is <code>Apache2</code>, using the library need keep the LICENSE.</li>
</ul>
Copyright
<ul>
<li>Copyright deatil(https://github.com/deatil).</li>
</ul> | [] |
https://avatars.githubusercontent.com/u/17755880?v=4 | biquad.zig | rjsberry/biquad.zig | 2023-09-14T17:07:46Z | Biquad (second order IIR) filters in Zig. | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/rjsberry/biquad.zig/tags | 0BSD | [
"digital-signal-processing",
"embbeded",
"zig"
] | 1,746 | false | 2023-11-01T17:25:13Z | false | false | unknown | github | [] | <em>biquad.zig</em>
Biquad (second order IIR) filters in Zig
Dual licensed under the 0BSD and MIT licenses.
Usage
```zig
const biquad = @import("biquad.zig");
const Biquad = biquad.Biquad;
const Coefficients = biquad.Coefficients;
const DirectFormI = biquad.DirectFormI;
const coeffs = Coefficients(f32).lowpass(.{
.fs = 32_000, // sampling frequency (hz)
.f0 = 200, // cutoff frequency (hz)
.q = 0.707107 // quality factor, defaults to 1/sqrt(2)
});
var filter = Biquad(f32, DirectFormI).init(coeffs);
const y = filter.filter(x); // filter an f32 value through the biquad
``` | [] |
https://avatars.githubusercontent.com/u/25585136?v=4 | bf-interpreter | DanikVitek/bf-interpreter | 2023-11-26T12:36:24Z | BrainFuck interpreter written in Zig | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/DanikVitek/bf-interpreter/tags | - | [
"bf",
"brainfuck",
"brainfuck-interpreter",
"zig",
"ziglang"
] | 8 | false | 2023-11-26T12:45:00Z | true | false | unknown | github | [] | bf-interpreter
To run the interpreter write your BF code in a separate file and provide the path to the file as an argument to the executable
```sh
<blockquote>
bf-interpreter .\examples\hello_world.b
```
</blockquote> | [] |
https://avatars.githubusercontent.com/u/533078?v=4 | els | harehare/els | 2023-02-13T13:29:24Z | els is a powerful ls for pros. | master | 0 | 0 | 0 | 0 | https://api.github.com/repos/harehare/els/tags | MIT | [
"command-line",
"ls",
"zig"
] | 84 | false | 2023-02-13T14:04:48Z | true | false | unknown | github | [] |
#
[](LICENSE)

els is a powerful ls for pros.
- shows useful icons next to file and folder names.
- environment variables can be used to change the default options.
- can be displayed in json, jsonl, csv, and other formats.
---
## cli options
### Display options
- **-1**, **--oneline** Display one entry per line.
- **-l**, **--long** Display extended file metadata as a table.
- **-G**, **--grid** Display entries as a grid (default).
- **-F**, **--classify** Display type indicator by file names
- **-c**, **--csv** Display entries as csv
- **-j**, **--json** Display entries as json
- **-J**, **--jsonl** Display entries as jsonl
- **-p**, **--path** Display full path
- **-R**, **--recurse** Recurse into directories
- **--color COLOR** Use terminal colours (always, never)
- **--icons ICONS** Display icons (nerd, unicode)
- **--no-dir-name** Don't display dir name
### Environment variables
```bash
# Display entries as a grid (default).
ELS_DISPLAY_GRID=true
# Display one entry per line.
ELS_DISPLAY_ONELINE=false
# Display extended file metadata as a table.
ELS_DISPLAY_LONG=false
# Display entries as csv
ELS_DISPLAY_CSV=false
# Display type indicator by file names
ELS_DISPLAY_CLASSIFY=false
# Display entries as json
ELS_DISPLAY_JSON=false
# Display entries as jsonl
ELS_DISPLAY_JSONL=false
# Recurse into directories
ELS_DISPLAY_RECURSE=false
# Display icons (nerd, unicode)
ELS_DISPLAY_ICONS=none
# Display full path
ELS_DISPLAY_PATH=false
# Use terminal colours (always, never)
ELS_DISPLAY_COLOR_STYLE=always
```
### Filtering and sorting options
- **-a**, **--all** Show hidden and 'dot' files.
- **-r**, **--reverse** Reverse the sort order
- **-s**, **--sort SORT_FIELD** Which field to sort by (choices: name, extension, size, modified, accessed, created, inode)
- **-L**, **--level DEPTH** Limit the depth of recursion
- **-D**, **--only-dirs** List only directories
- **-e**, **--exclude** EXCLUDE Do not show files that match the given regular expression
- **-o**, **--only** ONLY Only show files that match the given regular expression
- **--group-directories-first** List directories before other files
### Environment variables
```bash
# Show hidden and 'dot' files.
ELS_FILTRING_AND_SORTING_ALL=true
# Reverse the sort order
ELS_FILTRING_AND_SORTING_REVERSE=false
# List only directories
ELS_FILTRING_AND_SORTING_ONLY_DIRS=false
# Which field to sort by (choices: name, extension, size, modified, accessed, created, inode)
ELS_FILTRING_AND_SORTING_SORT=kind
# Limit the depth of recursion
ELS_FILTRING_AND_SORTING_LEVEL=128
# List directories before other files
ELS_GROUP_DIRECTORIES_FIRST=false
# Do not show files that match the given regular expression
ELS_FILTRING_AND_SORTING_EXCLUDE="\.git"
# ONLY Only show files that match the given regular expression
ELS_FILTRING_AND_SORTING_ONLY=".*\.zig"
```
### Long view, csv and json options
- **-B**, **--bytes** List file sizes in bytes
- **-g**, **--group** List each file's group
- **-i**, **--inode** List each file's inode number
- **-H**, **--header** Add a header row to each column
- **-U**, **--created** Use the created timestamp field
- **-u**, **--accessed** Use the accessed timestamp field
- **-m**, **--modified** Use the modified timestamp field
- **-n**, **--numeric** List numeric user and group IDs
- **--all-fields** Show all fields
- **--blocks** Show number of file system blocks
- **--links** List each file’s number of hard links
- **--no-permissions** Suppress the permissions field
- **--no-filesize** Suppress the filesize field
- **--no-dir-name** Don't display dir name
- **--no-user** Suppress the user field
- **--no-time** Suppress the time field
- **--time-style** How to format timestamps (default, iso, long-iso, timestamp)
- **--octal-permissions** List each file's permission in octal format
### Environment variables
```bash
# List each file's inode number
ELS_LONG_VIEW_INODE=false
# List each file's group
ELS_LONG_VIEW_GROUP=false
# Use the created timestamp field
ELS_LONG_VIEW_CREATED=false
# Use the accessed timestamp field
ELS_LONG_VIEW_ACCESSED=false
# Use the modified timestamp field
ELS_LONG_VIEW_MODIFIED=false
# Add a header row to each column
ELS_LONG_VIEW_HEADER=false
# Suppress the filesize field
ELS_LONG_VIEW_NO_FILE_SIZE=false
# Suppress the user field
ELS_LONG_VIEW_NO_USER=false
# Suppress the time field
ELS_LONG_VIEW_NO_TIME=false
# Suppress the permissions field
ELS_LONG_VIEW_NO_PERMISSIONS=false
# How to format timestamps (default, iso, long-iso, timestamp)
ELS_LONG_VIEW_TIME_STYLE=default
# List file sizes in bytes
ELS_LONG_VIEW_BYTES=false
# List each file's permission in octal format
ELS_LONG_VIEW_OCTAL_PERMISSIONS=false
# Show number of file system blocks
ELS_LONG_VIEW_BLOCKS=false
# List numeric user and group IDs
ELS_LONG_VIEW_NUMERIC=false
# List each file’s number of hard links
ELS_LONG_VIEW_LINKS=false
# Don't display dir name
ELS_LONG_VIEW_NO_DIR_NAME=false
# Show all fields
ELS_LONG_VIEW_ALL_FIELDS=false
```
## Installation
### Homebrew
TODO:
### Manual
```
just install
```
## Development
```
just run
```
## Testing
```
$ just test
```
## License
[MIT](http://opensource.org/licenses/MIT)
| [] |
https://avatars.githubusercontent.com/u/85725475?v=4 | preimp | elijah-team/preimp | 2023-03-28T03:18:46Z | null | main | 0 | 0 | 0 | 0 | https://api.github.com/repos/elijah-team/preimp/tags | - | [
"imgui",
"zig"
] | 6,822 | true | 2023-03-28T03:23:54Z | true | false | unknown | github | [] | Prototyping interactions for <a>imp</a> without getting bottlenecked on language design.
<code>bash
nix-shell
zig build test
zig build run_native</code> | [] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.