avatar_url
stringlengths
46
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
45 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
0
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
60 values
repo_from
stringclasses
3 values
dependencies
listlengths
0
121
readme_content
stringlengths
0
437k
dependents
listlengths
0
21
https://avatars.githubusercontent.com/u/124872?v=4
zig-rocca-s
jedisct1/zig-rocca-s
2021-10-19T23:02:17Z
An implementation of the ROCCA-S encryption scheme.
master
0
19
0
19
https://api.github.com/repos/jedisct1/zig-rocca-s/tags
MIT
[ "aead", "cipher", "rocca", "rocca-s", "zig", "zig-package" ]
24
false
2024-10-25T11:52:51Z
true
false
unknown
github
[]
ROCCA-S: an efficient AES-based encryption scheme This is an implementation of <a>ROCCA-S: an efficient AES-based encryption scheme for beyond 5G</a>, a very fast authenticated encryption scheme optimized for platforms with AES-NI or ARM crypto extensions. ROCCA-S has a 256 bit key size, a 128 bit nonce, processes 256 bit message blocks and outputs a 256 bit authentication tag. <strong>Warning:</strong> this implementation is for benchmarking and testing purposes only.
[]
https://avatars.githubusercontent.com/u/91094662?v=4
cupcake
bootradev/cupcake
2021-11-23T21:47:16Z
an app framework for making small and delicious games! (very wip)
main
0
18
1
18
https://api.github.com/repos/bootradev/cupcake/tags
MIT
[ "gamedev", "zig" ]
696
false
2025-02-18T22:39:30Z
true
false
unknown
github
[]
cupcake is an app framework for making small and delicious games! (very wip) At the moment, it's just my personal place to doodle around with game development in zig. Don't expect any sort of usability, documentation, or code quality! goals <em>web first</em> Web pages are easily sharable, work on most devices, and are one of the most constrained platforms for applications. Porting to other platforms later on should be easier. <em>small binaries</em> Binary size is important for the web because it affects the responsiveness of page loads and bandwidth costs. The application binary should strive to be small and performant. <em>simple code</em> The best way to end up with a small binary is to focus on simple code. When complexity is necessary, try to move it to compile time or build time. <em>minimal dependencies</em> External dependencies are one of the biggest contributors to large binary sizes. Replace complex third party libraries with simpler pieces of handwritten code when reasonable. contact if you have any questions or comments, contact me on the zig discord. i am happy to chat! -bootra
[]
https://avatars.githubusercontent.com/u/1625198?v=4
minesweeper-zig
Ryp/minesweeper-zig
2021-09-17T09:19:39Z
Simple Minesweeper clone written in Zig, using SDL3 for graphics.
master
0
18
4
18
https://api.github.com/repos/Ryp/minesweeper-zig/tags
MIT
[ "game", "minesweeper", "zig" ]
82
false
2025-03-10T19:15:41Z
true
true
0.14.0
github
[ { "commit": "2bb5f57ea8b8c43eabe514f7bbd3361365ba2ff3", "name": "sdl", "tar_url": "https://github.com/castholm/SDL/archive/2bb5f57ea8b8c43eabe514f7bbd3361365ba2ff3.tar.gz", "type": "remote", "url": "https://github.com/castholm/SDL" } ]
Minesweeper Building This should get you going after cloning the repo: <code>sh $ zig build run -- &lt;size_x&gt; &lt;size_y&gt; &lt;mines&gt;</code> Controls | Action | Key | |--------------|--------------------| | Uncover cell | Left mouse button | | Flag cell | Right mouse button | | Quit game | Escape |
[]
https://avatars.githubusercontent.com/u/124872?v=4
zig-eddsa-key-blinding
jedisct1/zig-eddsa-key-blinding
2022-01-20T21:42:36Z
A Zig implementation of EdDSA signatures with blind keys.
main
0
17
1
17
https://api.github.com/repos/jedisct1/zig-eddsa-key-blinding/tags
MIT
[ "blinding", "ed25519", "eddsa", "zig", "zig-package" ]
5
false
2025-01-18T04:18:25Z
true
false
unknown
github
[]
EdDSA signatures with blind keys A Zig implementation of the <a>EdDSA key blinding</a> proposal. ```zig // Create a standard Ed25519 key pair const kp = try Ed25519.KeyPair.create(null); <code>// Create a random blinding seed var blind: [32]u8 = undefined; crypto.random.bytes(&amp;blind); // Blind the key pair const blind_kp = try BlindEd25519.blind(kp, blind); // Sign a message and check that it can be verified with the blind public key const msg = "test"; const sig = try BlindEd25519.sign(msg, blind_kp, null); try Ed25519.verify(sig, msg, blind_kp.blind_public_key); // Unblind the public key const pk = try BlindEd25519.unblind_public_key(blind_kp.blind_public_key, blind); try std.testing.expectEqualSlices(u8, &amp;pk, &amp;kp.public_key); </code> ```
[]
https://avatars.githubusercontent.com/u/2528778?v=4
svd4zig
rbino/svd4zig
2021-03-24T21:49:31Z
Convert System View Description (svd) files to Zig headers for baremetal development
master
5
17
18
17
https://api.github.com/repos/rbino/svd4zig/tags
Unlicense
[ "embedded", "microcontroller", "svd", "zig" ]
93
true
2024-03-31T03:53:32Z
true
false
unknown
github
[]
svd4zig Generate <a>Zig</a> header files from <a>CMSIS-SVD</a> files for accessing MMIO registers. Features This is a fork of <a>this <code>svd2zig</code></a> that uses the output format based of <a>this other <code>svd2zig</code></a>. It's named <code>svd4zig</code> since it's <code>svd2zig * 2</code>. Features taken from justinbalexander's <code>svd2zig</code>: - This was the one used as a starting point - 100% in Zig - Naming conventions are taken from the datasheet (i.e. all caps), so it's easy to follow along - Strong Assumptions™ in the svd are targeted towards STM32 devices (the original used a STM32F767ZG, this fork was developed with an STM32F407) - The tool doesn't just output registers but also other information about the device (e.g. interrupts) Features taken from lynaghk's <code>svd2zig</code>: - Registers are modeled with packed structs (see <a>this post</a> from the original authors) New features: - Unused bits are manually aligned to 8 bit boundaries to avoid incurring in <a>this bug</a> The entire specification is not completely supported yet, feel free to send pull requests to flesh out the parts of the specification that are missing for your project. Build: <code>zig build -Drelease-safe</code> Usage: <code>./zig-cache/bin/svd4zig path/to/svd/file &gt; path/to/output.zig zig fmt path/to/output.zig</code> Suggested location to find SVD file: https://github.com/posborne/cmsis-svd How to use the generated code: Have a look at <a>this blogpost</a> for all the details, a short example to set and read some registers: ```zig // registers.zig is the generated file const regs = @import("registers.zig"); // Enable HSI regs.RCC.CR.modify(.{ .HSION = 1 }); // Wait for HSI ready while (regs.RCC.CR.read().HSIRDY != 1) {} // Select HSI as clock source regs.RCC.CFGR.modify(.{ .SW0 = 0, .SW1 = 0 }); // Enable external high-speed oscillator (HSE) regs.RCC.CR.modify(.{ .HSEON = 1 }); // Wait for HSE ready while (regs.RCC.CR.read().HSERDY != 1) {} ```
[]
https://avatars.githubusercontent.com/u/5332688?v=4
zig-getopt
dmgk/zig-getopt
2021-05-20T14:17:44Z
POSIX-compatible getopt(3) implementation in Zig
master
2
17
5
17
https://api.github.com/repos/dmgk/zig-getopt/tags
0BSD
[ "option-parser", "option-parsing", "zig", "zig-package", "ziglang" ]
10
false
2025-05-17T02:17:55Z
true
false
unknown
github
[]
Minimal POSIX getopt(3) implementation in Zig This is a minimal, allocation-free getopt(3) implementation with <a>POSIX-conforming</a> argument parsing semantics. Example ```zig const std = @import("std"); const debug = std.debug; const getopt = @import("getopt.zig"); pub fn main() void { var arg: []const u8 = undefined; var verbose: bool = false; <code>var opts = getopt.getopt("a:vh"); while (opts.next()) |maybe_opt| { if (maybe_opt) |opt| { switch (opt.opt) { 'a' =&gt; { arg = opt.arg.?; debug.print("arg = {s}\n", .{arg}); }, 'v' =&gt; { verbose = true; debug.print("verbose = {}\n", .{verbose}); }, 'h' =&gt; debug.print( \\usage: example [-a arg] [-hv] \\ , .{}), else =&gt; unreachable, } } else break; } else |err| { switch (err) { getopt.Error.InvalidOption =&gt; debug.print("invalid option: {c}\n", .{opts.optopt}), getopt.Error.MissingArgument =&gt; debug.print("option requires an argument: {c}\n", .{opts.optopt}), } } debug.print("remaining args: {?s}\n", .{opts.args()}); </code> } ``` <code>$ zig run example.zig -- -hv -a42 foo bar usage: example [-a arg] [-hv] verbose = true arg = 42 remaining args: { foo, bar }</code>
[]
https://avatars.githubusercontent.com/u/8824337?v=4
zvector
pzaino/zvector
2021-07-20T00:56:56Z
An ANSI C Vector library (Dynamic Array) that is fully configurable, fast, thread safe, reentrant, can store dynamic data structures as well as base datatypes and can be used to create dynamic stacks, dynamic queues and more.
main
0
17
4
17
https://api.github.com/repos/pzaino/zvector/tags
MIT
[ "algorithms", "ansi", "arrays", "bsd", "c", "c99", "data-structures", "dynamic-arrays", "dynamic-queue", "dynamic-stack", "embedded", "gcc", "hacktoberfest", "high-performance", "library", "linux", "macos", "vectors", "winodws", "zig" ]
22,716
false
2025-03-21T04:33:58Z
false
false
unknown
github
[]
ZVector <strong>Status:</strong> Still under active development. <code>- Security Tests:</code> <a></a> <a></a> <a></a> <a></a> <a></a> <code>- _________CI/CD:</code> <a></a> (Linux, macOS) This is a fast, configurable, portable, thread safe and reentrant Vector Library (dynamic arrays) in ANSI C 99. You can use ZVector to create: <ul> <li>Dynamic Arrays</li> <li>Dynamic Stacks (LIFO)</li> <li>Dynamic Queues (FIFO) (included priority queues)</li> <li>Dynamic Ordered Queues</li> </ul> The library also offers automatic Secure Data Wiping, so you can use it to store sensitive data. It is also constantly tested for security and bug hunting. Introduction I wrote this library for fun, after watching some presentations on the internet (from different authors) about dynamic arrays in C. What problem does it solve? According to a reading on <a>Wikipedia</a> on the matter of Dynamic Arrays, it seems that there are still no Dynamic Arrays libraries that solve most common limitations of generic dynamic arrays. So, I thought it would be fun to develop a dynamic array library that actually presents high performance also when adding items at the beginning of an array as well as inside, while still maintaining the original high performance when accessing each item using their index. So far, ZVector has resulted in solving the traditional issues presented by Dynamic arrays, and indeed one can use it to create high performance dynamic arrays that stay fast also when adding elements at the beginning of them or inside (check 04PTest001, 04PTest002 and 04PTest003 to see how one can do that). There are other advantages using ZVector instead of regular C Arrays (beside of being dynamic): <ul> <li> For instance, passing a ZVector to a function will NOT lose it's size, so you can safely do this. </li> <li> If you need to do binary searches, the binary search provided with ZVector optimise for each vector (even when you pass them to another function, such optimisation is passed on too!). </li> <li> Fetching items from a ZVector also triggers more checks and so, in general terms, it's safer than fetching data from a regular C Array. </li> <li> ZVector offers a lot more features (described below) than a regular C Array. </li> </ul> Which features does it offer? The library is relatively small, however it comes with some nice features: <ul> <li><strong>All Data Structures support</strong></li> </ul> We can store whatever data structure we want in the vector; we can use our own data structures and/or use standard base types. <ul> <li><strong>Data copy support</strong></li> </ul> When we add an element to the vector it gets copied, so we can safely store elements that we have created as local (aka not using the heap). If you instead, need passing values by reference, then you can configure a vector to do so. <ul> <li><strong>Secure Data Wipe support</strong></li> </ul> We can set a vector to be securely wiped (there is a flag for that), and when we do that, the library will automatically zero out all the bytes that composed the element that is being removed or the entire old vector when a new vector is being created after an expansion. <ul> <li><strong>Vector Properties</strong></li> </ul> We can configure a set of properties for each vector we create using ZVector. The library will then manipulate and update the vector according to its properties. Read the User Guide for a complete list of all available properties. <ul> <li><strong>Thread Safe</strong></li> </ul> The library is also Thread Safe, so if our code is multi-threaded we can use this library without having to do complicated code. The mutex is also applied for each specific vector and only when it's required, so when two threads try to modify two different vectors there are no performance penalties at all. <ul> <li><strong>Reentrant</strong></li> </ul> The library should be fully reentrant, so changes are made available only when the full set of actions have been completed. Also, the library functions do not use global state. <ul> <li><strong>Configurable feature-set</strong></li> </ul> For example: if you are working on a single threaded application, you can easily disable the extra thread safe code, making so the library smaller and faster. To configure the library, check the <code>zvector_config.h</code> and the <code>Makefile</code>. <ul> <li><strong>Suitable for Embedded and IoT applications</strong></li> </ul> The library is suitable also for Embedded and IoT coding, when compiled without thread safe code. <ul> <li><strong>Suitable for low memory devices</strong></li> </ul> For low memory devices the library supports also a vector shrinking function to avoid any possible memory waste. <ul> <li><strong>Stack and Queue behavior support</strong></li> </ul> We can also use the vector as a dynamic stack (FIFO) structure. Or we can use it to create Queues (LIFO) structures (including priority queues). <ul> <li><strong>Elements swapping support</strong></li> </ul> The library comes with a handy reentrant and thread safe swap function that can swap elements in the vector (<code>vect_swap</code>), a <code>vect_swap_range</code> to swap a range of values in a vector and many more useful data manipulation functions (including vector rotation and more). <ul> <li><strong>Single call to apply a function to the entire vector</strong></li> </ul> The library supports a single call to apply a C function to each and every item in a vector, very handy in many situations (<code>vect_apply</code>). It also supports "conditional function application" to an entire vector (<code>vect_apply_if</code>) and a handy <code>vect_apply_range</code> which applies a user function to a range of values in a vector. <ul> <li><strong>Bulk Data copy, move, insert and merge support</strong></li> </ul> ZVector comes with 4 handy calls to copy one vector into another, or move it into another, merge it with another and bulk-insert items from a vector to another. These functions are also optimised for speed. <ul> <li><strong>Custom QuickSort and Improved Adaptive Binary Search</strong></li> </ul> ZVector comes with a custom QuickSort algorithm that uses 3 ways partitioning for very fast ordering of a vector. It also comes with an improved Adaptive Binary Search algorithm for very fast record search. Both of them support custom user compare functions, so ordering and searches can be done for every possible type of records. <ul> <li><strong>CI/CD support</strong></li> </ul> The library comes with its own Unit and Integration tests that are built and executed systematically with each library build and that can be extended automatically just by adding new C files in the <code>tests</code> directory (the make process will detect them, build them automatically and execute them at every build). <ul> <li><strong>GitHub code test automation</strong></li> </ul> This library is continuously tested on GitHub (check above the CodeQL badge) at every commit and pull request. More features will be added over time as well as I constantly seek to improve its performance. How does it work? It's very simple, it's an ANSI C99 library, no funky dependencies, so, it should compile everywhere (let me know if you find any issues). ZVector uses a <code>p_vector</code> struct (everything that begins with a <code>p_</code> in zvector is "private") to represent a dynamic array of arbitrary items. The library tries to hide the <code>p_vector</code> data structure (the public type is called <code>vector</code>), this to make it easier to use the library and improve clean coding where possible. Given that, a typical size for a cache line is usually 64 Bytes (16 words), p_vector is optimized for such type of caches and so, an entire vector struct should take 1 single line in a cache, plus the number of pointers to user data. The user decides which type of items (between regular base types or custom types or data structures, etc.), the initial capacity of a vector and its properties. Properties can be expressed as a set of flags, for example: <code>ZV_BYREF | ZV_SEC_WIPE</code> will set a vector with both these two properties on. Turning on a property simply means asking ZVector to automatically deal with that specific property. So enabling <code>ZV_SEC_WIPE</code> means that ZVector itself will handle secure data wipe of the data stored in a vector when such data is no longer needed. When a vector gets extended, it also may gets its data copied into the new larger vector, however, to improve performances, ZVector only maintains and copies an "array of pointers" to such data (so the actual user data is untouched) and the functions that perform such copy are optimized for memory bandwidth to improve performance. How do I use it? To learn the API have a look at the <code>zvector.h</code> file in the <code>src</code> directory. To learn how to use it have a look at the test code in <code>tests</code> directory. I wrote a full User Guide <a>here</a> and trying to keep it up-to-date. As general rules: Add the <code>zvector.h</code> to your C code with: ```C include "zvector.h" ``` When compiling, make sure you link your code to the <code>libvector.a</code> as shown in the <code>Makefile</code> for the tests (in <code>tests</code>). Before you can use a vector, you need to create one using the function: <code>C vect_create([initial elements], sizeof([your data structure]), [property flags list])</code> Where: <ul> <li> <code>[initial elements]</code> is an integer number that represent the initial capacity of your vector, for example 16 </li> <li> <code>[your data structure]</code> is the name of your data structure that you want to store in the vector and correct C modifiers to ensure sizeof returns the correct size of your data structure or base type. </li> <li> <code>[property flags list]</code> is a set of flags that will set the properties of your vector in a typical C flag set fashion, for example: <code>ZV_BYREF | ZV_SEC_WIPE</code> </li> </ul> Example: <code>C vector v = vect_create(8, sizeof(int), ZV_SEC_WIPE);</code> Will create a vector with an initial size of 8 elements, that can store integer values and that has as property secure wipe set, so whenever you'll remove a number from your vector that original location will be securely wiped. One important note for beginners is that whenever you try to store some data in the vector, please remember: <ul> <li>If you have defined such data as a pointer then you can just use the data name, so, for example: <code>vect_add( myvector, myDataPointer )</code></li> <li>If instead you have defined your data as a regular variable for example, then you need to pass it to the add function with an <code>&amp;</code> before its name, so something like <code>vect_add( myvector, &amp;myInt )</code></li> </ul> Don't worry, in both cases the actual data contained in your reference will be copied (aka stored) in the vector (unless you've specified as your vector's property ZV_BYREF), so if you free your reference or leave the function that defined it (as long as the vector scope is above such function), the data you've stored in the vector will persist. For the complete and up-to-date User Guide please click <a>here</a>. How do I build it? GCC or CLang This has been tested on different Linux distributions, Apple macOS, FreeBSD, NetBSD, OpenBSD. It should also work on Free RTOS and ARM Embed OS. if you have GCC or CLang installed then use the Makefile provided, to build: <code>bash make</code> And to build and run the tests: <code>bash make tests</code> To install the static library and headers use: <code>bash make install</code> Note for CLang users on Linux: please check the Makefile before trying to build with clang and replace the value of variable <code>CC:=gcc</code> with <code>CC:=clang</code>. Using zig compiler If you have zig installed, then you can build the library using zig, just edit the Makefile and set the variable <code>CC:=zig cc</code>, then add the specific target to CFLAGS and P_CFLAGS as follows: ```makefile Configure desired compiler: CC:=zig cc Configure additional compiler and linker flags: CFLAGS+= -target aarch64-macos-none LDFLAGS+= Flags to be used only for release or production builds: P_CFLAGS:= -O3 -target aarch64-macos-none ``` target can be any of the supported targets by zig, for example: <code>aarch64-macos-none</code>, <code>x86_64-linux-gnu</code>, <code>x86_64-windows-gnu</code>, <code>x86_64-windows-msvc</code>, <code>x86_64-fuchsia</code>, <code>x86_64-netbsd</code>, <code>x86_64-freebsd</code>, <code>x86_64-openbsd</code>, <code>x86_64-solaris</code>, <code>x86_64-apple-darwin</code>, <code>x86_64-pc-windows-msvc</code> etc. Then build with: <code>bash make</code> and install with <code>bash make install</code> Visual Studio If you use Microsoft Windows, then you can open the project in Visual Studio 2019 or 2022 and build it using Visual Studio Build function. Other C Compilers At the moment I started to add support for different compilers which include NORCROFT C, HPC, IBM C and quite few others which should also allow to use ZVector on Operating Systems like OS/2 (ArkaOS), Haiku OS, RISC OS, old Windows, Amiga OS, Atari TOS / EmuTOS, OS-9, IBM AIX and AS-400 and more. I'll add support for other compilers when I'll have time. For more details, pre-requisites and whatnot please check the User Guide <a>here</a> Performance ZVector is already really fast, however, if one wants to gain even more performance out of it, you can: <ul> <li>Create large arrays from the beginning</li> <li>If your app is multi-threaded:</li> <li>If it does a lot of sequential calls to <code>vect_add()</code> or <code>vect_remove()</code> then try to use the user locks before starting your loop of calls to vect_add or vect_remove. To use the user locks have a look at the User Guide for the function <code>vect_lock()</code> and <code>vect_unlock()</code>.</li> <li>If you can, then use local vectors to your thread to process thread data, and when processing is completed, use <code>vect_move()</code> or <code>vect_merge()</code> to merge your local vector items to your global vector. This will reduce concurrency and increase parallelism. If you use this approach you can also improve performances even more by setting the local vector property <code>VECT_NOLOCKING</code>, so each vect_add etc. operation will not lock on the local vector. See 04PTest005 for more details on how to use this technique.</li> <li>Try to use ZVector in conjunction with jemalloc or other fast memory allocation algorithms like tcmalloc etc.</li> <li>To run a quick test with jemalloc for example, if you have it installed in <code>/usr/lib64/</code>, then run:</li> </ul> <code>bash LD_PRELOAD=/usr/lib64/libjemalloc.so.2 time ./tests/bin/04PTest001</code> Please note: when using libraries like jemalloc and similar, performance improvements will depend a lot on the system architecture you're using to test your code. So, do not expect the same performance improvements on an old Atom CPU compared to a more modern AMD Zen3 ;) To have an idea of the performance, you can use the following tests that come with ZVector: <ul> <li> 04PTest005 This test spins 16 threads, 8 producers and 8 consumers, and they all work in parallel. This happens because each producer and consumer works on a local vector that is derived from the global vector in chunks. So the only concurrency is when a chunk of items (all at once) is either moved from a local vector to the global vector or is fetched from the global vector into a local vector. This technique helps a lot to improve Amdahl's law constraints on the matter of parallelism. If you have a look at the test code, ZVector handles all the complexity of using multi-threading, so one can simply use local structures and let ZVector deal with locking mechanisms and concurrency complexity. When you run this test using jemalloc or tcmalloc you reduce the critical sections time even more improving both performance and parallelism. You can easily increase the number of threads in this test to your like, need. Look at the source for more details. </li> <li> 04PTestX All the tests that starts with 04PTest are generic performance tests, and they try to measure specific costs of each activity in the library. </li> </ul> If you do not need the Thread Safe code in your own projects, then you can disable it from the Makefile (have a look at the file for details). Disabling the Thread Safe code will make the library even faster. If you do not need all the features offered by the library, you can disable subsets of the features. This will allow the library binary to be even smaller than it is now (on an ARM it's roughly 40KB) and that can help with caching the entire library. How much data can I store in this? ZVector, by default, uses unsigned int 32 bit (<code>uint32_t</code>)for the vector index (<code>vect_index</code>), so the amount of possible storage available per each vector is huge. If needed you can also reconfigure this using unsigned integers 64bit have a look at the file <code>zvect_config.h</code> for this. Of course for IoT, embedded devices and retrocomputing Operating Systems, you can change the default behavior to use smaller indexes too, for instance using unsigned int 16bit for old 16bit Architectures. Again changing this is really simple, just redefine the typedef for <code>zvect_index</code> in the <code>zvect_config.h</code> How small can I make this library? So, if you want to use it for embedded software developments and IoT, I have shrunk release 1.0.0 RC7 down to 17KB on ARM AArch64. To achieve similar results, you just need to configure the <code>Makefile</code> as follows: <ul> <li>Replace the values in <code>P_CFLAGS</code> with just <code>-Os</code> if you're using GCC or clang</li> <li>Disable ALL the extensions in the extension section of the Makefile</li> <li>Compile as explained above and check the results</li> </ul> Can I use it in my own commercial applications? Yes, absolutely. The library is distributed with the MIT license, so please have a look at the <a>LICENSE</a> file for details. A final note Have fun and happy coding, and if you'd like, drop me a line telling me how you've used this library in your own projects, Thanks! Contributors
[]
https://avatars.githubusercontent.com/u/124872?v=4
zig-hpke
jedisct1/zig-hpke
2021-03-30T19:36:34Z
HPKE implementation for Zig.
master
1
17
4
17
https://api.github.com/repos/jedisct1/zig-hpke/tags
MIT
[ "crypto", "hpke", "zig", "zig-package" ]
36
false
2025-03-25T05:56:13Z
true
true
unknown
github
[]
HPKE for Zig <code>zig-hpke</code> is an implementation of the <a>Hybrid Public Key Encryption</a> (HPKE) scheme. Usage Bounded arrays This code heavily relies on the <code>std.BoundedArray</code> type: a type to store small, variable-sized slices whose maximum size is known. Keys are typically represented using that type, whose raw slice can be accessed with the <code>constSlice()</code> function (for a constant slice), or <code>slice()</code> (for a mutable slice). Suite instantiation <code>zig const suite = try Suite.init( primitives.Kem.X25519HkdfSha256.id, primitives.Kdf.HkdfSha256.id, primitives.Aead.Aes128Gcm.id, );</code> Key pair creation <code>zig const kp = try suite.generateKeyPair();</code> Client: creation and encapsulation of the shared secret A <em>client</em> initiates a connexion by sending an encrypted secret; a <em>server</em> accepts an encrypted secret from a client, and decrypts it, so that both parties can eventually agree on a shared secret. ```zig var client_ctx_and_encapsulated_secret = try suite.createClientContext(server_kp.public_key.slice(), "info", null, null); var client_ctx = client_ctx_and_encapsulated_secret.client_ctx; var encapsulated_secret = client_ctx_and_encapsulated_secret.encapsulated_secret; ``` <ul> <li><code>encapsulated_secret.encapsulated</code> needs to be sent to the server. <code>encapsulated_secret.encapsulated.secret</code> must remain secret.</li> <li><code>client_ctx</code> can be used to encrypt/decrypt messages exchanged with the server.</li> </ul> To improve misuse resistance, this implementation uses distinct types for the client and the server context: <code>ClientContext</code> for the client, and <code>ServerContext</code> for the server. Server: decapsulation of the shared secret <code>zig var server_ctx = try suite.createServerContext(encapsulated_secret.encapsulated.constSlice(), server_kp, "info", null);</code> <ul> <li><code>server_ctx</code> can be used to encrypt/decrypt messages exchanged with the client</li> <li>The last parameter is an optional pre-shared key.</li> </ul> Encryption of a message from the client to the server A message can be encrypted by the client for the server: <code>zig client_ctx.encryptToServer(&amp;ciphertext, message, ad);</code> Nonces are automatically incremented, so it is safe to call this function multiple times within the same context. Last parameter is optional associated data. The ciphertext is <code>client_ctx.tagLength()</code> bytes larger than the message. Decryption of a ciphertext received by the server The server can decrypt a ciphertext sent by the client: <code>zig var message2: [message.len]u8 = undefined; try server_ctx.decryptFromClient(&amp;message2, &amp;ciphertext, ad);</code> Last parameter is optional associated data. The message length is <code>server_ctx.tagLength()</code> bytes shorter than the ciphertext. Encryption of a message from the server to the client A message can also be encrypted by the server for the client: <code>zig server_ctx.encryptToClient(&amp;ciphertext, message, ad);</code> Nonces are automatically incremented, so it is safe to call this function multiple times within the same context. Last parameter is optional associated data. Decryption of a ciphertext received by the client The client can decrypt an encrypted response from the server: <code>zig try client_ctx.decryptFromServer(&amp;message2, &amp;ciphertext, ad);</code> Last parameter is optional associated data. Authenticated modes Authenticated modes, with or without a PSK are supported. See <code>createAuthenticatedClientContext</code> and <code>createAuthenticatedServerContext</code>. Exporter secret The exporter secret can be obtained with the <code>exportedSecret()</code> function available both in the <code>ServerContext</code> and <code>ClientContext</code> structures: <code>zig const exporter = client_ctx.exporterSecret().constSlice();</code> Key derivation <code>zig const secret1 = try client_ctx.exportSecret("description 1") const secret2 = try server_ctx.exportSecret("description 2");</code> Access the raw cipher interface <code>zig const aead = suite.aead;</code> That's it!
[]
https://avatars.githubusercontent.com/u/2389051?v=4
zig-fuzzing-example
squeek502/zig-fuzzing-example
2021-09-20T03:58:59Z
An example of fuzzing Zig code with AFL++
master
1
16
1
16
https://api.github.com/repos/squeek502/zig-fuzzing-example/tags
0BSD
[ "example-project", "fuzz-testing", "fuzzing", "zig" ]
5
false
2025-04-09T10:19:25Z
true
false
unknown
github
[]
zig-fuzzing-example A simple example project demonstrating one of the methods for fuzzing <a>Zig</a> code detailed in the blog post <a>'Fuzzing Zig Code with AFL++'</a>. Requires <a><code>afl++</code></a> with <code>afl-clang-lto</code> to be installed. Building <ul> <li>Clone this repository</li> <li>Run <code>zig build fuzz</code></li> </ul> Fuzzing After building, run: <code>afl-fuzz -i test/input -o test/output -- ./zig-out/bin/fuzz</code> You should quickly see results like: <code>total execs : 44.4k │ total crashes : 4279 (2 unique)</code> Once the crashes are found, full stack traces can be gotten with the <code>fuzz-debug</code> executable (your crash will likely be named differently): <code>sh $ ./zig-out/bin/fuzz-debug &lt; 'test/output/default/crashes/id:000000,sig:06,src:000000,time:2,op:havoc,rep:8' error(gpa): memory address 0x7ffff7ff8000 leaked: /home/ryan/Programming/zig/zig-fuzzing-example/src/example.zig:10:36: 0x207e80 in .example.parse (fuzz-debug) _ = try allocator.alloc(u8, 10); ^ /home/ryan/Programming/zig/zig-fuzzing-example/test/fuzz.zig:25:22: 0x205e52 in main (fuzz-debug) try example.parse(allocator, data); ^ ...</code>
[]
https://avatars.githubusercontent.com/u/5332688?v=4
zig-uuid
dmgk/zig-uuid
2021-05-22T22:24:06Z
Fast, allocation-free v4 UUIDs in Zig
master
7
16
11
16
https://api.github.com/repos/dmgk/zig-uuid/tags
0BSD
[ "uuid", "uuid-generator", "uuidv4", "zig", "zig-package", "ziglang" ]
8
false
2024-10-08T02:43:54Z
true
false
unknown
github
[]
Fast, allocation-free v4 UUIDs in Zig Example ```zig const std = @import("std"); const UUID = @import("uuid.zig").UUID; pub fn main() !void { // generate const uuid1 = UUID.init(); std.debug.print("{}\n", .{uuid1}); <code>// parse const uuid2 = try UUID.parse("3df6f0e4-f9b1-4e34-ad70-33206069b995"); std.debug.print("{}\n", .{uuid2}); </code> } ``` <code>$ zig run example.zig 78c33481-4c67-4202-ba8d-11ee1dfaad24 3df6f0e4-f9b1-4e34-ad70-33206069b995</code> Tests <code>bash zig test uuid.zig</code> <code>bash Test [3/3] test.check to_string works... First call to_string 851d0256-c62c-43b0-bf15-71da00bafb30 Second call to_string 851d0256-c62c-43b0-bf15-71da00bafb30 All 3 tests passed.</code>
[]
https://avatars.githubusercontent.com/u/124872?v=4
zig-blind-rsa-signatures
jedisct1/zig-blind-rsa-signatures
2021-02-23T21:52:31Z
Blind RSA signatures implementation for Zig.
main
0
16
1
16
https://api.github.com/repos/jedisct1/zig-blind-rsa-signatures/tags
Apache-2.0
[ "blind", "blind-signatures", "rsa", "rsa-blind-signatures", "rsa-blinded-signatures", "signatures", "zig", "zig-package" ]
287
false
2025-04-09T10:17:54Z
true
false
unknown
github
[]
Blind RSA signatures Author-blinded RSASSA-PSS RSAE signatures. This is an implementation of the <a>RSA Blind Signatures</a> RFC. Also includes a preliminary implementation of the <a>Partially Blind RSA Signatures</a> draft. Protocol overview A client asks a server to sign a message. The server receives the message, and returns the signature. Using that <code>(message, signature)</code> pair, the client can locally compute a second, valid <code>(message', signature')</code> pair. Anyone can verify that <code>(message', signature')</code> is valid for the server's public key, even though the server didn't see that pair before. But no one besides the client can link <code>(message', signature')</code> to <code>(message, signature)</code>. Using that scheme, a server can issue a token and verify that a client has a valid token, without being able to link both actions to the same client. <ol> <li>The client creates a random message, optionally prefixes it with noise, and blinds it with a random, secret factor.</li> <li>The server receives the blind message, signs it and returns a blind signature.</li> <li>From the blind signature, and knowing the secret factor, the client can locally compute a <code>(message, signature)</code> pair that can be verified using the server's public key.</li> <li>Anyone, including the server, can thus later verify that <code>(message, signature)</code> is valid, without knowing when step 2 occurred.</li> </ol> The scheme was designed by David Chaum, and was originally implemented for anonymizing DigiCash transactions. Dependencies This implementation requires OpenSSL or BoringSSL. Usage ```zig // [SERVER]: Generate a RSA-2048 key pair const kp = try BlindRsa(2048).KeyPair.generate(); defer kp.deinit(); const pk = kp.pk; const sk = kp.sk; <code>// [CLIENT]: create a random message and blind it for the server whose public key is `pk`. // The second parameter determines whether noise should be added to the message. // `true` adds noise, and returns it as `blinding_result.msg_randomizer` // `false` doesn't prefix the message with noise. // The client must store the message, the optional noise, and the secret. const msg = "msg"; var blinding_result = try pk.blind(msg, true); // [SERVER]: compute a signature for a blind message, to be sent to the client. // The client secret should not be sent to the server. const blind_sig = try sk.blindSign(blinding_result.blind_message); // [CLIENT]: later, when the client wants to redeem a signed blind message, // using the blinding secret, it can locally compute the signature of the // original message. // The client then owns a new valid (message, signature) pair, and the // server cannot link it to a previous(blinded message, blind signature) pair. // Note that the finalization function also verifies that the new signature // is correct for the server public key. // The noise parameter can be set to `null` if the message wasn't prefixed with noise. const sig = try pk.finalize(blind_sig, blinding_result.secret, blinding_result.msg_randomizer, msg); // [SERVER]: a non-blind signature can be verified using the server's public key. try pk.verify(sig, blinding_result.msg_randomizer, msg); </code> ``` Deterministic padding is also supported with the <code>BlindRsaDeterministic</code> type: <code>zig const BRsa = BlindRsaDeterministic(2048); const kp = BRSA.KeyPair.generate(); ...</code> For specific use cases, custom hash functions and salt lengths are also accessible via the <code>BlindRsaCustom</code> type. <code>zig const BRsa = BlindRsaCustom(2048, .sha256, 48); const kp = BRSA.KeyPair.generate(); ...</code> Some helper functions are also included for key serialization and deserialization. For other languages <ul> <li><a>Rust</a></li> <li><a>C</a></li> <li><a>Go</a></li> </ul>
[]
https://avatars.githubusercontent.com/u/10093365?v=4
coreutils-zig
Daimanta/coreutils-zig
2021-09-16T21:47:23Z
Coreutils recreated in Zig
master
2
16
1
16
https://api.github.com/repos/Daimanta/coreutils-zig/tags
GPL-3.0
[ "coreutils", "zig" ]
341
false
2025-04-13T19:17:18Z
true
false
unknown
github
[]
coreutils-zig This project aims to reimplement the GNU Coreutils in Zig. As of this moment it is nothing more than a hobby project and it serves as a playground for programming in Zig, testing the capabilities of the language. The goal of the project is the implementation of all commands of the GNU Coreutils collection in Zig. In an ideal situation, this includes no dependency on libc. Bundles coreutils-zig is built using the help of the following dependencies: - 'zig-datetime' created by 'Jairus Martin'.
[]
https://avatars.githubusercontent.com/u/87844133?v=4
zig-toolsets
vezel-dev/zig-toolsets
2021-06-14T15:02:44Z
The Zig compiler and standard library packaged for use in MSBuild.
master
6
16
0
16
https://api.github.com/repos/vezel-dev/zig-toolsets/tags
0BSD
[ "build", "c", "cpp", "dotnet", "msbuild", "zig" ]
277
false
2025-05-14T12:26:02Z
false
false
unknown
github
[]
Zig Toolsets <strong> The Zig compiler and standard library packaged for use in MSBuild. </strong> [![License](https://img.shields.io/badge/license-0BSD%20AND%20MIT-brown)](LICENSE-0BSD) [![Commits](https://img.shields.io/github/commit-activity/m/vezel-dev/zig-toolsets/master?label=commits&amp;color=slateblue)](https://github.com/vezel-dev/zig-toolsets/commits/master) [![Build](https://img.shields.io/github/actions/workflow/status/vezel-dev/zig-toolsets/build.yml?branch=master)](https://github.com/vezel-dev/zig-toolsets/actions/workflows/build.yml) [![Discussions](https://img.shields.io/github/discussions/vezel-dev/zig-sdk?color=teal)](https://github.com/vezel-dev/zig-sdk/discussions) [![Discord](https://img.shields.io/badge/discord-chat-7289da?logo=discord)](https://discord.gg/wtzCfaX2Nj) [![Zulip](https://img.shields.io/badge/zulip-chat-394069?logo=zulip)](https://vezel.zulipchat.com) This project packs and distributes the <a>Zig</a> compiler and standard library in a set of NuGet packages for each platform that .NET runs on. These packages are mainly used by the <a>Zig SDK</a> but can also be used by other projects. <ul> <li>For every official release of Zig, a set of NuGet packages with the name pattern <code>Vezel.Zig.Toolsets.&lt;rid&gt;</code> is published, where <code>&lt;rid&gt;</code> is replaced with <code>linux-arm64</code>, <code>osx-x64</code>, <code>win-x86</code>, etc.</li> <li>Only the RIDs that .NET runs on are covered (so e.g. <code>Vezel.Zig.Toolsets.linux-x86</code> is <em>not</em> available).</li> <li>The package version matches the official Zig release's version, with an extra fourth component added indicating the packaging version.</li> </ul> Usage This project offers the following packages: | Package | Description | Downloads | | -: | - | :- | | <a></a> | Provides the toolset for the <code>linux-arm</code> build platform. | | | <a></a> | Provides the toolset for the <code>linux-arm64</code> build platform. | | | <a></a> | Provides the toolset for the <code>linux-ppc64le</code> build platform. | | | <a></a> | Provides the toolset for the <code>linux-riscv64</code> build platform. | | | <a></a> | Provides the toolset for the <code>linux-x64</code> build platform. | | | <a></a> | Provides the toolset for the <code>osx-arm64</code> build platform. | | | <a></a> | Provides the toolset for the <code>osx-x64</code> build platform. | | | <a></a> | Provides the toolset for the <code>win-arm64</code> build platform. | | | <a></a> | Provides the toolset for the <code>win-x64</code> build platform. | | | <a></a> | Provides the toolset for the <code>win-x86</code> build platform. | | To install a package, run <code>dotnet add package &lt;name&gt;</code>. The following MSBuild properties will be injected into your project: <ul> <li><code>ZigToolsetPath</code>: Path to the extracted toolset package directory in the NuGet package cache.</li> <li><code>ZigExePath</code>: Path to the Zig compiler executable (<code>zig</code> or <code>zig.exe</code>).</li> <li><code>ZigLibPath</code>: Path to the Zig standard library.</li> <li><code>ZigDocPath</code>: Path to the Zig standard library documentation.</li> </ul> Building You will need the .NET SDK installed. Simply run <code>./cake</code> (a <a>Bash</a> script) to build artifacts. Note that, on Windows, you must have a <code>tar</code> program capable of extracting <code>.tar.xz</code> archives. For example, <code>tar</code> from <a>Git for Windows</a> or <a>MSYS2</a> will satisfy this requirement. License This project is licensed under the terms found in <a><code>LICENSE-0BSD</code></a>. The Zig compiler and standard library are licensed under the terms found in <a><code>LICENSE-MIT</code></a>. The Zig logo is licensed under the terms found in <a><code>LICENSE-CC-BY-SA-4.0</code></a>.
[]
https://avatars.githubusercontent.com/u/2286349?v=4
zig-bitjuggle
leecannon/zig-bitjuggle
2021-06-27T18:01:20Z
Various "bit juggling" helpers and functionality
master
0
16
1
16
https://api.github.com/repos/leecannon/zig-bitjuggle/tags
MIT
[ "zig", "zig-library", "zig-package", "ziglang" ]
68
false
2025-05-12T20:27:41Z
true
true
0.14.0-dev.3445+6c3cbb0c8
github
[]
zig-bitjuggle This package contains various "bit juggling" helpers and functionality: <ul> <li><code>isBitSet</code> - Check if a bit is set</li> <li><code>getBit</code> - Get the value of a bit</li> <li><code>getBits</code> - Get a range of bits</li> <li><code>setBit</code> - Set a specific bit</li> <li><code>setBits</code> - Set a range of bits</li> <li><code>Bitfield</code> - Used along with <code>extern union</code> to represent arbitrary bit fields</li> <li><code>Bit</code> - Used along with <code>extern union</code> to represent bit fields</li> <li><code>Boolean</code> - Used along with <code>extern union</code> to represent boolean bit fields</li> </ul> Installation Add the dependency to <code>build.zig.zon</code>: <code>sh zig fetch --save git+https://github.com/leecannon/zig-bitjuggle</code> Then add the following to <code>build.zig</code>: <code>zig const bitjuggle = b.dependency("bitjuggle", .{}); exe.root_module.addImport("bitjuggle", bitjuggle.module("bitjuggle"));</code>
[]
https://avatars.githubusercontent.com/u/4252848?v=4
wasmparser
Luukdegram/wasmparser
2021-05-26T18:36:36Z
Wasm binary parser for Zig
master
1
16
4
16
https://api.github.com/repos/Luukdegram/wasmparser/tags
MIT
[ "binary-parser", "parser", "wasm", "wasm-bytecode", "wasm-parser", "wasmparser", "zig", "ziglang" ]
67
false
2025-02-27T00:31:27Z
true
false
unknown
github
[]
Zig WASM parser Parsing library implementing the wasm spec. To be used for projects written in <a>zig</a>. The goal of this library is to kickstart wasm-related projects in the Zig ecosystem. It will try to stay on top of the latest wasm proposals and implement those. Currently it only provides a single <code>parse</code> function that accepts any reader into wasm source bytes. In the future, more options such as a state-driven parser will be added that allows for better integration with CLI's and tools to provide more information to the caller. example ```zig const wasmparser = @import("wasmparser"); var result = try wasmparser.parse(allocator, some_reader); defer result.deinit(allocator); // allows for memory cleanup const module = result.module; // access the parsed Module //get first export const first_export_name = module.exports[0].name; ```
[]
https://avatars.githubusercontent.com/u/3932972?v=4
ftz
ikskuh/ftz
2021-02-24T09:17:13Z
A simple cross-platform file transfer utility
master
2
16
2
16
https://api.github.com/repos/ikskuh/ftz/tags
-
[ "file-transfer", "network", "networking", "tool", "zig", "ziglang" ]
26
false
2025-05-17T15:37:57Z
true
false
unknown
github
[]
ftz A small and simple file transfer utility. <strong>Features:</strong> - Upload and download files - Server can chose to provide only downloads or uploads - Clients are restricted to the subfolders, no way to break out. - Native cross platform support (Windows, Linux, MacOS, BSDs) - Static, small binary (207K on Linux, 128K on Windows, 123K on MacOS) <strong>Usage:</strong> ``` ftz [verb] Quickly transfer files between two systems connected via network. Verbs: ftz help Prints this help ftz host [path] [--get-dir path] [--put-dir path] [--port num] Hosts the given directories for either upload or download. path If given, sets both --get-dir and --put-dir to the same directory. --get-dir path Sets the directory for transfers to a client. No access outside this directory is allowed. --put-dir path Sets the directory for transfers from a client. No access outside this directory is allowed. --port num Sets the port where ftz will serve the data. Default is 17457 ftz get [--output file] [uri] Fetches a file from [uri] into the current directory. The file name will be the file name in the URI. uri The uri to the file that should be downloaded. --output file Saves the resulting file into [file] instead of the basename of the URI. ftz put [file] [uri] Uploads [file] (a local path) to [uri] (a ftz uri) ftz version Prints the ftz version. Examples: ftz host . Open the current directory for both upload and download. ftz put debug.log ftz://device.local/debug.log Uploads debug.log to the server. ftz get ftz://device.local/debug.log Downloads debug.log from the server. ``` Usage / Concept / Design FTZ was designed to transfer files between virtual machines and the host system or different machines on the same local network. It is not designed to be a constantly running server, especially not on the internet and thus has (by design) no authentication, no session resumption or whatsoever. It has an integrity check though to verify if the transfer was successful. Building <a></a> To build <code>ftz</code> you need the lastest zig master (&gt;= <code>0.8.0-dev.1159+d9e46dcee</code>), then invoke: <code>zig build</code> Then fetch your file from <code>zig-cache/bin</code> and use it! URI Format The URI format for FTZ only allows the scheme (<code>ftz://</code>), a hostname and the path. An uri that contains a username, password, query or fragment is invalid and will not be accepted. <strong>Examples:</strong> <code>ftz://random-projects.net/ftz.service ftz://random-projects.net:124/ftz.service</code> Protocol Uses TCP, port 17457 <strong>FETCH:</strong> <code>C: =&gt; "GET $(PATH)\r\n" S: =&gt; "$(MD5SUM)" S: =&gt; "$(DATA)" | connection drop</code> <strong>PUT:</strong> <code>C: =&gt; "PUT $(PATH)\r\n" C: =&gt; "$(MD5SUM)" S: =&gt; nothing | connection drop C: =&gt; "$(DATA)"</code>
[]
https://avatars.githubusercontent.com/u/5973688?v=4
byway
dreinharth/byway
2022-01-06T16:43:53Z
Wayland compositor
main
2
16
0
16
https://api.github.com/repos/dreinharth/byway/tags
MIT
[ "compositor", "wayland", "wayland-compositor", "window-manager", "wlroots", "zig" ]
80
false
2025-01-30T03:54:37Z
true
false
unknown
github
[]
byway byway is a <a>Wayland</a> compositor, inspired by <a>cwm</a>, based on <a>wlroots</a>, and written in <a>Zig</a>. It aims to be concise both visually and in its implementation. Ease of maintenance is also a goal; Zig, wlroots, and Wayland are all moving quickly, and the intent is for byway to keep pace. byway began life as a fork of <a>TinyWL</a>, and borrows significant code from <a>sway</a>. byway is in the early stages of development, and bugs, including crashes, should be expected. However, byway is mostly feature-complete, and development is intended to consist of bug fixes, and adding support for Wayland protocols as needed. Additional features will be considered based on how much value they provide, and whether they can be implemented without significantly expanding the size or complexity of the codebase. Installation First ensure dependencies are installed, and then run <code>zig build</code> with any desired options, e.g. <code>zig build install -Drelease-safe -p ~/.local</code> Dependencies <ul> <li>zig (0.10)</li> <li>wlroots (0.15)</li> <li>wayland</li> <li>wayland-protocols</li> <li>xkbcommon</li> <li>xcb</li> <li>libinput</li> <li>pixman</li> <li>xwayland</li> </ul> Configuration Behavior can be customized via <code>$HOME/.config/byway/config.json</code>. See <a>config.json.example</a> for a sample configuration. <ul> <li><code>tap_to_click</code>: <code>true</code> or <code>false</code></li> <li><code>natural_scrolling</code>: <code>true</code> or <code>false</code></li> <li><code>background_color</code>: array of values between 0 and 1 corresponding to RGBA</li> <li><code>border_color</code>: array of values between 0 and 1 corresponding to RGBA</li> <li><code>focused_color</code>: array of values between 0 and 1 corresponding to RGBA</li> <li><code>grabbed_color</code>: array of values between 0 and 1 corresponding to RGBA</li> <li><code>active_border_width</code>: pixels</li> <li><code>hotkeys</code>: array of <code>{modifiers, key, action, arg}</code>; See below</li> <li><code>mouse_move_modifiers</code>: modifier keys to move a toplevel view with the mouse</li> <li><code>mouse_move_button</code>: button to move a toplevel view with the mouse</li> <li><code>mouse_grow_modifiers</code>: modifier keys to grow or shrink a toplevel view with the mouse</li> <li><code>mouse_grow_button</code>: button to grow or shrink a toplevel view with the mouse</li> <li><code>autostart</code>: array of commands to run on startup</li> <li><code>move_pixels</code>: pixels</li> <li><code>grow_pixels</code>: pixels</li> <li><code>damage_tracking</code>: one of <code>"minimal"</code> (redraws all outputs, but only on updates), <code>"partial"</code> (redraws whole surfaces on updates), and <code>"full"</code> (only redraws damaged areas),</li> </ul> Hotkey Actions: | Action | Description | <code>arg</code> value | | ------ | ----------- | ----------- | | <code>"command"</code> | Executes the command as a child process | command to execute | | <code>"toplevel_to_front"</code> | Raises the toplevel view with keyboard focus to the top of the stack | <code>""</code> | | <code>"toplevel_to_back"</code> | Lowers the toplevel view with keyboard focus to the bottom of the stack | <code>""</code> | | <code>"cycle_groups"</code> | Raises and focuses a window of the next application in the stack | <code>"1"</code> to cycle forward, '"-1" to cycle backward | | <code>"cycle_toplevels"</code> | Raises and focuses the next window of the currently-focused application | <code>"1"</code> to cycle forward, '"-1" to cycle backward | | <code>"move_toplevel"</code> | Moves the toplevel view with keyboard focus in the specified direction | One of <code>"up"</code>, <code>"down"</code>, <code>"left"</code>, <code>"right"</code> | | <code>"grow_toplevel"</code> | Grows or shrinks the toplevel view with keyboard focus by moving the bottom or rightmost edge | <code>"up"</code>, <code>"down"</code>, <code>"left"</code>, <code>"right"</code> | | <code>"close_toplevel"</code> | Closes the toplevel view with keyboard focus | <code>""</code> | | <code>"toggle_fullscreen"</code> | Toggles fullscreen for the toplevel view with keyboard focus | <code>""</code> | | <code>"toggle_spread_view"</code> | Toggles mode to display all toplevel views in a grid for selection | <code>""</code> | | <code>"toggle_hide_toplevels"</code> | Toggles hiding all toplevel views | <code>""</code> | | <code>"switch_to_workspace"</code> | Changes the currently visible workspace | character corresponding to workspace number, <code>"0"</code> to <code>"9"</code> | | <code>"toplevel_to_workspace"</code> | Moves the toplevel view with keyboard focus to the specified workspace | character corresponding to workspace number, <code>"0"</code> to <code>"9"</code> | | <code>"quit"</code> | Quits byway | <code>""</code> | | <code>"chvt"</code> | Changes to the specified virtual terminal | character corresponding to VT, e.g. <code>"1"</code> for tty1 | | <code>"reload_config"</code> | Reloads the configuration from <code>$HOME/.config/byway/config.json</code> | <code>""</code> | Contributing Issues are welcome as are bug fix PRs. New functionality will be considered on a case-by-case basis.
[]
https://avatars.githubusercontent.com/u/53379023?v=4
zig-argon2
x13a/zig-argon2
2021-09-05T20:58:10Z
Argon2 key derivation function in zig.
master
0
15
1
15
https://api.github.com/repos/x13a/zig-argon2/tags
MIT
[ "argon2", "crypto", "zig", "zig-lang" ]
25
false
2023-02-06T17:40:10Z
true
false
unknown
github
[]
zig-argon2 Argon2 key derivation function in zig. Merged: <a>9756</a> Reference <ul> <li><a>rfc</a></li> <li><a>go</a></li> <li><a>c</a></li> </ul>
[]
https://avatars.githubusercontent.com/u/3932972?v=4
zig-gemtext
ikskuh/zig-gemtext
2021-03-05T00:07:29Z
A zig library to manipulate gemini text files
master
0
15
3
15
https://api.github.com/repos/ikskuh/zig-gemtext/tags
MIT
[ "gemini", "gemini-language", "gemini-protocol", "markup", "markup-converter", "parser", "zig", "zig-package", "ziglang" ]
163
false
2025-05-04T21:54:19Z
true
false
unknown
github
[]
Gemini Text Processor This is a library and a tool to manipulate <a>gemini text files</a>. It provides both an easy-to-use API as well as a streaming parser with minimal allocation requirements and a proper separation between temporary allocations required for parsing and allocations for returned text fragments. The library is thoroughly tested with a lot of gemini text edge cases and all (tested) cases are handled reasonably. Features <ul> <li>Fully spec-compliant gemini text parsing</li> <li>Non-blocking streaming parser</li> <li>Provides both a convenient <a>Zig</a> and <a>C</a> API</li> <li>Rendering to several formats</li> <li>Gemini text</li> <li>HTML</li> <li>Markdown</li> <li>RTF</li> </ul> Example This is a simple example that parses a gemini file and converts it into a HTML file. ```zig pub fn main() !void { var document = try gemtext.Document.parse( std.heap.page_allocator, std.io.getStdIn().reader(), ); defer document.deinit(); <code>try gemtext.renderer.html( document.fragments.items, std.io.getStdOut().writer(), ); </code> } ``` More examples can be found the the examples folder: - <code>gem2html</code> (<a>C</a>, <a>Zig</a>) - <code>gem2md</code> (<a>C</a>, <a>Zig</a>) - <code>streaming-parser</code> (<a>C</a>, <a>Zig</a>)
[]
https://avatars.githubusercontent.com/u/54106488?v=4
zig-vala
iddev5/zig-vala
2021-10-23T07:35:58Z
Zig :heart: Vala - Toolchain & Build System Integration
master
0
15
0
15
https://api.github.com/repos/iddev5/zig-vala/tags
-
[ "vala", "zig", "ziglang" ]
5
false
2023-09-30T11:32:19Z
false
false
unknown
github
[]
zig-vala Integration of Vala with Zig('s Build System). Usage The easiest way to use it is to just download <code>ZigValaStep.zig</code> to your project directory. Then include it in your build.zig: <code>zig const ZigValaStep = @import("ZigValaStep.zig");</code> You can create a Vala application as such: <code>zig const vala = ZigValaStep.init(b, "app_name");</code> Add source files: <code>zig vala.addSourceFile("src/main.vala");</code> Next, add all the package dependencies, such as GTK3, for example: <code>zig vala.addPackage("gtk+-3.0);</code> Finally, hook up the executable: <code>zig vala.exe.setTarget(target); vala.exe.setBuildMode(mode); vala.exe.install();</code> License <code>ZigValaStep.zig</code> is licensed under MIT License.
[]
https://avatars.githubusercontent.com/u/2286349?v=4
zriscv
leecannon/zriscv
2021-07-01T13:32:04Z
RISC-V emulator in Zig
master
3
15
0
15
https://api.github.com/repos/leecannon/zriscv/tags
MIT
[ "risc-v", "riscv", "zig", "ziglang" ]
549
false
2024-02-25T01:18:30Z
true
false
unknown
github
[]
zriscv <a></a> RISC-V emulator in Zig What to expect This is the first emulator I've made other than CHIP-8, don't expect high quality nor speed. The only thing that should be expected is mistakes. The focus is on correctness not performance, I'm expecting practically every execution path to be littered with potential optimization opportunities. Goal <ul> <li>RV64GC</li> <li>user, super and machine mode</li> <li>provide a linux userspace emulation similar to qemu's</li> </ul> Progress <ul> <li>[X] RV64I (64-bit Base Integer) <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> M (Multiplication and Division) <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> A (Atomic) <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> F (Single-Precision Floating-Point) <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> D (Double-Precision Floating-Point) <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> Zicsr (Control and Status Register) <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> Zifencei (Instruction-Fetch Fence) <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> C (Compressed Instructions) <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> Counters <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> Machine-Level ISA <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> Supervisor-Level ISA <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> CSRs</li> </ul> Spec The version of the riscv spec used is draft-20220831-bf5a151 released 31/08/2022
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-unicode-ucd
nektro/zig-unicode-ucd
2021-05-31T02:33:29Z
Zig bindings for the Unicode Character Database
master
7
14
0
14
https://api.github.com/repos/nektro/zig-unicode-ucd/tags
MIT
[ "zig", "zig-package" ]
1,862
false
2025-05-21T20:33:29Z
true
false
unknown
github
[]
zig-unicode-ucd <a></a> <a></a> <a></a> <a></a> Zig bindings for the Unicode Character Database Last updated as of Unicode 16.0.0 http://www.unicode.org/reports/tr44/ https://www.unicode.org/versions/latest/ Development <code>zig build run -Dstep=generate zig build run -Dstep=run</code> License Code here is MIT Source data files are https://www.unicode.org/license.html
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-range
nektro/zig-range
2021-05-01T09:16:54Z
A range function to loop over an index without an extra variable.
master
0
14
1
14
https://api.github.com/repos/nektro/zig-range/tags
MIT
[ "zig", "zig-package" ]
4
false
2024-07-28T01:58:50Z
true
false
unknown
github
[]
zig-range <a></a> <a></a> A range function to loop over an index without an extra variable Usage <code>zig for (range(10)) |_, i| { // 'i' will increment from 0 -&gt; 9 }</code> Building Example Program <code>$ zigmod fetch $ zig build</code> Built With <ul> <li>Zig Master &amp; <a>Zigmod Package Manager</a></li> </ul> License MIT
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-json
nektro/zig-json
2021-04-30T05:34:08Z
A JSON library for inspecting arbitrary values
master
0
14
3
14
https://api.github.com/repos/nektro/zig-json/tags
MIT
[ "zig", "zig-package" ]
122
false
2025-05-21T20:33:22Z
true
false
unknown
github
[]
zig-json <a></a> <a></a> <a></a> <a></a> A JSON library for inspecting arbitrary values. Optionally accepts trailing commas. Fully passes https://github.com/nst/JSONTestSuite. Usage See <code>test.zig</code> for examples. Building Example Program <code>$ zigmod fetch $ zig build test</code>
[]
https://avatars.githubusercontent.com/u/1915?v=4
dtb.zig
kivikakk/dtb.zig
2021-02-10T03:54:09Z
parse device tree blobs
main
0
14
7
14
https://api.github.com/repos/kivikakk/dtb.zig/tags
MIT
[ "dtb", "fdt", "zig" ]
98
false
2025-04-11T17:06:35Z
true
true
unknown
github
[]
dtb.zig Parse device tree blob files. <code>zig var qemu_arm64 = try dtb.parse(std.testing.allocator, qemu_arm64_dtb); defer qemu_arm64.deinit(std.testing.allocator);</code> regs and strings ```zig // This QEMU DTB places 512MiB of memory at 1GiB. testing.expectEqualSlices( [2]u64, &amp;.{.{ 1024 * 1024 * 1024, 512 * 1024 * 1024 }}, qemu_arm64.propAt(&amp;.{"memory@40000000"}, .Reg).?, ); // It has an A53-compatible CPU. const compatible = qemu_arm64.propAt(&amp;.{ "cpus", "cpu@0" }, .Compatible).?; testing.expectEqual(@as(usize, 1), compatible.len); testing.expectEqualStrings("arm,cortex-a53", compatible[0]); ``` interrupts and clocks ```zig const pl011 = qemu_arm64.child("pl011@9000000").?; // Its pl011 UART controller has one SPI-type interrupt, IRQ 1, active high // level-sensitive. See https://git.io/JtKJk. const interrupts = pl011.prop(.Interrupts).?; testing.expectEqual(@as(usize, 1), interrupts.len); testing.expectEqualSlices(u32, &amp;.{ 0x0, 0x01, 0x04 }, interrupts[0]); // It defines two clocks named uartclk and apb_pclk, both referring to the // APB's main system clock PCLK at handle 0x8000. const clock_names = pl011.prop(.ClockNames).?; testing.expectEqual(@as(usize, 2), clock_names.len); testing.expectEqualSlices(u8, "uartclk", clock_names[0]); testing.expectEqualSlices(u8, "apb_pclk", clock_names[1]); const clocks = pl011.prop(.Clocks).?; testing.expectEqual(@as(usize, 2), clocks.len); testing.expectEqualSlices(u32, &amp;.{0x8000}, clocks[0]); testing.expectEqualSlices(u32, &amp;.{0x8000}, clocks[1]); ``` no heap? no problem The <code>Traverser</code> type is used internally by the parser, and you can use it too. ```zig var qemu_arm64: Traverser = undefined; try qemu_arm64.init(qemu_arm64_dtb); var state: enum { OutsidePl011, InsidePl011 } = .OutsidePl011; var ev = try qemu_arm64.current(); var reg_value: ?[]const u8 = null; while (ev != .End) : (ev = try qemu_arm64.next()) { switch (state) { .OutsidePl011 =&gt; if (ev == .BeginNode and std.mem.startsWith(u8, ev.BeginNode, "pl011@")) { state = .InsidePl011; }, .InsidePl011 =&gt; switch (ev) { .EndNode =&gt; state = .OutsidePl011, .Prop =&gt; |prop| if (std.mem.eql(u8, prop.name, "reg")) { reg_value = prop.value; }, else =&gt; {}, }, } } std.testing.expectEqualSlices(u8, &amp;.{ 0, 0, 0, 0, 0x09, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10, 0 }, reg_value.?); ``` notes, incomplete Still many prop types are just left unparsed. Please add them as you go! Merge requests happily accepted. Ranges are <code>u128</code>s because a PCIe bus has an <code>#address-cells</code> of 3? What's with that? LICENSE MIT, per <a>Zig</a>.
[]
https://avatars.githubusercontent.com/u/26302304?v=4
gamejam-zig-vulkan
Avokadoen/gamejam-zig-vulkan
2021-11-13T12:56:49Z
A game written in ~1 day using zig and vulkan
main
4
14
0
14
https://api.github.com/repos/Avokadoen/gamejam-zig-vulkan/tags
-
[ "gamejam", "vulkan", "zig" ]
7,047
false
2024-04-02T22:24:50Z
true
false
unknown
github
[]
Zig vulkan gamejam A game written in ~1 day using zig and vulkan Fork of <a>zig_vulkan</a> Build Download latest zig (tested on 0.9.0-dev.1622+71388b980) <code>bash $ git clone https://github.com/Avokadoen/gamejam-zig-vulkan.git $ cd ./gamejam-zig-vulkan $ git submodule init $ git submodule update $ zig build run</code> Result +2k sprites battling it out! (artifacts are from gif compression :( )
[]
https://avatars.githubusercontent.com/u/12878831?v=4
bottom-zig
Deecellar/bottom-zig
2021-11-21T12:14:06Z
🥺
daddy
0
13
1
13
https://api.github.com/repos/Deecellar/bottom-zig/tags
NOASSERTION
[ "zig" ]
1,102
false
2025-02-17T05:40:35Z
true
true
unknown
github
[ { "commit": "968258dc1b1230493d8f1677097c832a3d7e0bd8.tar.gz", "name": "args", "tar_url": "https://github.com/ikskuh/zig-args/archive/968258dc1b1230493d8f1677097c832a3d7e0bd8.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/ikskuh/zig-args" } ]
Bottom-Zig A complete implementation of the Bottom Spec in Zig with both encoding and decoding capabilities. Features <ul> <li>Bottom format encoding/decoding</li> <li>CLI interface compatible with bottom-rs options</li> <li>Static and shared library support</li> <li>WebAssembly build target</li> <li>C API bindings</li> <li>Configurable allocators when targeting zig</li> </ul> Upcoming Features <ul> <li>Speed improvements</li> </ul> Build Options ```bash Basic build zig build Run tests zig build test-exe # CLI tests zig build test-lib # Library tests Install library only zig build install-lib Build WebAssembly zig build wasm-shared Build benchmarks zig build benchmark Run benchmarks zig build run-benchmark ``` Usage As a dependency in your <code>build.zig.zon</code> via zig fetch. use the standard way of adding a module to your project. Bottom CLI Usage ```bash Encode bottom-zig --bottomify "Hello World" # 🫂💖✨✨,,👉👈💖✨✨🫂👉👈💖✨✨,👉👈💖✨,,👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈💖✨,,👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈✨✨,👉👈💖✨✨✨👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈💖✨,,👉👈💖✨✨✨👉👈 Decode bottom-zig --regress "🫂💖✨✨,,👉👈💖✨✨🫂👉👈💖✨✨,👉👈💖✨,,👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈💖✨,,👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈✨✨,👉👈💖✨✨✨👉👈💖✨✨✨,👉👈💖✨✨✨,,👉👈💖✨,,👉👈💖✨✨✨👉👈" # Hello World Use with files bottom-zig --bottomify -i input.txt -o output.txt bottom-zig --regress -i output.txt ``` C API Usage See <code>include/bottom.h</code> for the API definition. For an example of how to use the C API, see <code>src/example.c</code>. Online Demo Try it in WebAssembly: https://deecellar.github.io/bottom-zig/ Binaries Pre-built binaries for Linux, macOS and Windows (x86_64) are available in CI artifacts. License MIT License Thanks to <ul> <li>Andrew for making an awesome language</li> <li>MasterQ32 for making zig args and being awesome</li> <li>der-teufel-programming for saying I should do this</li> <li>=3</li> </ul>
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-oauth2
nektro/zig-oauth2
2021-09-11T02:28:04Z
HTTP handler functions to allow you to easily add OAuth2 login support to your Zig application
master
0
13
1
13
https://api.github.com/repos/nektro/zig-oauth2/tags
MIT
[ "zig", "zig-package" ]
43
false
2025-05-21T20:33:15Z
true
false
unknown
github
[]
zig-oauth2 <a></a> <a></a> <a></a> <a></a> HTTP handler functions to allow you to easily add OAuth2 login support to your Zig application. Supported Providers <ul> <li>Amazon</li> <li>Battle.net</li> <li>Discord</li> <li>Facebook</li> <li>GitHub</li> <li>Google</li> <li>Microsoft</li> <li>Reddit</li> <li>Gitea</li> <li>GitLab</li> <li>Mastodon</li> <li>Pleroma</li> <li>... and custom ones!</li> </ul>
[]
https://avatars.githubusercontent.com/u/16408073?v=4
zig-nestedtext
LewisGaul/zig-nestedtext
2021-02-27T14:56:00Z
Zig NestedText parser library - a simple human readable data format based on YAML
main
8
13
1
13
https://api.github.com/repos/LewisGaul/zig-nestedtext/tags
MIT
[ "nestedtext", "parser", "zig" ]
140
false
2024-09-29T21:22:25Z
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" } ]
zig-nestedtext <a></a> <a></a> A NestedText parser written in Zig 0.13 targeting <a>NestedText v2.0</a> (note <a>Deviations From Specification</a> below). See my <a>Zig NestedText Library blog post</a>. Usage There are a few options for making use of this project: - Download from the <a>releases page</a> - Include as a dependency via git submodules - Clone and build manually, using a static copy of the built artefacts - Use the gyro package manager (untested) - Use the zigmod package manager (untested) The Zig library has no external dependencies. The CLI tool depends only on <code>Clap</code> for command line arg parsing (included as a git submodule under <code>deps/</code>). Run <code>zig build</code> to build the static library <code>libnestedtext.a</code> under <code>zig-out/lib/</code>, which can then be linked with your program. CLI Tool An executable CLI program <code>nt-cli</code> is included for exposing the core functionality of the project. When building with <code>zig build</code> this can be found under <code>zig-out/bin/</code>. This tool can be used to convert between NestedText and JSON, for example: <code>$./zig-out/bin/nt-cli -f samples/employees.nt debug(cli): +0 Starting up debug(cli): +0 Parsed args debug(cli): +1 Finished reading input debug(cli): +1 Parsed NestedText debug(cli): +1 Converted to JSON debug(cli): +1 Stringified JSON {"president":{"name":"Katheryn McDaniel","address":"138 Almond Street\nTopeka, Kansas 20697","phone":{"cell":"1-210-555-5297","home":"1-210-555-8470"},"email":"[email protected]","additional-roles":["board member"]},"vice-president":{"name":"Margaret Hodge","address":"2586 Marigold Lane\nTopeka, Kansas 20682","phone":"1-470-555-0398","email":"[email protected]","additional-roles":["new membership task force","accounting task force"]},"treasurer":[{"name":"Fumiko Purvis","address":"3636 Buffalo Ave\nTopeka, Kansas 20692","phone":"1-268-555-0280","email":"[email protected]","additional-roles":["accounting task force"]},{"name":"Merrill Eldridge","phone":"1-268-555-3602","email":"[email protected]"}]} debug(cli): +1 Exiting with: 0</code> Yes, that took around 1 millisecond ;) And back to NestedText: <code>$./zig-out/bin/nt-cli -f samples/employees.nt | ./zig-out/bin/nt-cli -F json -O nt president: name: Katheryn McDaniel address: &gt; 138 Almond Street &gt; Topeka, Kansas 20697 phone: cell: 1-210-555-5297 home: 1-210-555-8470 email: [email protected] additional-roles: - board member vice-president: name: Margaret Hodge address: &gt; 2586 Marigold Lane &gt; Topeka, Kansas 20682 phone: 1-470-555-0398 email: [email protected] additional-roles: - new membership task force - accounting task force treasurer: - name: Fumiko Purvis address: &gt; 3636 Buffalo Ave &gt; Topeka, Kansas 20692 phone: 1-268-555-0280 email: [email protected] additional-roles: - accounting task force - name: Merrill Eldridge phone: 1-268-555-3602 email: [email protected]</code> Deviations From Specification The amount of deviation from the official NestedText spec is kept to a minimum, however there is one minor case to be aware of (as reflected in the <a>fork of the official testsuite</a> being used to test this project). Where possible these issues are resolved upstream. Note that this project implements a <em>strict subset</em> of the official spec, to avoid compatibility issues. Empty Values in Flow-style Empty values are officially allowed in flow-style NestedText, e.g. <code>{:}</code> -&gt; <code>{"":""}</code>, however this is <em>disallowed</em> by this project. The design choices behind handling for empty values in flow-style are explained in detail at <a>https://zigforum.org/t/zig-nestedtext-release-0-1-0/383/5</a>. This has been discussed with the NestedText creators in GitHub issues (<a>here</a> and <a>here</a>) and over email, and discussions are ongoing. To summarise the rationale behind this deviation: - Flow-style is only provided as a shorthand (and a way to represent empty lists/objects), so can be as strict as desired without preventing representation of arbitrary data. - The spec says that <code>[,]</code> -&gt; <code>[""]</code>, <code>[,,]</code> -&gt; <code>["", ""]</code> etc., where the trailing comma is required to indicate an empty value at the end of the list. - There is no other use for trailing commas in NestedText since flow-style cannot span multiple lines. - At first glance, <code>[,]</code> looks more like a list of <em>two</em> empty values than one. - The language states one of its primary goals as being "<em>easily understood and used by both programmers and non-programmers</em>". - On balance, the author of this project has decided that the potential confusion from the use of trailing commas to indicate empty values is not worth the convenience it brings to more experienced users. If you have any thoughts about this either way, please consider posting a comment to <a>https://github.com/LewisGaul/zig-nestedtext/issues/17</a>. Line Endings Preserved When a string contains newlines, those newlines are preserved from the NestedText content itself. Without this, it is impossible to represent carriage return and newline characters in a platform-independent, implementation-independent way. This has been discussed at <a>https://github.com/KenKundert/nestedtext_tests/issues/5</a>. Changelog See <a>CHANGELOG.md</a>. Development Build with <code>zig build</code> - the library will be under <code>zig-out/lib/</code> and the CLI tool will be under <code>zig-out/bin/</code>. Run the tests with <code>zig build test</code>. Please feel free to propose changes via a PR, but please make sure all tests are passing, and also make sure to run <code>zig fmt .</code> (there are GitHub actions checks for both of these).
[]
https://avatars.githubusercontent.com/u/196042?v=4
sapt
michaelo/sapt
2021-09-15T23:01:03Z
Simple file-oriented API-testing tool
main
0
13
0
13
https://api.github.com/repos/michaelo/sapt/tags
MIT
[ "api", "cli", "curl", "testing", "zig" ]
1,431
false
2025-01-15T21:31:06Z
true
false
unknown
github
[]
sapt - A simple tool for API testing <em>Att: I'm testing different intro-texts to test what communicates the intention the best</em> sapt aims to be a simple tool to help with API-testing and similar use cases. It focuses on making it easy for developers to compose, organize and perform tests/requests in an open, reliable and source-control friendly way. sapt <em>"is not"</em> a full-fledged GUI-based do-anything tool, but rather a focused command line utility. Usage: Basic sapt requires you to organise your requests in individual files. Those files may be gathered in folders to create test suites. testsuite/01-mytest.pi contents: <code>&gt; GET https://api.warnme.no/api/status &lt; 200 </code> Running a single test: <code>% sapt testsuite/01-mytest.pi 1/1 testsuite/01-mytest.pi : OK </code> Help: <code>% sapt -h sapt v1.0.0 - Simple API Tester Usage: sapt [arguments] [file1.pi file2.pi ... fileN.pi] Examples: sapt api_is_healthy.pi sapt testsuite01/ sapt -b=myplaybook.book sapt -i=generaldefs/.env testsuite01/ Arguments: --colors=auto|on|off Set wether to attempt to use colored output or not --delay=NN Delay execution of each consecutive step with NN ms -e, --early-quit Abort upon first non-successful test -h, --help Show this help and exit --help-format Show details regarding file formats and exit -i=file, --initial-vars=file Provide file with variable-definitions made available to all tests --insecure Don't verify SSL certificates -m, --multithread Activates multithreading - relevant for repeated tests via playbooks -p, --pretty Try to format response data based on Content-Type. Naive support for JSON, XML and HTML -b=file, --playbook=file Read tests to perform from playbook-file -- if set, ignores other tests passed as arguments -d, --show-response Show response data. Even if -s. -s, --silent Silent. Suppresses output. Overrules verbose. -v, --verbose Verbose output --verbose-curl Verbose output from libcurl --version Show version and exit -DKEY=VALUE Define variable, similar to .env-files. Can be set multiple times </code> sapt can take multiple arguments, both files and folders. The entire input-set will be sorted alphanumerically when passing a folder, thus you can dictate the order of execution by making sure the names of the scripts reflects the order: <ul> <li>suite/01-auth.pi</li> <li>suite/02-post-entry.pi</li> <li>suite/03-get-posted-entry.pi</li> <li>suite/04-delete-posted-entry.pi</li> </ul> <em>Note: playbooks provides a way to override this.</em> Usage: Complex Assuming you first have to get an authorization code from an auth-endpoint, which you will need in other tests. Let's say you have the following files: <ul> <li>myservice/.env</li> <li>myservice/01-auth.pi</li> <li>myservice/02-get-data.pi</li> </ul> Set up variables: myservice/.env <code>OIDC_USERNAME=myoidcclient OIDC_PASSWORD=sup3rs3cr3t USERNAME=someuser PASSWORD=supersecret42 </code> Get the auth-token: myservice/01-auth.pi <code>&gt; POST https://my.service/api/auth Authorization: Basic {{base64enc({{OIDC_USERNAME}}:{{OIDC_PASSWORD}})}} Content-Type: application/x-www-form-urlencoded - grant_type=password&amp;username={{USERNAME}}&amp;password={{PASSWORD}}&amp;scope=openid%20profile &lt; 200 id_token="id_token":"()" </code> Provided that the auth-endpoint will return something like this: <code>{"access_token": "...", "id_token":"...", "...", ...} </code> ... the test will then set the id_token-variable, allowing it to be referred in subsequent tests. Get data from service using data from previous test: myservice/02-get-data.pi <code>&gt; GET https://my.app/api/entry Cookie: SecurityToken={{id_token}} &lt; 200 </code> Finally, Run the testsuite <code>sapt myservice </code> Output: <code>1: myservice/01-auth.pi :OK (HTTP 200) 2: myservice/02-get-data.pi :OK (HTTP 200) ------------------ 2/2 OK ------------------ FINISHED - total time: 0.189s </code> <em>Tips: You can add -v or -d for more detailed output</em> Usage: playbook myplay.book contents: <code># Run this request 1 time myproj/auth.pi # Run this request 100 times myproj/api_get.pi * 100 </code> Tests shall be run in the order declared in the playbook. Each test may be followed by a number indicating the number of times it shall be performed. Running the playbook: <code>sapt -b=myplay.book </code> Playbooks resolves paths relative to its own location. Output: <code>1/5: myproj/auth.pi : OK (HTTP 200 - OK) time: 256ms 2/5: myproj/api_get.pi : OK (HTTP 200 - OK) 100 iterations. 100 OK, 0 Error time: 1050ms/100 iterations [83ms-215ms] avg:105ms ------------------ 2/2 OK ------------------ </code> Build: The tool is written in <a>zig</a> v0.9.0, and depends on <a>libcurl</a>. Prerequisites: * <a>zig is installed</a> and available in path. Development is done on 0.9.0 * <a>libcurl is installed</a> and library and headers are available in either path or through pkg-config. Get source: <code>git clone https://github.com/michaelo/sapt cd sapt </code> Development build/run: <code>zig build run </code> Run all tests: <code>zig build test </code> Install: <code>zig build install --prefix-exe-dir /usr/local/bin </code> <em>... or other path to put the executable to be in path.</em> Design goals: <ul> <li>Only you should own and control your data - e.g. any version control and data sharing is up to you.</li> <li>Tests should be easily written and arranged - no hidden headers or such</li> <li>Support easy use of secrets and common variables/definitions</li> <li>Tests should live alongside the artifacts they tests</li> </ul> Terminology: Term Description test the particular file/request to be processed. A test can result in "OK" or "ERROR" playbook a particular recipe of tests, their order and other parameters to be executed in a particular fashion extraction-expression The mechanism which allows one to extract data from responses according to a given expression and store the results in a variable for use in following tests. E.g. extract an auth-token to use in protected requests. Limitations: Due in part to the efforts to both having a clear understanding of the RAM-usage, as well as keeping the heap-usage low and controlled, a set of discrete limitations are currently characteristic for the tool. I will very likely revise a lot of these decisions going forward - but here they are: What Limitation General limitations Max number of tests to process in a given run 128 Max length for any file path 1024 Max repeats for single test 1000 Test-specific parameters Max number of headers 32 Max length for a given HTTP-header 8K Max number of variables+functions in a given test 64 Max length of a function response 1024 Max length of a variable key 128 Max length of a variable value 8K Max URL length 2048 Max size of payload 1M Extraction-expressions: order of precedence sapt will first attempt to match extraction entries with response body first, response headers second. Test-file specification: <code>&lt;input section&gt; &lt;optional set of headers&gt; &lt;optional payload section&gt; &lt;response section&gt; &lt;optional set of variable extraction expressions&gt; </code> Comments: <code># Comment - must be start of line. Can be used everywhere except of in payload-section </code> Variables: <code>{{my_var}} </code> Functions: Convenience-functions are (to be) implemented. The argument can consist of other variables. <code>{{base64enc(string)}} </code> Example: <code>Authorization: basic {{base64enc({{username}}:{{password}})}} </code> Supported functions: <ul> <li>base64enc(string) - base64-encoding</li> <li>env(string) - lookup variables from OS-environment</li> <li><em>TODO: urlencode(string)</em></li> <li><em>TODO: base64dec(string) ?</em></li> </ul> Input section: <code># '&gt;' marks start of 'input'-section, followed by HTTP verb and URL &gt; POST https://some.where/ # List of HTTP-headers, optional Content-Type: application/json Accept: application/json </code> Payload section, optional: <code># '-' marks start of payload-section, and it goes until output-section - {"some":"data} </code> <em>TBD: Implement support for injecting files? If so: allow arbitrary sizes.</em> Output section: <code># &lt;Expected HTTP code&gt; [optional string to check response for it to be considered successful] &lt; 200 optional text # HTTP-code '0' is "don't care" &lt; 0 </code> Set of variable extraction expressions, optional: <code># Key=expression # expression format: &lt;text-pre&gt;&lt;group-indicator&gt;&lt;text-post&gt; # Expression shall consists of a string representing the output, with '()' indicating the part to extract AUTH_TOKEN="token":"()" </code> <em>TBD: Might support more regex-like expressions to control e.g. character groups and such.</em> Exit codes sapt is also usable in e.g. cron jobs to monitor availability of a service. This is a tentative list of exit codes currently implemented in sapt: <ul> <li>0: OK</li> <li>1: Something went wrong processing the input set</li> <li>2: One or more tests failed</li> </ul> Use cases This sections aims to provide a set of example use cases for which sapt can be useful. This is not an exchaustive list, but please let me know if any other use cases are found: <ul> <li>Test / explore the behaviour of an API / web service</li> <li>Describe and verify desired behviour when developing a service - e.g. TDD-like process</li> <li>Monitor a set of relevant endpoints to quickly debug which - if any - one fails</li> <li>Cron-job to monitor a service</li> <li>Load-testing</li> </ul> TODO, somewhat ordered: <em>Att! The points here are not changes that we strictly commit to, but an organic list of things to consider. Higher up = more likely</em> <ul> <li>Separate automagic handling between .env-file explicitly and implicitly passed (through folder)? Explicit should perhaps ignore folder-rules? </li> <li>Determine if current solution where variables can't be overwritten is a good idea or not.</li> <li>Libs/deps handling:<ul> <li>Credits: Determine all deps we need to ship.<ul> <li>libcurl for all platforms - license added to CREDITS</li> <li>zlib for Windows - license added to CREDITS</li> <li>OpenSSL? Other curl-deps?</li> </ul> </li> <li>Look into staticly linking all deps - the absolute best would be a single, self-contained executable</li> <li>Get proper version-control of which dynamic libraries we depend on/provide.</li> </ul> </li> <li>Dev: Set up automatic builds/cross-builds for Win10 x64, Linux x64, macOS (x64 and Arm)<ul> <li>Clean up lib-handling. Currently we e.g. have libcurl stored as libcurl.dll and curl.dll due to some linkage-discrepencies for Windows/vcpkg. Can we simply vendor it?</li> </ul> </li> <li>Append current git hash (short) for debug-builds. Need to figure out how to detect this at compile-time and inject it properly.</li> <li>Due to this being an explorative project while learning Zig, there are inconsistencies regarding memory-handling. This must be cleaned up and verified.</li> <li>Code quality - especially in main.zig - is quite crap at this point.</li> <li>More advanced sequence options?:<ul> <li>Specify setup/teardown-tests to be run before/after test/suite/playbook?<ul> <li>--suite-setup, --suite-teardown, --step-setup, --step-teardown?</li> <li>What about playbooks?</li> </ul> </li> <li>Specify option to only re-run specific steps of a sequence? --steps=1,3,5-7.</li> </ul> </li> <li>Provide better stats for repeats. We currently have min, max and avg/mean time. Could median or something mode-like be as useful or more? A plot would be nice here.<ul> <li>Also ensure that total time for entire test set also prints the accumulated value of each step without the delay set by --delay</li> </ul> </li> <li>Describe/explore how/if --delay shall affect playbooks. Currently: it doesn't. Playbooks should be self-contained, so we'd need an in-playbook variant of the functionality</li> <li>Implement support to do step-by-step tests by e.g. requiring user to press enter between each test?</li> <li>Store responses? E.g. 'sapt mysuite/ --store-responses=./out/' creates ./out/mysuite/01-test1.pi.out etc</li> <li>Playbooks:<ul> <li>TBD: What shall the semantics be regarding response data and variable-extraction when we have multiple repetitions? Makes no sense perhaps, so either have "last result matters", "undefined behaviour" or "unsupported". Wait for proper use cases.</li> </ul> </li> <li>Test/verify safety of string lengths: parsing</li> <li>Support both keeping variables between (default) as well as explicitly allowing sandboxing (flag) of tests?</li> <li>TBD: Shall we support "repeats" in test-files as well, not only in playbooks?</li> <li>Actively limit the set of protocols we allow. We currently just forward the URL however it is to CURL. If we staticly link, build a custom variant with only the feature set we need.</li> <li>Finish basic syntax highligh ruleset for the test-files</li> <li>Dev: Test feature flags based on comptime-parsing a feature-file</li> </ul> Feature-exploration AKA Maybe-TODO: <ul> <li>Support handling encrypted variables?</li> <li>Support list of curl-commands as alternative output?</li> <li>Performant, light-weight GUI (optional)? Plotting performance for stress tests and such.</li> <li>Support response-time as test-prereq? Perhaps in playlist (low pri)</li> <li>TBD: Possibility to set "verbose" only for a specific test? Using e.g. the test-sequence-number?</li> <li>TBD: Actually parse response data - which also can allow us to more precisely extract data semantically</li> </ul> Thanks / attributions: <ul> <li>zig - an interesting language of which this project is my first deliverable</li> <li>libcurl - the workhorse</li> </ul> <em>See ATTRIBUTIONS.md for licenses.</em>
[]
https://avatars.githubusercontent.com/u/34946442?v=4
zigwick
cryptocode/zigwick
2022-02-04T18:42:29Z
A Fenwick tree for Zig
main
0
13
0
13
https://api.github.com/repos/cryptocode/zigwick/tags
MIT
[ "binary-indexed-tree", "fenwick", "zig" ]
5
false
2024-12-28T00:57:09Z
true
false
unknown
github
[]
zig<strong>wick</strong> is a <a>Fenwick tree</a> implementation in <a>Zig</a>. Overview The main purpose of a Fenwick tree is to efficiently maintain prefix sums. The data structure supports O(log N) range queries and point updates. The need to update and query partial sums frequently comes up in competitive programming challenges, but also crop up in real-world applications. zigwick never allocates and have no dependencies, not even the standard library (except for tests) Building This library requires a recent Zig build. Last tested with <code>0.13.0-dev.47+c231d9496</code>. To build the library and test it: <code>zig build zig build test</code> Types of use Fenwick trees are generally used in two ways: 1) As an auxiliary data structure for keeping track of partial sums. In this case, the Fenwick tree is kept separate from the actual array of numbers to allow fast indexed access to specific numbers. 2) As the store of both numbers and prefix sums. This reduces memory requirements, but you lose O(1) access to specific numbers by index - this is now a O(log n) operation. Create an instance In the first example we chose to keep numbers and sums separate. This way we can quickly look up numbers by index. ```zig var data: [5]i32 = .{ -1, -5, -1, 0, 5 }; var tree = [_]i32{0} ** 5; var partial_sums = Fenwick(i32).initFrom(&amp;tree, &amp;data); // At this point we can query sums up to an index, or in a range // Indices are zero-based. partial_sums.sum(4); partial_sums.sum(1); partial_sums.sumRange(2, 4); // We can add or subtract at given indices, which will efficiently update all prefix sums partial_sums.update(3, 2); ``` The <code>tree</code> array is the backing buffer for the prefix sums. You can chose to allocate this on the heap, of course. The library itself never allocates. The next example use the tree buffer both for the data and the prefix sums. This saves memory at the cost of O(log n) rather than O(1) access to actual numbers (this isn't needed in many applications, but it's an important consideration if so) <code>zig var tree = [_]i32{0} ** 10; var fenwick = Fenwick(i32).initZero(&amp;tree); fenwick.update(4, 10); fenwick.set(5, 9); fenwick.get(5); fenwick.sum(5);</code> See tests for complete examples.
[]
https://avatars.githubusercontent.com/u/766758?v=4
libgeos.zig
guidorice/libgeos.zig
2022-01-13T00:20:50Z
Zig bindings for the GEOS C library; compile libgeos in your build.zig.
main
1
12
0
12
https://api.github.com/repos/guidorice/libgeos.zig/tags
NOASSERTION
[ "c", "computational-geometry", "geojson", "geospatial", "gis", "libgeos", "zig", "zig-package", "zig-programming-language", "ziglang" ]
73
false
2025-03-13T04:54:24Z
true
false
unknown
github
[]
libgeos.zig <a>Zig</a> bindings for the <a>GEOS C library (libgeos)</a> <blockquote> GEOS (Geometry Engine, Open Source) is a C/C++ library for spatial computational geometry of the sort generally used by “geographic information systems” software. GEOS is a core dependency of PostGIS, QGIS, GDAL, and Shapely. </blockquote> GEOS version <code>3.10.2-CAPI-1.16.0</code> Zig version <ul> <li><code>0.9.1</code>, <code>0.10.0-dev</code></li> </ul> Build Requires only <code>zig</code>. Don't forget to clone/init the submodule! <code>shell git clone --recurse-submodules https://github.com/guidorice/libgeos.zig.git cd libgeos.zig/ zig build</code> Tests <code>shell zig build test</code> Examples <code>shell $ zig build --help $ zig build run-ex1 Geometry A: POLYGON((0 0, 10 0, 10 10, 0 10, 0 0)) Geometry B: POLYGON((5 5, 15 5, 15 15, 5 15, 5 5)) Intersection(A, B): POLYGON ((10 10, 10 5, 5 5, 5 10, 10 10))</code> Known Issues <ul> <li>blocker: The libgeos library uses C++ <code>std::runtime_error</code>, which is not currently captured by the Zig wrapper code. As a result, there is no way to recover from some error conditions, for example, failing to parse some WKT formatted string. <a>see issue #9</a></li> </ul> Roadmap <ul> <li>[x] Minimal build.zig. Builds libgeos entirely using Zig compiler and build system.</li> <li>[x] Create example exe using this package as a Zig library.</li> <li>[x] Port libgeos C examples to Zig (from src/geos/examples)</li> <li>[x] <a>Ex 1</a> Reads two WKT representations and calculates the intersection, prints it out, and cleans up.</li> <li>[x] <a>Ex 1 (threadsafe)</a></li> <li>[x] <a>Ex 2</a> Reads one geometry and does high-performance prepared geometry operations to place "random" points inside it.</li> <li>[x] <a>Ex 3</a> Build a spatial index and search it for a nearest pair.</li> <li>[ ] Solution for <code>std:runtime_error</code> conditions (see known issues)</li> <li>[ ] New Zig idiomatic wrapper for libgeos C API? Alternatively: port to Zig-native.</li> <li>[ ] New GeoJSON reader/writer which speaks libgeos types and full support for Feature properties. Reference: <a>GEOS GeoJSON support notes here.</a></li> <li>[ ] New Zig projects which utilize these Geospatial or Geometric primitives.</li> </ul> Notes See also <a>vendor/geos/README</a> for how libgeos is updated within this repo.
[]
https://avatars.githubusercontent.com/u/5132833?v=4
zig-gtk3
nfisher1226/zig-gtk3
2021-06-12T13:13:40Z
Convenience functions and wrappers for using Gtk+ in Zig
odin
0
12
1
12
https://api.github.com/repos/nfisher1226/zig-gtk3/tags
MIT
[ "gtk", "library", "zig" ]
151
false
2024-11-26T09:08:23Z
true
false
unknown
github
[]
zig-gtk3 This package contains some convenience functions and wrappers around the C api of both the Gtk+ and Vte libraries for developing Gui applications using Zig. Usage We track zig-master, so you will need the current master compiler. In your <code>build.zig</code> file, add the package path: <code>Zig const exe = b.addExecutable("exe-name", "path-to-source.zig"); exe.addPackagePath("zig-gtk3", "path/to/zig-gtk3/lib.zig"); exe.linkLibC(); exe.linkSystemLibrary("gtk+-3.0");</code> The Gtk wrappers are namespaced to gtk, and the C functions to c. ```Zig const GTK @import("zig-gtk3"); const c = GTK.c; const gtk = GTK.gtk; const std = @import("std"); const Gui = struct { window: gtk.Window, <code>fn init(app: *c.GtkApplication) Gui { </code> ... <code>`` There are a number of examples in the "examples" subdirectory which can be built with by running</code>zig build` in this directory. Rationale It is entirely possible to call C functions directly from Zig. However, Zig's translate-c function, which is used to import C code into Zig, is still somewhat immature and tends to fail with heavily macro dependent code. This happens for certain parts of Gtk+ that make working around it quite difficult. Additionally, the C Api to Gtk (and Vte), due to limitations of the language, can be incredibly verbose as well as quite clumsy at times. A better Api is both possible and desireable in a language such as Zig.
[]
https://avatars.githubusercontent.com/u/14359115?v=4
music_player
kdchambers/music_player
2021-11-18T05:32:10Z
Demo music player written in zig
main
0
12
0
12
https://api.github.com/repos/kdchambers/music_player/tags
GPL-3.0
[ "vulkan", "zig" ]
98,979
false
2025-04-12T12:49:21Z
true
false
unknown
github
[]
music player A simple vulkan-based <strong>DEMO</strong> music player written in zig. The project is only for the purposes of learning and is not intended for real use in it's current state. The project ships with an example library and is hardcoded to use that. Dependencies <ul> <li>zig (master)</li> <li>ao</li> <li>glfw</li> <li>libmad</li> <li>vulkan</li> </ul> Running <code>sh git clone --recurse-submodules https://github.com/kdchambers/music_player cd music_player zig build run -Drelease-safe</code> Screenshot
[]
https://avatars.githubusercontent.com/u/37453713?v=4
zigvale
ominitay/zigvale
2021-08-22T12:15:04Z
A Zig implementation of the stivale2 boot protocol
main
1
12
0
12
https://api.github.com/repos/ominitay/zigvale/tags
MIT
[ "boot", "bootloader", "hacktoberfest", "kernel", "osdev", "stivale", "stivale2", "zig", "zig-package", "ziglang", "zigvale" ]
86
false
2023-10-28T13:51:54Z
true
false
unknown
github
[]
Zigvale Zigvale is a Zig implementation of the stivale2 boot protocol to be used both in kernels and bootloaders. The specification, along with C header files, may be found <a>here</a>. Example Visit <a>zigvale-barebones</a> for a bare-bones kernel demonstrating how to use Zigvale. Add to your project Zigvale is available on <a>aquila</a>, <a>zpm</a>, and <a>astrolabe</a>. Gyro <code>gyro add ominitay/zigvale</code> Zigmod Aquila <code>zigmod aq add 1/Ominitay/zigvale</code> ZPM <code>zigmod zpm add zigvale</code> ZKG <code>zkg add zigvale</code> Git Submodule <code>git submodule add https://github.com/ominitay/zigvale zigvale</code> Clone <code>git clone https://github.com/ominitay/zigvale</code> Documentation To generate documentation, run <code>zig build docs</code> Zig's documentation generator is experimental and incomplete. When documentation generation has improved somewhat, I will host the documentation. In the meantime, you may both read the comments made manually, and read the documentation in the <a>stivale repository</a>.
[]
https://avatars.githubusercontent.com/u/110615?v=4
hwzip.zig
hdorio/hwzip.zig
2021-10-08T14:54:37Z
Zig version of hwzip
master
1
12
2
12
https://api.github.com/repos/hdorio/hwzip.zig/tags
Unlicense
[ "compression", "zig", "zip" ]
3,761
false
2024-04-09T08:04:49Z
true
false
unknown
github
[]
hwzip.zig What's hwzip.zig? It's a port in Zig of the program <strong>hwzip-2.1</strong> written by Hans Wennborg. - <a>Zip Files: History, Explanation and Implementation</a> - <a>Shrink, Reduce, and Implode: The Legacy Zip Compression Methods</a> <strong>hwzip</strong> is an example implementation written in C of the Zip file format. <strong>hwzip.zig</strong> is a Zig version in an attempt to make it more accessible. I tried to make the least amount of changes possible so that one can still follow the article with the Zig code instead of C. This means it's not idiomatic Zig code, it's more a translation than a port. Why hwzip.zig? <ul> <li> Because you can compile, test and run it without any dependencies (except Zig). The C version requires the usual hell of building utilities, the <em>Info-ZIP</em> binary, and links into <em>zlib</em>. </li> <li> I needed a way to compress files in Zig. </li> <li> I wanted to learn about Zip files and Zig is much more readable to me than C. </li> </ul> Building instructions Download and install <a>Zig</a> <strong>0.9.1</strong> To build the binary in <code>./zig-out/bin/hwzip</code> you need to run <code>bash zig build</code> Testing instructions <code>bash zig build test</code> Usage Executing without any arguments print the help message ```bash ./hwzip list ./hwzip extract ./hwzip create [-m ] [-c ] Supported compression methods: store, shrink, reduce, implode, deflate (default). ``` List of changes from <em>hwzip-2.1</em> <ul> <li>The debug field <code>huffman_decoder_t.num_syms</code> is commented out.</li> <li>Fuzz tests are missing.</li> <li>Uses <code>std.hash.crc32()</code> from Zig instead of a custom one.</li> <li>Uses epoch dos date for dates before 1980-01-01 in <code>zip.ctime2dos()</code></li> <li>The table <code>reverse8_tbl</code> is replaced by the function <code>bits.reverse8()</code>.</li> </ul> Limitations <strong>hwzip.zig</strong> comes with no warranties, I may have introduced bugs which are not in the original version <em>hwzip-2.1</em>. You cannot recursively compress files within a directory, you need to list all files that you want to add to the archive. This utility is slow and is not meant for daily use, you should use more serious tools like Info-ZIP, 7zip or gzip to compress your files. License The <code>./doc</code> directory contains a copy of the articles explaining the Zip file format which are under <a>Hans Wennborg</a> copyright. <code>time.zig</code> is a port of some portion of <code>src/time</code> from <em>musl libc</em> and as such this file is under the standard MIT license, see the <code>LICENSE-time-dot-zig</code> file. The rest is public domain unless specified otherwise, see the <code>LICENSE</code> file.
[]
https://avatars.githubusercontent.com/u/5728002?v=4
IUPMetadata
batiati/IUPMetadata
2021-06-19T22:59:24Z
This project aims to collect rich metadata information about IUP's elements, enabling code-gen tools to create type-checked bindings for any programing language.
master
1
12
3
12
https://api.github.com/repos/batiati/IUPMetadata/tags
Unlicense
[ "code-generation", "csharp", "gui", "iup", "iup-gui-library", "iup-toolkit", "multiplatform", "zig" ]
15,430
false
2024-11-28T22:57:06Z
false
false
unknown
github
[]
404
[]
https://avatars.githubusercontent.com/u/58830309?v=4
zelf
g-w1/zelf
2021-03-08T20:00:20Z
playing around with ELF in zig
main
0
12
1
12
https://api.github.com/repos/g-w1/zelf/tags
-
[ "elf", "zig" ]
7
false
2023-11-27T00:11:27Z
true
false
unknown
github
[]
An attempt at an elf linker This is meant to be a simple learning project. Resources For ELF Stuff https://raw.githubusercontent.com/corkami/pics/28cb0226093ed57b348723bc473cea0162dad366/binary/elf101/elf101-64.svg https://cirosantilli.com/elf-hello-world https://github.com/mewmew/dissection/blob/master/elf64/elf64.asm https://chris.bracken.jp/2018/10/decoding-an-elf-binary/
[]
https://avatars.githubusercontent.com/u/47984692?v=4
assemblio
luehmann/assemblio
2022-01-23T21:53:52Z
null
main
0
12
1
12
https://api.github.com/repos/luehmann/assemblio/tags
GPL-3.0
[ "wasm-4", "wasm4", "zig" ]
79
false
2025-01-07T22:05:19Z
true
false
unknown
github
[]
Optimize build <code>wasm-opt -Oz --strip-dwarf --strip-producers --zero-filled-memory -o zig-out/lib/small.wasm zig-out/lib/cart.wasm</code>
[]
https://avatars.githubusercontent.com/u/52591095?v=4
advent-of-code
MeanderingProgrammer/advent-of-code
2021-03-24T23:38:18Z
Advent of Code - All Years - Blazingly Fast
main
0
12
1
12
https://api.github.com/repos/MeanderingProgrammer/advent-of-code/tags
MIT
[ "advent-of-code", "advent-of-code-2015", "advent-of-code-2016", "advent-of-code-2017", "advent-of-code-2018", "advent-of-code-2019", "advent-of-code-2020", "advent-of-code-2021", "advent-of-code-2022", "advent-of-code-2023", "advent-of-code-2024", "go", "ocaml", "python", "rust", "zig" ]
6,013
false
2025-04-14T03:46:11Z
true
true
unknown
github
[]
Advent of Code All Years - Blazingly Fast Runtimes History When I first started Advent in 2020 I wrote everything in <code>Python</code> for simplicity as well as getting better at my main scripting language. I then decided to go back and solve all the years from 2015 on also in <code>Python</code>. Since then I have used Advent as an opportunity to learn new languages. So far this has been: <ul> <li>2021: <a>Go</a></li> <li>2022: <a>Rust</a></li> <li>2023: <a>OCaml</a></li> <li>2024: <a>Zig</a></li> </ul> Sometime after 2022 I decided to go back and optimize every solution with the goal of having no single solution take more than 1 second to run. Sometimes this involves algorithm improvements, other times I decided to re-write solutions from <code>Python</code> into something like <code>Rust</code> or <code>Go</code>. Currently the slowest solution takes just under 250 ms, so mission accomplished. Now the total runtime is such that each year takes less than 1 second! Input Data The input for each puzzle is in a separate private Github repo This is done to comply with the policy [here](https://adventofcode.com/about). These inputs end up in the `data` folder in the same structure as the solutions. For instance the input for year `2020` day `5` is file `data/2020/05/data.txt`. After cloning this repo the following command needs to be run to get the data. ```bash git submodule update --init ``` This also means when pulling changes the `update` command must also be ran. ```bash git submodule update ``` Setup Install Requirements <code>bash pip install -r scripts/requirements.txt</code> Set Aliases <code>bash alias a-build="./scripts/advent.py build" alias a-run="./scripts/advent.py run" alias a-gen="./scripts/advent.py generate" alias a-graph="./scripts/advent.py graph"</code> Build The <code>build</code> target is used to do any language specific setup prior to running. This includes downloading any necessary libraries, compiling targets, etc. None of the parameters are required, the default behavior in this case is to build and test all supported languages. <ul> <li>Alias Command: <code>a-build</code></li> <li>Direct Command: <code>./scripts/advent.py build</code></li> </ul> Usage ```bash a-build \ (--language )* \ --info? ``` | Variable Name | Alt | Description | Default | Example | | ------------- | ---- | -------------------------------------- | ------- | --------- | | language | `-l` | Limit build to the specified languages | None | `-l rust` | | info | `-i` | Outputs which languages will be built | `False` | `-i` | Run The <code>run</code> target is used to run various days rather than running directly. Does some hacky stuff to set arguments and run commands, but for the most part runs standard build commands for each language / framework. None of the parameters are required, the default behavior in this case is to run the latest day in the fastest language it is implemented in. <ul> <li>Alias Command: <code>a-run</code></li> <li>Direct Command: <code>./scripts/advent.py run</code></li> </ul> Usage ```bash a-run \ --template ? \ (--year )* \ (--day )* \ (--language )* \ --strategy ? \ --slow ? \ --test? \ --info? ``` | Variable Name | Alt | Description | Default | Example | | ------------- | ---- | --------------------------------------- | -------- | ----------------- | | template | `-t` | Name that targets specific years / days | `latest` | `-t languages` | | year | `-y` | List of years to run | None | `-y 2021 -y 2022` | | day | `-d` | List of days to run | None | `-d 1 -d 3 -d 5` | | language | `-l` | Limit runs to the specified languages | None | `-l go` | | strategy | `-s` | A way to select which languages to run | None | `-s fastest` | | slow | `-S` | Defines the runtime (in ms) for slow | 100 | `-S 500` | | test | `-T` | Passes test flag to each day | `False` | `-T` | | info | `-i` | Outputs which days would run | `False` | `-i` | - If `template` is provided then `year` &amp; `day` must not be provided - If `year` or `day` are provided then `template` must not be provided Process Runtime Output ```bash cat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv' cat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv' | sort -nk4 cat all.json | jq -r '.[]|[.year, .day, .language, .runtime]|@tsv' | sort -nk4 | awk '{ if ($4 &gt; 100) { print $0 } }' cat all.json | jq -r '.[]|select(.year == 2015 and .day == 24)' cat all.json | jq -r '.[]|.runtime' | awk '{ sum+=$1 } END { print sum, "ms" }' cat all.json | jq -r '.[]|select(.year == 2015)|.runtime' | awk '{ sum+=$1 } END { print sum, "ms" }' cat all.json | jq -r '.[]|[.year, .runtime]|@tsv' | awk '{ years[$1] += $2 } END { for (year in years) { print year, years[year], "ms" } }' ``` Unit Test This will test that some shared logic works across usage days. Such as the `int-code` implementation from 2019. ```bash pytest -s scripts ``` Generate The <code>generate</code> target creates initial files and empty data file for the specified language. Will do any other required setup, such as updating <code>Cargo.toml</code> for <code>rust</code>. Will pull down your puzzle input if <a>instructions</a> are followed. None of the parameters are required, the default behavior in this case is to generate the next day using the rust template. <ul> <li>Alias Command: <code>a-gen</code></li> <li>Direct Command: <code>./scripts/advent.py generate</code></li> </ul> Usage ```bash a-gen \ --template ? \ --year ? \ --day ? \ --language ? \ --puzzle? \ --info? ``` | Variable Name | Alt | Description | Default | Example | | ------------- | ---- | --------------------------------------- | ------- | ----------- | | template | `-t` | Name that targets specific year / day | `next` | `-t next` | | year | `-y` | Year to generate starting files for | None | `-y 2022` | | day | `-d` | Day to generate starting files for | None | `-d 5` | | language | `-l` | Language to generate starting files for | `rust` | `-l python` | | puzzle | `-p` | Download puzzle description as well | `False` | `-p` | | info | `-i` | Outputs which day would get generated | `False` | `-i` | - If `template` is provided then `year` &amp; `day` must not be provided - If `year` or `day` are provided then `template` must not be provided Install aoc-cli Template generation script can use <code>aoc-cli</code> to download input: <a>docs</a>. Follow the instructions in the <code>README</code> of <code>aoc-cli</code> to get your session cookie setup. This library relies on openssl which you will also need to install if you don't already have it. <code>bash cargo install aoc-cli touch .adventofcode.session</code> Graph The <code>graph</code> target creates a variety of graphs to visualize the runtime of days split and grouped on different dimensions. None of the parameters are required, the default behavior in this case is to create only new graphs and skip graphs that have been created before. <ul> <li>Alias Command: <code>a-graph</code></li> <li>Direct Command: <code>./scripts/advent.py graph</code></li> </ul> Usage ```bash a-graph \ --archive? \ --info? ``` | Variable Name | Alt | Description | Default | Example | | ------------- | ---- | --------------------------------------- | ------- | ------- | | archive | `-a` | Archive existing graphs | `False` | `-a` | | info | `-i` | Outputs whether graphs would be arhived | `False` | `-i` |
[]
https://avatars.githubusercontent.com/u/124872?v=4
zig-morus
jedisct1/zig-morus
2021-10-28T22:42:35Z
MORUS-1280-128 implementation in Zig.
master
0
11
0
11
https://api.github.com/repos/jedisct1/zig-morus/tags
MIT
[ "morus", "morus-1280-128", "webassembly", "zig", "zig-package" ]
16
false
2024-05-09T20:00:03Z
true
false
unknown
github
[]
MORUS cipher for Zig This is a Zig implementation of <a>MORUS</a> (MORUS-1280-128) MORUS is a fast authenticated cipher for platforms without hardware AES acceleration. It performs especially well on WebAssembly compared to alternatives. Its performance is comparable to AES-OCB, without using AES instructions. Benchmark results on x86_64 (Macbook Pro, 2,4 GHz Core i9, single core): <code>text morus: 5890 MiB/s aes128-ocb: 5824 MiB/s</code> Benchmark results for WebAssembly (WAVM) <code>text aes128-gcm: 176 MiB/s aes128-ocb: 300 MiB/s xchacha8Poly1305: 319 MiB/s aegis-128l: 807 MiB/s rocca: 854 MiB/s morus: 3505 MiB/s</code> MORUS is the fastest cipher on Raspberry Pi 4, and possibly other ARM devices without crypto extensions: <code>text aes128-gcm: 41 MiB/s aes128-ocb: 81 MiB/s xchacha8Poly1305: 159 MiB/s aegis-128l: 168 MiB/s rocca: 221 MiB/s morus: 713 MiB/s</code> On platforms with AES acceleration, <a>AEGIS</a>(available in the standard library as <code>std.crypto.aead.aegis.Aegis128L</code>) and <a>ROCCA</a> have higher performance. Benchmark on Rocket Lake (Xeon E-2386G): <code>text aes128-ocb: 10173 MiB/s aes256-ocb: 7792 MiB/s morus: 11069 MiB/s rocca: 16274 MiB/s aegis-128l: 21206 MiB/s (170 Gb/s)</code> Warning: MORUS doesn't provide 128-bit confidentiality even though <a>the best know attacks</a> are impractical.
[]
https://avatars.githubusercontent.com/u/547147?v=4
zig-releaser
knadh/zig-releaser
2021-10-23T16:26:44Z
A simple hack to use GoReleaser to build, release, and publish Zig projects.
master
1
11
2
11
https://api.github.com/repos/knadh/zig-releaser/tags
MIT
[ "build-release", "build-tool", "goreleaser", "package", "release", "release-automation", "zig", "zig-package" ]
7
false
2025-03-08T04:30:30Z
false
false
unknown
github
[]
GoReleaser v2 Official Support 🎉 See <a>https://goreleaser.com/quick-start/</a>. zig-releaser (old, GoReleaser v1) zig-releaser is a hack that allows Zig programs to be built, packaged, and released with <a>GoReleaser</a>, a tool for publishing Go programs. <a>Here is an example</a> for a Zig program published to GitHub with GoReleaser. The changelog and artefacts are all automatically generated by GoReleaser. This hack has only been tested with GitHub but should work with other release targets GoReleaser supports. How to use <ul> <li>Install <a>GoReleaser</a>.</li> <li> Setup the <a>GitHub token</a> with <code>repo</code> perms. </li> <li> Copy <code>.goreleaser/</code>, and <code>.goreleaser.yml</code> from this repo to the root of the Zig project. </li> <li>Edit <code>.goreleaser.yml</code> for the project (generally the <code>binary</code>, <code>goos</code>, <code>files</code> fields).</li> <li>Edit <code>build.sh</code> script to tweak the zig build flags.</li> </ul> Once the project is ready for release, add a semver tag (<code>git tag -a v0.1.0 -m v0.1.0</code>) Dry run <code>sh goreleaser --snapshot --skip=publish --clean</code> The releases will appear in the <code>dist</code> directory. Publish <code>sh goreleaser --snapshot --skip=publish --clean</code>
[]
https://avatars.githubusercontent.com/u/5464072?v=4
discord-archiver
nektro/discord-archiver
2021-04-29T07:33:42Z
Chat archiver for Discord
master
0
11
1
11
https://api.github.com/repos/nektro/discord-archiver/tags
NOASSERTION
[ "archive", "discord", "zig" ]
18
false
2025-03-18T12:42:33Z
true
false
unknown
github
[]
discord-archiver <a></a> <a></a> An archiver for Discord. Written in Zig. Usage <ol> <li> Channels <code>$ ./discord-archiver channel &lt;BOT_TOKEN&gt; &lt;CHANNEL_ID&gt;</code> </li> <li> Guilds <code>$ ./discord-archiver guild &lt;BOT_TOKEN&gt; &lt;GUILD_ID&gt;</code> </li> </ol> Zig <ul> <li>https://ziglang.org/</li> <li>https://github.com/ziglang/zig</li> <li>https://github.com/ziglang/zig/wiki/Community</li> </ul> Building <code>$ zigmod fetch $ zig build</code> Built With <ul> <li>Zig Master &amp; <a>Zigmod Package Manager</a></li> <li>https://github.com/nektro/zig-ansi</li> <li>https://github.com/truemedian/zfetch</li> </ul> License AGPL-3.0
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-zorm
nektro/zig-zorm
2021-08-09T08:41:46Z
An ORM-ish library for Zig.
master
1
11
0
11
https://api.github.com/repos/nektro/zig-zorm/tags
MPL-2.0
[ "sqlite", "zig", "zig-package" ]
37
false
2025-05-21T20:33:31Z
true
false
unknown
github
[]
Zorm <a></a> <a></a> <a></a> <a></a> The database library for Zig. Supports <ul> <li>Sqlite3</li> </ul>
[]
https://avatars.githubusercontent.com/u/54106488?v=4
inon
iddev5/inon
2021-08-03T17:38:22Z
:floppy_disk: Data serialization format in Zig
master
0
11
0
11
https://api.github.com/repos/iddev5/inon/tags
MIT
[ "data-format", "serialization", "zig", "ziglang" ]
173
false
2024-12-28T00:24:28Z
true
true
unknown
github
[ { "commit": "92c2875f2f91bf2a22b2be89b47ef0c3732f4812.tar.gz", "name": "parser-toolkit", "tar_url": "https://github.com/MasterQ32/parser-toolkit/archive/92c2875f2f91bf2a22b2be89b47ef0c3732f4812.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/MasterQ32/parser-toolkit" } ]
inon Data configuration format in Zig <ul> <li>Simple human-readable data serialization format</li> <li>Function execution capabilties: both native as well as foreign</li> <li>Operates on Zig's standard types</li> <li>Fast, powerful serialization and deserialization</li> <li>Pretty printing and serialization to JSON capabilities</li> </ul> Example file <code>first_name: "joe" last_name: "some {first_name} thing" age: 50 address: { street_no: switch %{ (= age 30): 420 (= age 40): 40 (= age 50): 50 else: 70 } num: * (self "street_no") 2 city: "nyc" } phone_nos: [100, 200, 300] second_no: index phone_nos 1</code> See <a><code>demo.zig</code></a> file for integration example. Use <a><code>repl.zig</code></a>, using <code>zig build run-repl</code> for a REPL-environment. License This library is licensed under MIT License. See <a>LICENSE</a> for more info.
[]
https://avatars.githubusercontent.com/u/85027668?v=4
dotfiles
txtyash/dotfiles
2021-06-07T15:04:18Z
Yash's dotfiiles(configuration files for nixos and linux)
master
0
11
1
11
https://api.github.com/repos/txtyash/dotfiles/tags
-
[ "dotfiles", "fish", "kanata", "neovim", "nix", "nixos", "nixvim", "rust", "stylix", "wezterm", "zig" ]
14,306
false
2025-05-03T21:22:05Z
false
false
unknown
github
[]
404
[]
https://avatars.githubusercontent.com/u/6153158?v=4
zig-wasm-snake
holobeat/zig-wasm-snake
2021-10-25T03:36:58Z
Classic snake game written in Zig, compiled to WASM.
main
1
11
1
11
https://api.github.com/repos/holobeat/zig-wasm-snake/tags
-
[ "game", "wasm", "zig" ]
8
false
2024-11-23T18:40:05Z
false
false
unknown
github
[]
zig-wasm-snake Reimplementation of my other repo elm-snake (done in Elm), this time using the Zig language. The zig source is compiled into WASM, running directly from the web page. Try it online at https://holobeat.github.io/zig-wasm-snake.
[]
https://avatars.githubusercontent.com/u/32691832?v=4
tatl
BanchouBoo/tatl
2021-06-02T01:09:38Z
Zig library for deserializing Aseprite files
master
0
10
1
10
https://api.github.com/repos/BanchouBoo/tatl/tags
Unlicense
[ "aseprite", "deserialization", "library", "zig" ]
24
false
2024-07-29T18:24:07Z
true
false
unknown
github
[]
Tatl Library for deserializing Aseprite files for usage in game development, image editors, etc. Made for Aseprite v1.2.x, there is no guarantee this library will work with files made in other versions of Aseprite. You can view the Aseprite file spec <a>here</a>. Example ```zig const std = @import("std"); const tatl = @import("tatl.zig"); pub fn main() !void { const allocator = std.heap.page_allocator; var file = try std.fs.openFileAbsolute("/path/to/file.ase", .{}); const aseprite_import = try tatl.import(allocator, file.reader()); // do stuff with import data aseprite_import.free(allocator); } ``` Plans <ul> <li>Add file serialization, current roadblock for this is the lack of zlib compression in the Zig standard library (https://github.com/ziglang/zig/issues/213)</li> <li>Update to support the new and changed data for Aseprite v1.3</li> </ul>
[]
https://avatars.githubusercontent.com/u/30342951?v=4
handmadehero_zig
MzaxnaV/handmadehero_zig
2022-01-10T07:12:21Z
personal Handmade Hero repo in zig
main
1
10
1
10
https://api.github.com/repos/MzaxnaV/handmadehero_zig/tags
-
[ "game-development", "handmade-hero", "vscode", "zig" ]
2,245
false
2025-05-13T19:21:55Z
true
true
0.14.0
github
[ { "commit": "7b434a47c2b85f395d8e5a6dca47af6a74422521.tar.gz", "name": "zigwin32", "tar_url": "https://github.com/marlersoft/zigwin32/archive/7b434a47c2b85f395d8e5a6dca47af6a74422521.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/marlersoft/zigwin32" } ]
Handmade Hero zig Handmade Hero personal repo written in zig (0.14). I try to be close to what Casey does, with small changes where it makes sense to me. For debug profiler display set <code>PROFILE</code> option to <code>true</code> in build.zig. Custom tools on <a>code/tools</a>. In addition to handmade hero stuff you'll find <a>references</a> and other things in the <a>misc folder</a>.
[]
https://avatars.githubusercontent.com/u/63465728?v=4
blo
alichraghi/blo
2021-10-19T14:17:30Z
If you don't like crabs
main
0
10
0
10
https://api.github.com/repos/alichraghi/blo/tags
MIT
[ "ascii", "cat", "cli", "file", "stdout", "zig" ]
74
false
2024-10-25T07:12:16Z
true
false
unknown
github
[]
Blo Installation zigmod: <code>zigmod aq install 1/alichraghi/blo</code> TODO <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Modification date <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> File type detection <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Syntax highlighting <br/><input type='checkbox' class='w-4 h-4 text-green-500 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' checked disabled></input> Json <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> TOML <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> Markdown <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Zig <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> Yaml <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> C <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Rust <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Javascript <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>PR or Issue</strong> Help Output ``` info: Usage: blo [OPTION]... [FILE]... With no FILE, read standard input. Options: -n, --number prints number of lines -i, --info prints the file info (size, mime, modification, etc) -e, --show-end prints after file -a, --ascii uses ascii chars to print info and lines delimiter -c, --no-color disable printing colored output -h, --help display this help and exit Examples: blo test.txt prints the test.txt content blo copy standard input to output ```
[]
https://avatars.githubusercontent.com/u/43040593?v=4
brainfuck-zig
dantecatalfamo/brainfuck-zig
2021-11-27T02:51:06Z
Brainfuck interpreter written in zig
master
0
9
2
9
https://api.github.com/repos/dantecatalfamo/brainfuck-zig/tags
MIT
[ "brainfuck", "brainfuck-interpreter", "zig" ]
11
false
2024-11-07T08:17:42Z
true
false
unknown
github
[]
Brainfuck-zig Embeddable zig brainfuck interpreter. Usage <code>usage: brainfuck [-e expression] [file path]</code> Embedding ```zig const interpreter = @import("brainfuck-zig/src/main.zig").interpreter; try interpret(program_string, reader, writer, error_writer); ```
[]
https://avatars.githubusercontent.com/u/177491?v=4
create-zig-wasm-app
trashhalo/create-zig-wasm-app
2021-12-27T21:10:44Z
Boilerplate to stand up a SPA app using Zig 0.9 for webassembly and Vite
master
2
9
0
9
https://api.github.com/repos/trashhalo/create-zig-wasm-app/tags
MIT
[ "pin", "vite", "wasm", "webassembly", "zig" ]
11
false
2024-08-25T04:41:06Z
true
false
unknown
github
[]
Create Zig Wasm App Boilerplate to stand up a SPA app using Zig 0.9 for webassembly and Vite. Commands sent using <a>WAPC</a>. Getting started <ul> <li>Get npm/node</li> <li>Get zig 0.9</li> <li>Get gyro for package management</li> <li>Create a deps.zig by running "gyro fetch"</li> <li>Build wasm payload</li> <li><code>npm install</code> to setup vite dependencies</li> <li><code>npm run dev</code> to start your dev server</li> <li>Point your browser at localhost:3000</li> </ul> Source material <ul> <li><a>zig-wasm-dom</a> inspiration on how one might pass js objects back and forth</li> <li><a>tetris</a> much bigger example</li> <li><a>go's syscall</a> example implementation of an api to give a wasm guest control over a js host env.</li> </ul>
[]
https://avatars.githubusercontent.com/u/12070598?v=4
lambda
rvcas/lambda
2022-01-01T21:50:40Z
The Lambda Calculus in Zig
main
0
8
0
8
https://api.github.com/repos/rvcas/lambda/tags
MIT
[ "lambda-calculus", "zig" ]
7
false
2023-11-20T13:42:59Z
true
false
unknown
github
[]
Lambda Calculus A simple implementation of the lambda calculus in zig. Resources <ul> <li>https://www.youtube.com/watch?v=93wbsfoX9iE</li> <li>https://en.wikipedia.org/wiki/Lambda_calculus</li> </ul>
[]
https://avatars.githubusercontent.com/u/1416077?v=4
ray-tracing-weekend.zig
Jack-Ji/ray-tracing-weekend.zig
2021-08-28T20:11:03Z
Zig implementation of famous ray-tracing-in-a-weekend
main
0
8
1
8
https://api.github.com/repos/Jack-Ji/ray-tracing-weekend.zig/tags
MIT
[ "raytracing", "zig" ]
308
false
2024-05-28T09:08:46Z
true
false
unknown
github
[]
ray-tracing-weekend.zig Zig implementation of famous ray-tracing-in-a-weekend dependency zig-0.9.0 master run <blockquote> zig build run -Drelease-fast &gt; sample.ppm </blockquote>
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-leven
nektro/zig-leven
2021-07-27T06:59:53Z
Measure the difference between two slices using the Levenshtein distance algorithm
master
0
8
0
8
https://api.github.com/repos/nektro/zig-leven/tags
MIT
[ "zig", "zig-package" ]
13
false
2025-05-21T20:33:39Z
true
false
unknown
github
[]
zig-leven <a></a> <a></a> <a></a> <a></a> Measure the difference between two slices using the Levenshtein distance algorithm Adapted from https://github.com/sindresorhus/leven Usage <code>pub fn leven(comptime T: type, alloc: *std.mem.Allocator, a: []const T, b: []const T, max: ?usize) !usize</code> Future TODO Unicode support for strings
[]
https://avatars.githubusercontent.com/u/37453713?v=4
zigvale-barebones
ominitay/zigvale-barebones
2021-11-21T11:34:45Z
A brief example of the use of the Zigvale library in a bare-bones kernel.
main
0
8
1
8
https://api.github.com/repos/ominitay/zigvale-barebones/tags
MIT
[ "kernel", "osdev", "stivale", "stivale2", "zig", "ziglang" ]
12
false
2024-07-04T08:42:22Z
true
false
unknown
github
[]
Zigvale Barebones Kernel This is a brief example of how to use the Zigvale library for the stivale2 boot protocol in a simple kernel. Zigvale can be found <a>here</a>. Build To build this, you will need a recent build of Zig, and the <code>zigmod</code> package manager. ``` sh Fetch Zigvale &amp; Limine bootloader zigmod ci Build the kernel zig build iso ``` Run QEMU To run this with QEMU, you (obviously) need QEMU installed with x86 support. ``` sh Run the kernel in QEMU zig build run ``` Bare Metal The kernel is built for x86. To run it, flash the iso you built (found in <code>zig-out/iso/zigvale-barebones.iso</code>) to a removable medium, and boot to it.
[]
https://avatars.githubusercontent.com/u/200686?v=4
dungeon-rush
deckarep/dungeon-rush
2021-09-30T01:30:03Z
👾🐍 A zig port of Dungeon Rush. An open-source game inspired by snake, written in pure Zig with SDL2.
main
0
8
0
8
https://api.github.com/repos/deckarep/dungeon-rush/tags
NOASSERTION
[ "c", "dungeon-crawler", "game", "port", "rogue-like", "sdl", "sdl2", "zig", "ziglang" ]
14,490
false
2025-04-24T03:39:37Z
true
false
unknown
github
[]
DungeonRush in Zig! This is a near exact <strong>Zig port</strong> of the <a>original DungeonRush <code>C-based</code></a> rogue-like game running on SDL2 originally developed by @rapiz1. Status <ul> <li>Fully playable - confirmed working on MacOS, Linux Mint</li> <li>Nearly complete port, no networking or auxillary menus done</li> <li>No known bugs.</li> <li>Many memory leaks were tracked down and fixed using Zig's <code>GeneralPurposeAllocator</code> leak detection feature</li> <li>Game speed is now appropriately throttled and consistent across platforms.</li> <li>Code is largely done, but now being incrementally improved, refactored and cleaned-up</li> </ul> A twist on classic Snake <ul> <li>DungeonRush is a pretty fun game:</li> <li>Cellular automata to generate random dungeon levels</li> <li>Features weapons, buffs, enemies, bosses and loot drops</li> <li>Classic pixel art and animations</li> <li>8-bit style music and many sound sfx</li> </ul> How to play <ul> <li>Each round starts with a random hero in the middle of the dungeon</li> <li>Move the arrow keys: <code>up</code>, <code>down</code>, <code>left</code>, <code>right</code> to control your character</li> <li>Make your party stronger by collecting more heroes</li> <li>Collect weapon and loot drops to become more powerful and heal your party</li> <li>Don't run into walls, bad guys or yourself or you will 💀</li> <li>Your heroes will intelligently attack nearby enemies when they are near</li> <li>To advance to the next round, you must collect a certain amount of heroes</li> <li>Be careful of giant bosses, they can be very powerful</li> </ul> Port Goals <ul> <li>To re-create a moderately complex game, fully in Zig and to get better at the language.</li> <li>To make this port faithful to the original, while being more idiomatic.</li> <li>To identify and fix any <em>possible</em> undefined behaviors or bugs that the Zig compiler catches or that myself or other contributors catch.</li> <li>To ensure the game is as fast and responsive as the original project.</li> <li>To fully eradicate all original C-based files and C-based build scripts.</li> <li>To port in phases:</li> <li>Phase 1: port the C code almost as-is to minimize bugs introduced<ul> <li>✅ Deprecate usage of <code>c.malloc</code>/<code>c.free</code> in all cases</li> <li>✅ Deprecate use of <code>c.qsort</code> with a <code>callconv(.C)</code> callback in favor of Zig's sorting</li> <li>✅ Deprecate all [*c] style pointers</li> <li>✅ Deprecate C-style multi-pointers</li> <li>Find and improve <code>const</code> correctness where applicable</li> </ul> </li> <li>Phase 2: Ziggify<ul> <li>Move away from <code>c_int</code> or C specific types</li> <li>✅ Favor slices over multi-pointers, remove any pointer arithmetic</li> <li>Use more of Zig's stdlib for logging, file-io, etc</li> <li>Utilize <code>defer</code>/<code>errdefer</code> for effective cleanup</li> <li>Migrate to a Zig-based SDL wrapper, for a nicer SDL experience</li> <li>Ensure all errors are accounted for, utilize <code>try</code></li> <li>Use <code>build.zig.zon</code> file for any dependencies</li> <li>✅ Setup Github to build the project regularly</li> </ul> </li> <li>Phase 3: Code Clean-up/Refactor<ul> <li>✅ Gamepad controller support added</li> <li>Remove duplicate code</li> <li>Make code even more idiomatic for Zig</li> <li>Make the code more maintainable</li> <li>Use less globals</li> <li>Remove redundant naming like some enumerations have their container name as the prefix</li> <li>✅ Use some Zig based collections like the <code>generic</code> LinkList over the original C ADT style</li> <li>Get building for other OSes (w/ community contributions)</li> <li>Migrate hardcoded textures, music + sound sfx out of the source code and into config files<ul> <li>This will allow the game to be easily skinned, for a whole new experience.</li> </ul> </li> </ul> </li> <li>Phase 4: ???<ul> <li>I'd love to port this to Raylib.</li> <li>Bonus: Introduce unit-tests</li> </ul> </li> </ul> More baddies? <ul> <li><a>pixel-sprite-mixer</a></li> </ul> Why Zig? Cause it's a game-changing, bad-ass language that unlocks super-powers and was a fun learning experience. Source <ul> <li><code>zrc/</code> - Ziglang port (by @deckarep)</li> <li><code>src/</code> - C-based version (original by @rapiz1)</li> </ul> Installing and Running <ul> <li>Built and tested against <a>Zig 0.13.0</a> release</li> <li>Ensure SDL2 is installed for your OS/Platform</li> <li>From the root folder: <code>zig build run</code></li> </ul> Contributions Want to hack on this project with me? I will welcome all contributions that improve the code while keeping it faithful to the original DungeonRush project. I'd like the game to look and run identical. I'd like help with the phases outlined above. There's plenty of low-hanging fruit that is relevant to beginners and experienced a-like. However, code will be rejected that needlessly complicates the game or does not run identical to the original C project. If people want to change the overall look and feel or game logic, please fork DungeonRush and change it however you like! It is open-source after all! Callouts and Caveats <ul> <li>Zig doesn't have <code>do/while</code> so they've all been replaced with <code>while</code> with a break on a <code>negated</code> condition.</li> <li>Before anyone complains about the port looking like ugly Zig code written like C, this is why I'm taking a multi-phase approach. If you've ever done migrations, changing too many things at once introduces bugs, especially when tests don't exist.</li> <li>All original development was done on Apple MacOS Silcon, contributions are welcome for other OSes.</li> <li>The game has some multi-player networking code, I don't care about it at the moment so it's not started.</li> <li>It's very possible this manual port has introduced a bug or two, the game needs to be well tested.</li> </ul> Future ideas <ul> <li>Introduce heroes that have innate abilities like a Frost Hero that is immune to cold attacks and is able to dish out there own cold attacks. Or a Fire Hero that can't be frozen. Yeah, dumb shit like that.</li> <li>This would make the game a little more interesting because you can pick up cerrtain heroes as part of the strategy to help you cope with the certain level.</li> <li>Introduce themed levels, like a frost level where most or all baddies are cold-based.</li> <li>Introduce upgrades along the way, loot upgrade your heroes.</li> <li>✅ Gamepad support, it might be fun to not always use the damn keyboard.</li> <li>Weather effects, snow, rain, wind, fog-of-war, etc.</li> <li>Show temporary animated scores when certain events occur like picking up loot</li> </ul>
[]
https://avatars.githubusercontent.com/u/3932972?v=4
SLF
ikskuh/SLF
2022-02-05T21:10:11Z
The Simple Linking Format
master
0
8
0
8
https://api.github.com/repos/ikskuh/SLF/tags
MIT
[ "binary", "binutils", "linker", "object-format", "zig", "zig-package", "ziglang" ]
41
false
2024-05-29T09:00:03Z
true
false
unknown
github
[]
⛓ Simple Linking Format SLF is a very simple object file format that can be used to link programs that don't require distinct sections for code and data. Documentation <ul> <li><a>Binary Format</a></li> </ul> Available Tools <ul> <li><code>slf-ld</code> is the standalone linker that can be used to link object files into a flat binary</li> <li><code>slf-objdump</code> is a dumper for SLF files. It can list all sections as well as dump the raw binary data.</li> </ul> Available APIs <code>src/slf.zig</code> is a package that exports several APIs: <ul> <li><code>slf.View</code> allows introspection of in-memory SLF files.</li> <li><code>slf.Linker</code> allows linking SLF files together.</li> <li><code>slf.Builder</code> allows the creation of new SLF files.</li> </ul> Project Status <a></a> <strong>Disclaimer: Feature complete, but still highly experimental.</strong> TODO <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Add better diagnostics <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 support for object/file names <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Support exporting other file 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> flat binary <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> intel hex
[]
https://avatars.githubusercontent.com/u/2389051?v=4
zigescape
squeek502/zigescape
2021-10-04T00:44:29Z
A tool for converting between binary data and Zig string literals
master
0
8
0
8
https://api.github.com/repos/squeek502/zigescape/tags
0BSD
[ "escaping", "string-literals", "zig" ]
16
false
2024-11-23T23:02:06Z
true
true
unknown
github
[ { "commit": "0f2db7700b05356ebb1ccddbbf1797048925f072.tar.gz", "name": "clap", "tar_url": "https://github.com/Hejsil/zig-clap/archive/0f2db7700b05356ebb1ccddbbf1797048925f072.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/Hejsil/zig-clap" } ]
zigescape A tool for converting between binary data and <a>Zig</a> string literals. The original motivation for this was to be able to easily turn inputs found via fuzz testing into strings that can be used in Zig test cases (<a>like in the tests added by this commit</a>). Basic example (more can be found below): <code>sh $ echo '00 01 02 03 04' | xxd -r -p | zigescape "\x00\x01\x02\x03\x04"</code> or with the <code>--hex</code> option, this can be done directly: <code>sh $ zigescape --hex "00 01 02 03 04" "\x00\x01\x02\x03\x04"</code> Building / Installation Precompiled binaries <ol> <li>Go to the <a>latest release</a></li> <li>Download the relevant asset for your OS</li> <li>Rename to <code>zigescape</code> or <code>zigescape.exe</code> and give it executable permission (if necessary on your OS)</li> <li>Move the executable somewhere in your <code>PATH</code></li> </ol> From Source Requires latest master of Zig. <ol> <li><code>zig build</code></li> <li>The compiled binary will be in <code>zig-out/bin</code></li> <li><code>mv</code> or <code>ln</code> the binary somewhere in your <code>PATH</code></li> </ol> Usage ``` Usage: zigescape [-hsx] [-o ] : Either a path to a file, or a Zig string literal (if using --string), or a series of hex bytes in string format (if using --hex). If is not specified, then stdin is used. Available options: -h, --help Display this help and exit. -o, --output Output file path (stdout is used if not specified). -s, --string Specifies that the input is a Zig string literal. Output will be the parsed string. -x, --hex Specifies that the input is a series of hex bytes in string format (e.g. "0A B4 10"). Output will be a Zig string literal. ``` Examples Converting <em>to</em> a string literal: <code>zigescape path/to/file</code> or <code>zigescape &lt; path/to/file</code> or, if you want to output to a file: <code>zigescape path/to/file -o path/to/outfile</code> or, if you want to convert from a series of hex bytes in string format: <code>zigescape --hex "00 01 02 03 04"</code> Converting <em>from</em> string literal <blockquote> Note: shell escaping of arguments can mess with the string literal before it gets parsed, so it's best to use single quotes to bypass shell escaping. </blockquote> <code>zigescape --string '"hello world\n"'</code> The double quotes are optional, <code>zigescape</code> will add them if they are missing: <code>zigescape --string 'hello world\n'</code> To convert from a series of hex bytes to a string literal and then into a binary file: <code>zigescape --hex "00 01 02 03 04" | zigescape --string -o outfile.bin</code> Some silly examples <code>cat</code>ing a file by converting it to a string literal and then parsing it to stdout: <code>zigescape path/to/file | zigescape --string</code> Copying a file by converting it to a string literal and then parsing it: <code>zigescape path/to/file.orig | zigescape --string -o path/to/file.copy</code>
[]
https://avatars.githubusercontent.com/u/7270159?v=4
zig-libssh2
mattnite/zig-libssh2
2021-12-17T16:42:42Z
compile libssh2 in your build.zig
main
3
8
5
8
https://api.github.com/repos/mattnite/zig-libssh2/tags
MIT
[ "build", "ssh", "zig", "zig-package" ]
19
false
2025-04-09T07:44:54Z
true
false
unknown
github
[]
libssh2 build package <a></a> Like this project? If you like this project or other works of mine, please consider <a>donating to or sponsoring me</a> on Github <a>:heart:</a> How to use This repo contains code for your <code>build.zig</code> that can statically compile libssh2. Link to your application In order to statically link libssh2 into your application: ```zig const libssh2 = @import("path/to/libssh2.zig"); pub fn build(b: *std.build.Builder) void { // ... <code>const lib = libssh2.create(b, target, optimize); const exe = b.addExecutable(.{ .name = "my-program", .root_source_file = .{ .path = "src/main.zig" }, }); lib.link(exe); </code> } ```
[]
https://avatars.githubusercontent.com/u/4252848?v=4
lemon_pie
Luukdegram/lemon_pie
2021-06-26T15:25:00Z
Library to build fast, reliable, Gemini servers with ease
master
5
8
1
8
https://api.github.com/repos/Luukdegram/lemon_pie/tags
MIT
[ "gemini", "gemini-protocol", "gemini-server", "server", "web", "zig", "ziglang" ]
39
false
2024-07-26T08:01:08Z
true
false
unknown
github
[]
Lemon Pie Lemon pie is a library to build <a>Gemini</a> servers. It's implemented in <a>Zig</a> and its main goal is to provide the building blocks with enough customizability to either depend on its implementation to do the work for you, or provide the access to do it yourself. This allows us to support all use cases if you're willing to handle some of the checks yourself. As Gemini is a very small protocol with a small specification, it allows us to implement the entire specification without relying on any other library apart from TLS support. To access Gemini, you'll need a client which supports its protocol. Some examples are: - <a>Kristall</a> [GUI, C++ (QT)] - <a>Amfora</a> [TUI, Go] - <a>Bombadillo</a> [TUI, Go, VIM keybindings] Status Lemon Pie is still very much work-in-progress. TLS 1.2 or higher is a requirement for Gemini and must be implemented to match the Gemini specification. The goal is to add server support to <a>IguanaTLS</a> and then leverage this library for TLS support. A secondary goal is to provide a set of tools to make it easier to write and serve Gemini content. The <a>specification</a> describes the Gemini mime-type and how content is laid out. A tool could be a simple formatter to write such content. Example An example will be provided once the API is more stable. This requires us to support TLS first.
[]
https://avatars.githubusercontent.com/u/102242?v=4
zlox
nathanleiby/zlox
2021-11-02T04:44:04Z
zlox implements the Lox programming language in Zig
main
1
8
3
8
https://api.github.com/repos/nathanleiby/zlox/tags
-
[ "crafting-interpreters", "lox", "zig" ]
327
false
2024-09-27T10:57:30Z
true
false
unknown
github
[]
zlox <code>zlox</code> implements the Lox programming language in Zig. The repo implements the "Bytecode Virtual Machine" for Lox from the Crafting Interpreters book. It follows the 2nd part of the book. I have previously implemented the first part of the book ("Tree-walk Interpreter") in Julia, here: https://github.com/nathanleiby/jlox
[]
https://avatars.githubusercontent.com/u/18542095?v=4
ziglings-stream
achou11/ziglings-stream
2021-09-17T19:43:32Z
Me doing the ziglings
main
0
7
0
7
https://api.github.com/repos/achou11/ziglings-stream/tags
MIT
[ "exercises", "zig" ]
121
false
2023-08-05T22:44:22Z
true
false
unknown
github
[]
Ziglings Welcome to Ziglings! This project contains a series of tiny broken programs. By fixing them, you'll learn how to read and write <a>Zig</a> code. Those tiny 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://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>bash $ zig version 0.9.0-dev.137+xxxxxxxxx</code> Clone this repository with Git: <code>bash $ git clone https://github.com/ratfactor/ziglings $ cd ziglings</code> Then run <code>zig build</code> and follow the instructions to begin! <code>bash $ zig build</code> A Note About Versions 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.7.1</code>, but Ziglings needs a dev build with pre-release version "0.9.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. Also note that the current "stage 1" Zig compiler is very strict about input: <a>no tab characters or Windows CR/LF newlines are allowed</a>. Version Changes <ul> <li>2021-06-14 0.9.0-dev.137 - std.build.Id <code>.Custom</code> is now <code>.custom</code></li> <li>2021-04-21 0.8.0-dev.1983 - std.fmt.format() <code>any</code> format string required</li> <li>2021-02-12 0.8.0-dev.1065 - std.fmt.format() <code>s</code> (string) format string required</li> </ul> Advanced Usage It can be handy to check just a single exercise or <em>start</em> from a single exercise: <code>bash zig build 19 zig build 19_start</code> You can also run without checking for correctness: <code>bash zig build 19_test</code> Or skip the build system entirely and interact directly with the compiler if you're into that sort of thing: <code>bash zig run exercises/001_hello.zig</code> Calling all wizards: To prepare an executable for debugging, install it to zig-cache/bin with: <code>bash zig build 19_install</code> TODO 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> Planned exercises: 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</li> <li>[ ] Working with C?</li> </ul> Modules and the Zig Standard Library <ul> <li>[ ] Imports</li> <li>[ ] Allocators</li> <li>[ ] Arraylist</li> <li>[ ] Filesystem</li> <li>[ ] Readers and Writers</li> <li>[ ] Formatting</li> <li>[ ] Random Numbers</li> <li>[ ] Crypto</li> <li>[ ] Threads</li> <li>[ ] Hash Maps</li> <li>[ ] Stacks</li> <li>[ ] Sorting</li> <li>[ ] Iterators</li> </ul> The initial topics for these exercises were unabashedly cribbed from <a>ziglearn.org</a>. I've since moved things around in an order that I think best lets each topic build upon each other.
[]
https://avatars.githubusercontent.com/u/3598852?v=4
zshim
svercl/zshim
2021-02-21T21:11:38Z
A shim for Scoop.
main
0
7
1
7
https://api.github.com/repos/svercl/zshim/tags
NOASSERTION
[ "scoop", "zig" ]
27
false
2024-05-25T00:43:38Z
true
false
unknown
github
[]
<code>zshim</code> zshim is the <a><code>shim</code></a>. Building Requirements: <ul> <li><a>Zig 0.12.0</a></li> <li>git</li> </ul> Once you have those, then it's as easy as: <code>shell git clone https://github.com/svercl/zshim.git cd zshim zig build -Doptimize=ReleaseSafe</code> Installation The easiest way to install this is to replace the <code>shim.exe</code> in your scoop install folder. If you use vanilla, this will be <code>$SCOOP/support/shimexe/bin/shim.exe</code> and running the command <code>scoop reset *</code> will replace all shims with this one. Limitations Does not handle elevation of any kind. (PRs welcomed) Similar works <ul> <li>https://github.com/71/scoop-better-shimexe</li> <li>https://github.com/zoritle/rshim</li> </ul> License This work is dual-licensed under MIT and The Unlicense. You can choose between one of them if you use this work. <code>SPDX-License-Identifier: MIT OR Unlicense</code>
[]
https://avatars.githubusercontent.com/u/53620720?v=4
bf-interpreter-zig
willdoescode/bf-interpreter-zig
2021-03-25T05:32:25Z
Ziglang bf interpreter
main
0
7
0
7
https://api.github.com/repos/willdoescode/bf-interpreter-zig/tags
-
[ "bf", "brainfuck", "brainfuck-interpreter", "zig", "ziglang" ]
940
false
2025-02-08T03:21:37Z
true
false
unknown
github
[]
BF zig interpreter Rules <ul> <li>&gt; move cell pointer forward</li> <li>&lt; move cell pointer backward</li> <li>+ increment current cell</li> <li>- decrement current cell</li> <li>, take a character as input and assign to current cell</li> <li>. output character value of current cell</li> <li>[ start loop</li> <li>] end loop if current cell is zero</li> </ul> Using First build with the steps above Then move the executable build from zig-cache/bin/ to your path <code>&lt;execname&gt; examples/mandel.bf</code> Building For fastest build <code>shell zig build -Drelease-small</code> For debug build <code>shell zig build</code>
[]
https://avatars.githubusercontent.com/u/813865?v=4
lispz
bnjmnt4n/lispz
2021-04-01T15:38:05Z
A Lisp interpreter written in Zig.
main
0
7
0
7
https://api.github.com/repos/bnjmnt4n/lispz/tags
-
[ "lisp", "zig" ]
76
false
2024-05-28T20:33:50Z
true
false
unknown
github
[]
lispz A Lisp interpreter written in <a>Zig</a>, based on the <a>Writing a Lisp</a> series. Usage <ol> <li>Install <a>Zig v0.10.0</a>.</li> <li> Execute the following <code>sh $ git clone --recursive https://github.com/bnjmnt4n/lispz.git $ cd lispz $ zig build run</code> </li> </ol>
[]
https://avatars.githubusercontent.com/u/43040593?v=4
tlpr-zig
dantecatalfamo/tlpr-zig
2021-12-03T04:32:35Z
Thermal printer zig library and cli
master
1
7
0
7
https://api.github.com/repos/dantecatalfamo/tlpr-zig/tags
-
[ "cli", "escpos", "thermal-printer", "zig", "zig-library" ]
64
false
2022-01-20T15:41:11Z
true
false
unknown
github
[]
tlpr-zig Library Most ESC/POS commands are implemented in <code>src/commands.zig</code>. CLI ``` usage: tlpr --ip [options] tlpr --stdout [options] Thermal Line Printer application. Prints input through thermal printer. <code>-c cut paper after printing. -e emphasis -n don't initialize the printer when connecting -r reverse black/white printing -u underline -uu double underline --alt use alternate font --file &lt;path&gt; read input from file instead of stdin --height &lt;1-8&gt; select character height --image &lt;path&gt; print an image --ip the IP address of the printer --justify &lt;left|right|center&gt; --macro use roff-like macro language --rotate rotate 90 degrees clockwise --stdout write commands to standard out instead of sending over a socket --threshold &lt;value&gt; image b/w threshold, 0-255 (default 150). --threshold &lt;min-max&gt; image b/w threshold, randomized between min-max per pixel --upsidedown enable upside down mode --width &lt;1-8&gt; select character width --wrap &lt;num&gt; wrap lines at &lt;num&gt; characters </code> ```
[]
https://avatars.githubusercontent.com/u/9347096?v=4
mimalloc-zig-wrapper
massivelivefun/mimalloc-zig-wrapper
2021-09-09T06:09:16Z
A lightweight implementation of Zig's std.mem.Allocator interface that wraps around Microsoft's mimalloc.
main
0
7
0
7
https://api.github.com/repos/massivelivefun/mimalloc-zig-wrapper/tags
MIT
[ "library", "memory-allocator", "wrapper-api", "zig" ]
19
false
2025-04-12T19:01:16Z
true
false
unknown
github
[]
mimalloc-zig-wrapper A lightweight implementation of Zig's std.mem.Allocator interface that wraps around Microsoft's mimalloc. Usage Use this library as a Zig library (<a>instructions here</a>) and then add something like this to your root source file: ```zig const mimalloc = @import("mimalloc-zig-wrapper"); const mi = mimalloc.mimalloc_allocator; pub fn main() !void { const memory = try mi.alloc(i32, 1); memory[0] = 12; mi.free(memory); } ``` Build You might have to go into <code>build.zig</code> and fix up the paths to point to the right libraries. zig build Test zig build test
[]
https://avatars.githubusercontent.com/u/2326560?v=4
zoap
nmeum/zoap
2021-10-03T09:31:53Z
A WiP CoAP implementation for bare-metal constrained devices in Zig
master
0
7
1
7
https://api.github.com/repos/nmeum/zoap/tags
AGPL-3.0
[ "bare-metal", "coap", "coap-server", "embedded", "zig" ]
104
false
2025-02-14T03:15:18Z
true
true
0.13.0
github
[]
zoap A WiP <a>CoAP</a> implementation for bare-metal <a>constrained devices</a> in <a>Zig</a>. Status Presently, the majority of the CoAP standard is not implemented. However, creating a very basic CoAP server which sends and receives non-confirmable messages is possible and already done as part of my <a>zig-riscv-embedded</a> project. Since the code focus on constrained bare-metal targets, it is optimized for a small memory footprint and uses statically allocated fixed-size buffers instead of performing dynamic memory allocation. Furthermore, it does not use any OS-specific code from the Zig standard library (e.g. Sockets). The code is known to compile with Zig <code>0.13.0</code>. Usage As noted above, this library targets freestanding constrained devices. For this reason, all memory is statically allocated. To implement a CoAP server with zoap, the central data structure is the Dispatcher. This Dispatcher takes a list of Resources and forwards incoming requests to them if the URI in the request matches one of the available resources. Both, the dispatcher and the resources need to be statically allocated, e.g. as global variables: <code>const resources = &amp;[_]zoap.Resource{ .{ .path = "hello", .handler = helloHandler }, .{ .path = "about", .handler = aboutHandler }, }; var dispatcher = zoap.Dispatcher{ .resources = resources, }; </code> The code above allocates a dispatcher with two resources: <code>/hello</code> and <code>/about</code>. An incoming CoAP request for either of those resources invokes the associated handler function. The <code>helloHandler</code> implementation may looks as follows: <code>pub fn helloHandler(resp: *zoap.Response, req: *zoap.Request) codes.Code { if (!req.header.code.equal(codes.GET)) return codes.BAD_METHOD; const w = resp.payloadWriter(); w.writeAll("Hello, World!") catch { return codes.INTERNAL_ERR; }; return codes.CONTENT; } </code> The function takes two parameters: The resulting CoAP response and the incoming CoAP request. The handler returns the CoAP response code for the incoming request. The implementation above first checks the request method, if it doesn't match the expected method a response with a Method Not Allowed status code is returned. Otherwise, the <code>helloHandler</code> writes <code>Hello, World!</code> to the response body and, unless an error occurs, it responses with a successful content response code. In order to invoke these handlers, incoming CoAP requests need to be forwarded to the Dispatcher via the <code>Dispatcher.dispatch</code> method which takes an incoming CoAP request as a parameter and forwards it to the matching resource (if any). The method returns the appropriate CoAP response. Since this library attempts to be OS-independent, the code for retrieving incoming requests and sending responses to these requests depends on your environment. For example, CoAP request may be read from a UDP socket in a POSIX environment. For or a more detailed and complete usage example refer to <a>zig-riscv-embedded</a> which reads incoming requests from a <a>SLIP</a> serial interface. Test vectors For parsing code, test vectors are created using the existing <a>go-coap</a> implementation written in <a>Go</a>. Test vectors are generated using <code>./src/testvectors/generate.go</code> and available as <code>./src/testvectors/*.bin</code> files. These files are tracked in the Git repositories and thus Go is not necessarily needed to run existing tests. Each Zig test case embeds this file via <a><code>@embedFile</code></a>. All existing Zig parser test cases can be run using: <code>$ zig test src/packet.zig </code> New test cases can be added by modifying <code>./src/testvectors/generate.go</code> and <code>./src/packet.zig</code>. Afterwards, the test case files need to be regenerated using: <code>$ cd ./src/testvectors &amp;&amp; go build -trimpath &amp;&amp; ./testvectors </code> New test vectors must be committed to the Git repository. License This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <a>https://www.gnu.org/licenses/</a>.
[]
https://avatars.githubusercontent.com/u/48922451?v=4
websocket
otsmr/websocket
2022-01-25T19:15:35Z
Learning different langs by implementing the WebSocket protocoll.
main
0
7
0
7
https://api.github.com/repos/otsmr/websocket/tags
-
[ "cpp", "rust", "websocket", "zig" ]
622
false
2024-11-16T13:39:53Z
false
false
unknown
github
[]
Implementing WebSocket to learn Sometimes I just want to learn a new language, and no, that has nothing to do with <a>ThePrimeagen</a> (<a>2022</a>, <a>2023</a>, <a>2024</a>). Languages 2024 (current): Zig <code>sh cd zig/ zig build run</code> Then open <code>chat.html</code> for a simple chat application. 2023 - Rust <code>sh cd rust/ cargo run</code> 2022 - C++ <code>sh cd cpp/ ./build.sh run</code> Getting started <ol> <li>Select lang and start server (see above)</li> <li>Create test connection: <code>sh cat ./corpus/handshake - | nc localhost 3000</code></li> </ol> tests The server implementation can be tested with the <a>Autobahn|Testsuite</a> as follows: ```bash (rust) $ RUST_LOG=debug cargo run --bin wsserver_autobahn $ docker run -it --rm --net=host \ -v "${PWD}/tests:/config" \ -v "${PWD}/tests/reports:/reports" \ --name fuzzingclient \ crossbario/autobahn-testsuite \ wstest -m fuzzingclient --spec /config/fuzzingclient.json ```
[ "https://github.com/Thomvanoorschot/backstage", "https://github.com/discord-zig/discord.zig", "https://github.com/karlseguin/http.zig" ]
https://avatars.githubusercontent.com/u/9960268?v=4
sasshimi
ducdetronquito/sasshimi
2021-08-29T08:00:30Z
A toy SASS compiler 🍣
master
1
7
2
7
https://api.github.com/repos/ducdetronquito/sasshimi/tags
-
[ "sass", "zig" ]
28
false
2023-10-21T10:22:17Z
true
false
unknown
github
[]
Sasshimi 🍣 <a></a> A toy experiment to build a SASS compiler in Zig. Goals <ol> <li>Have fun when I don't want to work on <a>requestz</a></li> <li>Learn how a compiler works</li> <li>???</li> <li>Profit, obviously</li> </ol> Usage <code>zig build run -- "a SCSS formatted string"</code> State ```scss /<em> input.scss </em>/ $zig-orange: #f7a41d; form { margin: 0; padding: 0; .button { border: 1px solid $zig-orange; } } ``` ```css /<em> output.css </em>/ form { margin: 0; padding: 0; } form .button { border: 1px solid #f7a41d; } ```
[]
https://avatars.githubusercontent.com/u/23049896?v=4
zig-deb
compscidr/zig-deb
2021-09-30T16:03:56Z
Package zig into an apt package for installing on debian / ubuntu
main
6
6
1
6
https://api.github.com/repos/compscidr/zig-deb/tags
Apache-2.0
[ "apt", "debian", "ubuntu", "zig" ]
43
false
2025-03-20T06:44:58Z
false
false
unknown
github
[]
zig-deb Package <a>zig</a> from the release into an apt package for installing on debian / ubuntu. Uses the binary build from the zig release page. To use, add the following to <code>/etc/apt/sources.list.d/zig.list</code>: <code>deb [trusted=yes] https://apt.fury.io/compscidr/ /</code> Then run: <code>sudo apt update sudo apt install zig</code> todo <br/><input type='checkbox' class='w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' disabled></input> Automate deploy when a new release has come out
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-iana-tlds
nektro/zig-iana-tlds
2021-04-14T08:30:24Z
List of official IANA Top Level Domain Names
master
0
6
0
6
https://api.github.com/repos/nektro/zig-iana-tlds/tags
MIT
[ "zig", "zig-package" ]
44
false
2025-05-21T20:33:26Z
true
false
unknown
github
[]
zig-iana-tlds <a></a> <a></a> <a></a> <a></a> list of official IANA Top Level Domain Names. https://data.iana.org/TLD/tlds-alpha-by-domain.txt
[]
https://avatars.githubusercontent.com/u/10274397?v=4
zig-pico
Linouth/zig-pico
2021-12-02T22:29:10Z
Framework for writing Zig applications for the RPi Pico.
master
0
6
0
6
https://api.github.com/repos/Linouth/zig-pico/tags
-
[ "bare-metal", "rp2040", "rpi-pico", "zig", "ziglang" ]
375
false
2025-01-10T03:50:41Z
true
false
unknown
github
[]
zig-pico - RP2040/Pico SDK for Zig This framework is for writing zig applications for the Pico microcontroller (RP2040). It is far from finished but can be a great starting point for your own projects. The project is in active development so anyting can change still. Any help would also be appreciated. Right now it only runs from RAM, no QSPI flash support (boot-stage2) has been implemented yet. Usage Currently you can build your own application by using a <code>build.zig</code> file like~ ``` const std = @import("std"); const pico = @import("libs/zig-pico/build.zig"); pub fn build(b: *std.build.Builder) !void { const mode = b.standardReleaseOptions(); <code>const pico_exe = pico.PicoExe.init(b, "myproject", "src/main.zig"); const exe = pico_exe.exe; exe.setBuildMode(mode); exe.install(); </code> } ``` For flashing you have to convert the elf file to a uf2 file manually (with the uf2 tool from the pico-sdk repo) and copy it to the pico mass storage drive. You could also use the picoboot tool for flashing. Currently I mostly use a gdb session with the swd interface for flashing. In the future this will be done with the zig build system itself. Progress Systems and Peripherals Following are systems and peripherals taken from the datasheet. <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> SIO <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> Spinlocks <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> Integer dividers <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> Interpolators <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> FIFOs <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> SysTick Timer <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> MPU <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> NVIC <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> DMA <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> Core Supply Regulator <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> Power Control <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> Chip-Level Reset <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> Power-On State Machine <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> Subsystem Resets <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> Clocks <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> XOSC <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> ROSC <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> PLL ❕ <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> GPIO ❕ <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> Manual read and writes <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> Interrupts <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> PIO <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> USB <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> UART <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> I2C <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> SPI <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> PWM <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> Timer <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> RTC <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> ADC and Temperatue Sensor <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> SSI Peripherals marked with ❕ are working, but could use some improvements. General TODOs Some general TODOs. There are more TODOs sprinkled throughout the 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> Figure out how to use the set of functions provided in the Bootrom. (float and double operations, memory operations, and more). <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> Find a way to determine at compile time which modules are used, and add initialization code for these modules to the reset sequence. <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> Implement error handler in <code>crt0.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> Add a boot-stage2 bootloader. <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 on demand compilation (and caching) for the picoboot, pioasm and uf2 tools in the pico-sdk. Notes <ul> <li>All peripherals are put in 'reset' state after a hard reset. You cannot write to their registers while in the reset state. First set the 'RESETS' register to enable the peripherals you need.</li> </ul>
[]
https://avatars.githubusercontent.com/u/44317699?v=4
zline
ajkachnic/zline
2021-10-18T01:54:35Z
A powerful line editor for Zig
main
0
6
0
6
https://api.github.com/repos/ajkachnic/zline/tags
-
[ "line-editor", "zig" ]
12
false
2024-06-23T21:58:52Z
true
false
unknown
github
[]
<blockquote> 🚩 <strong>This project is archived!</strong> 🚩 <em>It should still work well (at least for basic use cases), but I encourage someone else to take this code and make it better</em> </blockquote> zline <strong><em>IMPORTANT</em></strong>: <em>please note that this is a very WIP project, and probably not even ready for hobby usage. the API will probably change a million times before it's stabilized, so </em><em>use at your own risk</em>** A simple yet powerful line editor for Zig. Installation Since zline is just one file (<code>zline.zig</code>), the simplest installation option is just downloading the file and putting it into your build setup. A sample <code>build.zig</code> with this approach looks like this: ```zig const Builder = @import("std").build.Builder; pub fn build(b: *Builder) void { const mode = b.standardReleaseOptions(); <code>const lib = b.addStaticLibrary("zline", "src/main.zig"); lib.setBuildMode(mode); lib.install(); var main_tests = b.addTest("src/main.zig"); main_tests.setBuildMode(mode); const test_step = b.step("test", "Run library tests"); test_step.dependOn(&amp;main_tests.step); </code> } ``` Usage After installing, getting up and running is pretty simple: ```zig const std = @import("std"); const zline = @import("zline"); // Or however you have this set up pub fn main() anyerror!void { var arena = std.heap.ArenaAllocator.init(); defer arena.deinit(); <code>var alloc = &amp;arena.allocator; var rl = zline.Editor(struct {}).init(alloc, null, .{}); defer rl.deinit(); // Run clean-up code while (true) { if (rl.readline("&gt;&gt; ")) |line| { if (std.mem.eql(u8, line, "quit")) { break; } std.io.getStdOut().writer().print("line: {s}", .{ line }); // If not using an arena allocator, make sure you call `alloc.free` here } else |err| { return err; } } </code> } ``` More advanced usage is covered in <a><code>USAGE.md</code></a> and the examples. API documentation is in <a><code>API.md</code></a> Why not use <code>linenoise</code>? Since Zig has easy to use C bindings, why shouldn't you just use <code>linenoise</code>? Off the bat, I'd say <code>linenoise</code> is a wonderful library. It achieves all of it's goals, and I'd take it any day over readline. However, <code>linenoise</code> does not satisfy many of Zig's goals/best practices, like: <ul> <li>Allowing custom memory allocators</li> <li>Using Zig style <code>try</code>/<code>catch</code> error handling</li> </ul> In addition, it's API isn't as clean as a pure Zig API. Besides all these things, I also just wanted to try my hand at writing a line editor. Prior Work <ul> <li><a>linenoise</a></li> <li><a>rustyline</a></li> <li><a>readline</a></li> </ul>
[]
https://avatars.githubusercontent.com/u/237442?v=4
zitt
pedromsilvapt/zitt
2021-06-09T22:27:29Z
Experimental Zig chainable iterators library
master
0
6
0
6
https://api.github.com/repos/pedromsilvapt/zitt/tags
-
[ "functional-programming", "iterators", "streams", "zig" ]
26
false
2022-05-10T09:14:18Z
true
false
unknown
github
[]
zitt This repository contains an experimental iterator repository. Native iterators in Zig are considered by this library as any structure that provides a <code>next</code> method and that returns an optional. This library provides a function <code>itt</code> that can be used to wrap any array, slice or native iterator into a chainable iterator. A Chainable Iterator also has a method <code>next</code>, like native iterators, but provides a wealth of other base chainable operators such as <code>map</code>, <code>filter</code>, etc... The library also provides a pretty straightforward way to allow the user to include his own custom iterator operators and use them the same way as base operators. Requirements <ul> <li>Zig v0.8</li> </ul> Usage ```zig const std = @import("std"); const expect = std.testing.expect; const itt = @import("zitt"); test { var array = [_]Number{ Number{ .value = 1 }, Number{ .value = 2 }, Number{ .value = 3 }, }; <code>var iter = itt.from(array) .mapField(.value) .map(square) .mapCtx(add, @as(i32, 2)); try expect(iter.next().? == 3); try expect(iter.next().? == 6); try expect(iter.next().? == 11); try expect(iter.next() == null); </code> } // Helper Declarations pub const Number = struct { value: i32 }; pub fn square(number: i32) i32 { return number * number; } pub fn add(constant: i32, number: i32) i32 { return constant + number; } ``` Custom Operators ```zig const IttGeneric = @import("zitt").IttGeneric; const meta = @import("zitt").meta; /// First we need to create a new operator. Usually each operator can have one /// or more chainable functions (in this case, one called <code>take</code>) and a /// Chainable Iterator that is returned by calling the operator function. fn MyCustomTakeOperator(comptime Itt: type) type { return struct { pub fn take(self: Itt, number: usize) Iterator { return Iterator{ .source = self, .number = number }; } <code> /// Note that this is not public, because we do not want this declaration /// being available after calling itt, like `itt(...).Iterable` /// If we want our iterable to be accessible to the outside world, we can /// declare it as a generic function outside the operator const Iterator = struct { /// The iterator almost always has the field `source: Itt`, followed /// by the operator-specific fields. source: Itt, number: usize, consumed: usize = 0, /// Each chainable iterator also needs this as a public declaration /// This is the type of the source iterator that this operator was built for pub const Source = Itt; /// The final piece required of each iterator is, of course, the /// `next` method. It should always receive only a pointer to itself, /// and return an optional Elem pub fn next(self: *Iterator) meta.AutoReturn(Itt.ErrorSet, ?Itt.Elem) { if (self.consumed &lt; self.number) { self.consumed += 1; // Note that if our `self.number` is bigger than the amount // of elements in the source iterator, we are going to be // calling `source.next` multiple times after the iterator // has been exhausted/emptied. This is fine because all // iterators should return null all the time after being // emptied, and in this case we can take advantage of that return if (Itt.ErrorSet != null) try self.source.next() else self.source.next(); } return null; } /// Finally, we need to import our utility IttGeneric, by passing /// operators currently being used, as well as this very own /// iterator type. This is what allows all operators to be chainable pub usingnamespace IttGeneric(Itt.Operators, Iterator); }; }; </code> } // Then we can, on the **<em>root Zig file</em> of our application, declare a public function // to include our custom operator method. This function should return a struct, // where every declaration of this struct will be available in the chainable iterators pub fn IttCustomOperators(comptime Itt: type) type { return struct { pub usingnamespace MyCustomTakeOperator(Itt); }; } // An alternative to this approach is to use the IttFactory // This gives us more customization options, such as being able to use // different operators in different situations, or even not including the base // operators const IttFactory = @import("zitt").IttFactory; const IttBaseOperators = @import("zitt").IttBaseOperators; const IttBaseGenerators = @import("zitt").IttBaseGenerators; /// This function merges the base operators as well as our custom operator /// Note that this is a generic function, just like our operator. This is /// because all operators are instanced for every type of source operator they /// are called for. This has some neat advantages, such as being able to declare /// different operators for different sources (for example, have a <code>sum()</code> be /// available only for cases when Itt.Elem is a numeric type). fn IttCustomLocalOperators(comptime Itt: type) type { return struct { pub usingnamespace IttBaseOperators(Itt); pub usingnamespace MyCustomTakeOperator(Itt); }; } /// Create the wrapper function, by giving it the operators const custom_itt = IttFactory(IttCustomLocalOperators, IttBaseGenerators); test { var array = [_]Number{ Number{ .value = 1 }, Number{ .value = 2 }, Number{ .value = 3 }, }; <code>var iter = custom_itt.from(array) .take(2); try expect(iter.next().?.value == 1); try expect(iter.next().?.value == 2); try expect(iter.next() == null); </code> } ``` Architecture Right now this library is pretty comptime heavy, I figure, and honestly I'm not yet sure if it is a lucky stroke of genius or a Frankenstein-like work. Regardless, if you've got any comments or suggestions for it, please do let me know! :) Building/Testing To build and/or run the tests, just execute either of the following commands: <code>bash zig build zig build test</code>
[]
https://avatars.githubusercontent.com/u/471335?v=4
AnyTest
timfjord/AnyTest
2021-08-23T13:28:24Z
Run any test from Sublime Text
main
2
6
1
6
https://api.github.com/repos/timfjord/AnyTest/tags
MIT
[ "cucumber", "elixir", "exunit", "go", "java", "javascript", "jest", "minitest", "pytest", "python", "pyunit", "rspec", "ruby", "rust", "sublime-text", "swift", "test-runner", "testing", "testing-tools", "zig" ]
237
false
2024-12-26T02:00:02Z
false
false
unknown
github
[]
<a></a> AnyTest <a></a> <a></a> Run any test from Sublime Text A Sublime Text 3/4 package whose main idea is to automatically detect a test framework for the given file and run it. It is a Sublime Text interpretation of the awesome <a>vim-test</a> plugin. Currently, the following test frameworks are supported (more test frameworks are coming soon): | Language | Test framework | Identifiers | |---------------:|:-------------------------------------------------------------------|:-----------------------------------------------------------------| | <strong>Elixir</strong> | ESpec, ExUnit | <code>espec</code>, <code>exunit</code> | | <strong>Go</strong> | Delve, Ginkgo, Gotest | <code>delve</code>, <code>ginkgo</code>, <code>gotest</code> | | <strong>Java</strong> | JUnit (with Maven or Gradle) | <code>junit</code> | | <strong>JavaScript</strong> | Jest, Mocha, Vitest | <code>jest</code>, <code>mocha</code>, <code>vitest</code> | | <strong>Python</strong> | Behave, Django(including Nose), Mamba, Nose, Nose2, PyTest, PyUnit | <code>behave</code>, <code>django</code>, <code>mamba</code>, <code>nose</code>, <code>nose2</code>, <code>pytest</code>, <code>pyunit</code> | | <strong>Ruby</strong> | Cucumber, M, Minitest, Rails, RSpec, Test Bench | <code>cucumber</code>, <code>m</code> ,<code>minitest</code>, <code>rails</code>, <code>rspec</code>, <code>test_bench</code> | | <strong>Rust</strong> | Cargo | <code>cargotest</code> | | <strong>Switft</strong> | XCTest | <code>xctest</code> | | <strong>Zig</strong> | Zigtest | <code>zigtest</code> | Feel free to <a>open an issue</a> with a test framework request as those test frameworks will be added first. Installation <ol> <li>Install the <a>Sublime Text Package Control</a> package if you don't have it already.</li> <li>Open the command palette and start typing <code>Package Control: Install Package</code>.</li> <li>Enter <code>AnyTest</code>.</li> </ol> Usage The main command that the package exposes is <code>any_test_run</code>. It supports 4 scopes: • suite scope <code>json { "command": "any_test_run", "args": { "scope": "suite" } }</code> or <code>AnyTest: Test suite</code> in the command palette. Runs the whole test suite (based on the current file) • file scope <code>json { "command": "any_test_run", "args": { "scope": "file" } }</code> or <code>AnyTest: Test file</code> in the command palette. Runs all tests in the current file • line scope <code>json { "command": "any_test_run", "args": { "scope": "line" } }</code> or <code>AnyTest: Test line</code> in the command palette. Runs the test nearest to the current line(cursor) • last scope <code>json { "command": "any_test_run", "args": { "scope": "last" } }</code> or <code>AnyTest: Test last</code> in the command palette. Runs the last test The package tries to detect a test framework based on the current file. When the framework is detected the package generates a command and runs it using the selected runner. When the <code>edit</code> flag is passed to <code>true</code> then the command can be edited before running. And finally, if the <code>select</code> flag is passed to <code>true</code> then the auto-detection feature is bypassed and the quick panel with all available test frameworks is shown allowing to select a test framework manually. The package keeps the 10 last test commands in history that can be accessed with the <code>AnyTest: Show history</code> command. The history can be cleared with the <code>AnyTest: Clear history</code> command. The package comes with polyfills for test frameworks that don't have built-in support for running tests for the current line. All the polyfills have been borrowed from the <code>vim-test</code> plugin and adapted for Sublime Text. All the package commands can be found in <a>Default.sublime-commands</a> By default the package doesn't define any key bindings, run <code>Preferences: AnyTest Key Bindings</code> to define your own bindings. Configuration The package can be configured either globally or at the project level. Settings defined at the project level override settings defined globally. To configure the package at the project level all settings must be added under the <code>AnyTest</code> namespace: <code>json { "folders": [ { "path": ".", } ], "settings": { "AnyTest": { "test_frameworks": { "python": "pyunit" }, "python.pyunit.runner": "unittesting" } } }</code> The package provides schemas for its settings so it is recommended to install <a>LSP-json</a> to have settings autocomplete. To see all available settings please check <a>AnyTest.sublime-settings</a> By default, the package iterates through all available test frameworks to detect the one to use. This can be changed with the <code>test_frameworks</code> setting: <code>json "test_frameworks": { "python": "pyunit" }</code> or <code>json "test_frameworks": { "python": ["pyunit", "pytest"] }</code> this way all other test frameworks will be ignored. Also, some languages support specifying test frameworks, for example <code>json "python.test_framework": "pytest"</code> This won't change the detection process, but if there are multiple candidates the specified one will be used. Project folders and subprojects The package supports multiple project folders. It can be very useful when there is a nested folder that contains a separate project. The package can detect this situation and calculate the root path correctly. Another way to handle nested projects is to use the <code>subprojects</code> settings (usually in the project config) <code>json { "folders": [ { "path": ".", } ], "settings": { "AnyTest": { "subprojects": [ "subfolder1/subfolder1_1", ["subfolder2", "subfolder2_1"] ] } } }</code> A subproject can be either a string or an array of strings(the path separator will be added automatically). Runners The package comes with 3 runners: <ul> <li><code>command</code></li> <li><code>terminus</code></li> <li><code>console</code></li> </ul> The default runner is the <code>command</code>. It uses the built-in Sublime <code>exec</code> command(the command can be configured) to run the test command. The <code>command</code> runner is a bit limited so it is recommended to install <a>Terminus</a> package and use the <code>terminus</code> runner instead. The <code>console</code> runner is mostly used for testing/debugging as its main purpose is to output the test command and metadata to the console. Runners can be activated globally, per language or framework: <code>json "runner": "terminus", "python.runner": "command", "python.pyunit.runner": "unittesting"</code> Please consult with <a>AnyTest.sublime-settings</a> to check all available settings. There is also the <code>unittesting</code> runner and it should be used to test sublime packages with <a>UnitTesting</a>. Unfortunately, due to <code>UnitTesting</code> limitations, there is no way to run tests for the current line. Using <code>unittesting</code> only makes sense with PyUnit test framework, so it is usually activated as: <code>json "python.pyunit.runner": "unittesting"</code> Roadmap <ul> <li>Add more test frameworks (the end goal is to at least support all the test frameworks that <code>vim-test</code> supports)</li> <li>Run tests from the Side Bar (including testing folders)</li> <li>Potentially integrate the package with <a>Sublime Debugger</a></li> </ul> Contribution The easiest way to add a new test framework is to find it in <a>the <code>vim-test</code> repository</a> and try to adapt it. It is also required to cover the test frameworks with tests. Tests and fixtures can be also found in <a>the <code>vim-test</code> repository</a> The package uses <code>black</code>, <code>flake8</code> and <code>isort</code> for linting. Credits <code>AnyTest</code> is heavily inspired by the <a>vim-test</a> plugin so all credits go to the authors and maintainers of this awesome Vim plugin.
[]
https://avatars.githubusercontent.com/u/39616?v=4
zlox
zlw/zlox
2022-01-15T00:55:26Z
Crafting Interpreter's clox but in Zig
main
0
6
0
6
https://api.github.com/repos/zlw/zlox/tags
MIT
[ "bytecode", "lox", "virtual-machine", "zig" ]
289
false
2025-03-17T09:34:28Z
true
false
unknown
github
[]
zlox <ul> <li><a>Crafting Interpreter</a>'s clox but in <a>Zig</a> (v0.13.0)</li> <li><a>Crafting Interpreters - Part III - A Bytecode Virtual Machine</a></li> <li>When stuck on allocating memory, got some help from <a>avillega/zilox</a> 😅</li> <li>Test runner shamelessly stolen from <a>jwmerrill/zig-lox</a> and adapted to Zig ~~0.11.0~~ ~~0.12.0~~ 0.13.0 🤫</li> <li>VM optimizations inspired by <a>zackradisic/rust-vs-zig</a></li> </ul>
[]
https://avatars.githubusercontent.com/u/127971?v=4
zig-piecetable
daurnimator/zig-piecetable
2021-09-29T17:52:04Z
A PieceTable data structure for zig
main
0
6
1
6
https://api.github.com/repos/daurnimator/zig-piecetable/tags
-
[ "datastructures", "piecetable", "zig" ]
12
false
2025-02-15T11:24:56Z
true
true
unknown
github
[]
Zig PieceTable Overview A piece table is made of two buffers, the original content and a new append only "add" buffer. We start with a "span" that covers the entire original buffer, and for every modification we divide that up based on where hte insert or delete is performed and how many characters it is. Each of these operations represented as new spans are made into the new "add" buffer, leaving the original as is. Each piece or span therefore references three things: <ol> <li>Is it referencing original content or new content (i.e. original or add buffer)</li> <li>The offset to the start of the change</li> <li>Number of bytes that are being changed after the offset.</li> </ol> Spans are listed in order in a table (hence piece table), which can be traversed from top to bottom for a consistent history of changes. Usage To use in your Zig project, pick a commit hash you want to use and run the following, replacing <code>&lt;hash&gt;</code> with the commit hash: <code>bash zig fetch --save=piecetable https://github.com/daurnimator/zig-piecetable/archive/&lt;hash&gt;.tar.gz</code> References <ul> <li>https://en.wikipedia.org/wiki/Piece_table</li> <li>https://www.averylaird.com/programming/the%20text%20editor/2017/09/30/the-piece-table/</li> </ul>
[]
https://avatars.githubusercontent.com/u/23709124?v=4
zig-ini
sreehax/zig-ini
2021-06-27T07:43:16Z
.ini parser for zig
dev
0
6
1
6
https://api.github.com/repos/sreehax/zig-ini/tags
MIT
[ "zig", "ziglang" ]
5
false
2024-09-27T20:02:17Z
false
false
unknown
github
[]
zig-ini This library is meant to simplify reading .ini files in Zig. For examples on usage, check out <code>example.zig</code>. The main purpose of this library is to aid in using git config files, but it can potentially be applied anywhere that needs to work with .ini files
[]
https://avatars.githubusercontent.com/u/227141?v=4
scoop-zig
enndubyu/scoop-zig
2021-06-16T01:01:10Z
A scoop bucket for the zig programming language and related tools.
master
0
6
2
6
https://api.github.com/repos/enndubyu/scoop-zig/tags
Unlicense
[ "scoop", "scoop-bucket", "zig", "zig-dev", "ziglang" ]
993
false
2025-05-21T06:08:12Z
false
false
unknown
github
[]
:zap: scoop-zig :zap: <a></a> A scoop bucket for the zig compiler and related tools. Updated bihourly. Feel free to create an issue requesting any useful zig tools that are missing from the bucket. To install zig: ```sh add scoop bucket scoop bucket add scoop-zig https://github.com/enndubyu/scoop-zig install zig scoop install zig ``` Tools in the bucket: <ul> <li><strong>zig</strong> - <em><a>zig</a> compiler</em></li> <li><strong>zig-dev</strong>[^1] - <em>zig compiler (development version)</em></li> <li><strong>zig-mach</strong>[^2] - <em>zig compiler (<a>mach</a> project's latest <a>nominated</a> zig version)</em></li> <li><strong>zls</strong> - <em>language server for zig</em></li> </ul> [^1]: <code>zig-dev</code> is aliased as both <code>zig</code> and <code>zig-dev</code> unless zig stable is also installed (in which case <code>zig</code> will execute zig stable) [^2]: <code>zig-mach</code> is aliased as both <code>zig</code> and <code>zig-mach</code> unless zig stable is also installed (in which case <code>zig</code> will execute zig stable)
[]
https://avatars.githubusercontent.com/u/66054069?v=4
waterfall
uncomfyhalomacro/waterfall
2021-11-22T10:18:32Z
a curation of all rice and configs for https://github.com/riverwm/river
main
0
6
0
6
https://api.github.com/repos/uncomfyhalomacro/waterfall/tags
-
[ "config", "dotfiles", "dynamic-tiling", "river", "riverwm", "wayland", "wayland-compositor", "window-manager", "wlroots", "zig" ]
5
false
2024-02-02T19:32:31Z
false
false
unknown
github
[]
waterfall a curation of all my rice and configs for https://github.com/riverwm/river
[]
https://avatars.githubusercontent.com/u/5132833?v=4
zig-vte
nfisher1226/zig-vte
2021-06-21T01:43:32Z
Zig wrappers and convenience functions around the Vte and Gtk+ libraries
odin
0
6
0
6
https://api.github.com/repos/nfisher1226/zig-vte/tags
MIT
[ "gtk", "library", "terminal-emulator", "zig" ]
189
false
2024-10-11T05:49:42Z
true
false
unknown
github
[]
zig-gtk3 This package contains some convenience functions and wrappers around the C api of both the Gtk+ and Vte libraries for developing Gui applications using Zig. Usage We track zig-master, so you will need the current master compiler. In your <code>build.zig</code> file, add the package path: <code>Zig const exe = b.addExecutable("exe-name", "path-to-source.zig"); exe.addPackagePath("zig-gtk3", "path/to/zig-vte/lib.zig"); exe.linkLibC(); exe.linkSystemLibrary("gtk+-3.0"); exe.linkSystemLibrary("vte-2.91");</code> The Gtk wrappers are namespaced to gtk, the C functions to c, and Vte to vte. ```Zig const GTK = @import("zig-vte"); const c = GTK.c; const gtk = GTK.gtk; const vte = GTK.vte; const std = @import("std"); const Gui = struct { window: gtk.Window, term: vte.Terminal, <code>fn init(app: *c.GtkApplication) Gui { </code> ... ``` There are several gtk examples and one vte example in the examples subdirectory. Rationale It is entirely possible to call C functions directly from Zig. However, Zig's translate-c function, which is used to import C code into Zig, is still somewhat immature and tends to fail with heavily macro dependent code. This happens for certain parts of Gtk+ that make working around it quite difficult. Additionally, the C Api to Gtk (and Vte), due to limitations of the language, can be incredibly verbose as well as quite clumsy at times. A better Api is both possible and desireable in a language such as Zig.
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zig-git
nektro/zig-git
2022-02-01T11:01:58Z
Inspect into the depths of your .git folder purely from Zig
master
0
5
0
5
https://api.github.com/repos/nektro/zig-git/tags
MIT
[ "zig", "zig-package" ]
124
false
2025-05-21T20:33:16Z
true
false
unknown
github
[]
zig-git <a></a> <a></a> <a></a> <a></a> Inspect into the depths of your .git folder purely from Zig.
[]
https://avatars.githubusercontent.com/u/51487819?v=4
zig-dots
paperdev-code/zig-dots
2021-07-27T16:55:30Z
Dots, a semigraphical drawing library made in Zig.
master
0
5
0
5
https://api.github.com/repos/paperdev-code/zig-dots/tags
MIT
[ "library", "semigraphics", "terminal", "unicode", "zig", "zig-library" ]
40
false
2024-07-05T15:30:33Z
false
false
unknown
github
[]
A semigraphical drawing library made in Zig. I created this library as a way to learn my way around the Zig programming language. It is a type of virtual dot matrix that can be either printed to the terminal, or returned as a string that consists of <strong>Unicode</strong> Braille characters. Adding to your project. Add the library either by importing the file, or as a package in build.zig (recommended) <code>zig const dots = .{ .name = "dots", .path = .{.path = "zig-dots/dots.zig"} }; ... exe.addPackage(dots);</code> Example code A basic example showing how to use Dots. Explore the source code for more details. ```zig /// helloworld.zig /// Paperdev-code (c) const std = @import("std"); const dots = @import("dots"); // Dots helloworld program. pub fn main() !void { var stdout = std.io.getStdOut().writer(); <code>var gpa = std.heap.GeneralPurposeAllocator(.{}) {}; defer _ = gpa.deinit(); const allocator = &amp;gpa.allocator; const config = dots.Config.init(64, 64, allocator); var buffer = try dots.Buffer.create(&amp;config); defer buffer.destroy(); var display = try dots.Display.create(&amp;config); defer display.destroy(); var context = try dots.Context.init(&amp;buffer); // d context.line(-0.5,-0.2,-0.5, 0.9, .{.bitset = 1}); context.circ(-0.65, 0.6, 3.14 - 0.56, 3.14 * 2.0 + 0.56, 0.25, 64, .{.bitset = 1}); // o context.circ(-0.2, 0.65, 0, 3.14 * 2.0, 0.2, 64, .{.bitset = 1}); // t context.circ( 0.25, 0.7, 3.14 * 1.5, 3.14 * 2.5, 0.15, 64, .{.bitset = 1}); context.line( 0.11, 0.2, 0.11, 0.8, .{.bitset = 1}); context.line( 0.0, 0.3, 0.25, 0.3, .{.bitset = 1}); // s context.circ( 0.65, 0.4, 3.14 / 2.0, 3.14 * 2.0, 0.15, 64, .{.bitset = 1}); context.circ( 0.65, 0.7, 3.14 * 2.0 + 3.14, 3.14 / 2.0 + 3.14, 0.15, 64, .{.bitset = 1}); while (true) { context.rect(-1.0,-1.0, 1.0, 1.0, .{.bitxor = 1}); std.time.sleep(std.time.ns_per_s * 0.5); try display.print(&amp;buffer, 0, 0, &amp;stdout); } </code> } ```
[]
https://avatars.githubusercontent.com/u/4701322?v=4
zig-utils
Zuyoutoki/zig-utils
2021-04-14T03:24:41Z
Essential Utilities Written in Zig
master
0
5
2
5
https://api.github.com/repos/Zuyoutoki/zig-utils/tags
MIT
[ "coreutils", "zig" ]
25
false
2024-02-14T19:59:36Z
true
false
unknown
github
[]
404
[]
https://avatars.githubusercontent.com/u/1405886?v=4
aoc2021
Vzaa/aoc2021
2021-11-30T21:04:08Z
Advent of Code 2021 Solutions in Zig
main
0
5
0
5
https://api.github.com/repos/Vzaa/aoc2021/tags
-
[ "advent-of-code", "advent-of-code-2021", "advent-of-code-2021-zig", "aoc2021", "zig" ]
124
false
2021-12-25T05:35:35Z
false
false
unknown
github
[]
AoC 2021 Trying to Learn Zig Edition
[]
https://avatars.githubusercontent.com/u/22225222?v=4
minimixer
arguablykomodo/minimixer
2022-01-04T19:59:44Z
A very barebones X11 pulseaudio volume mixer
master
0
5
0
5
https://api.github.com/repos/arguablykomodo/minimixer/tags
GPL-3.0
[ "pulseaudio", "volume-control", "xlib", "zig" ]
37
false
2025-03-02T22:59:49Z
true
false
unknown
github
[]
A very barebones pulseaudio volume mixer. Building you will require the <code>libx11</code>, <code>libxft</code>, and <code>libpulse</code> libraries in your system (and of course, <code>zig</code>). <code>zig build -h</code> should explain the rest.
[]
https://avatars.githubusercontent.com/u/1458409?v=4
tga.zig
ratfactor/tga.zig
2021-06-09T01:04:38Z
Demonstration of writing a TGA file from Zig.
main
0
5
1
5
https://api.github.com/repos/ratfactor/tga.zig/tags
MIT
[ "tga", "tga-format", "tga-image", "zig" ]
5
false
2023-09-27T22:56:37Z
false
false
unknown
github
[]
404
[]
https://avatars.githubusercontent.com/u/4250341?v=4
XPROEngine
JonSnowbd/XPROEngine
2021-02-13T21:52:18Z
XPROEngine is the engine used to power a yet unnamed project based around fun instanced survival.
main
0
5
0
5
https://api.github.com/repos/JonSnowbd/XPROEngine/tags
-
[ "zig", "zig-ecs", "zig-gamekit" ]
2,596
false
2022-10-27T23:43:05Z
true
false
unknown
github
[]
Todo Soon this will contain introduction material, and a listing of important default components, systems, and entity mixins.
[]
https://avatars.githubusercontent.com/u/18511640?v=4
Talea
uri-nyx/Talea
2021-10-21T22:58:38Z
A (not so) tiny RISC custom cpu architecture and system
main
0
5
0
5
https://api.github.com/repos/uri-nyx/Talea/tags
MIT
[ "assembly", "cpu-emulator", "emulator", "fantasy", "fantasy-computer", "fantasy-console", "minify", "toy-project", "zig" ]
4,430
false
2024-08-20T03:40:39Z
true
true
unknown
github
[]
404
[]
https://avatars.githubusercontent.com/u/95108673?v=4
zig-essence
aoemods/zig-essence
2021-11-25T00:57:22Z
Zig impl of Relic Entertainment's Essence formats
main
4
5
0
5
https://api.github.com/repos/aoemods/zig-essence/tags
MIT
[ "aoe4", "zig", "zig-package" ]
38
false
2022-03-13T16:03:39Z
true
false
unknown
github
[]
zig-essence Low-level minimal allocation implementation of Relic's funky formats in Zig with comments and clearly named variables. SGAs: Headers should work for all versions of SGAs, but more high-level code and complex operations are only tested on AoE4 SGAs. Getting sgatool You can grab a copy of <code>sgatool</code>, the actually executable portion of <code>zig-essence</code>, from the latest successful CI run, the latest release (soon), or by compiling the program yourself. Compiling First, install <a>Zig</a>. Then: ```bash git clone https://github.com/aoemods/zig-sga cd zig-sga zig build Output in ./zig-out/bin! Or to run it right away (useful for developers) zig build sgatool -- [args] ``` Using as a Library See <code>tools/sgatool.zig</code> and <code>build.zig</code> for an example of how <code>zig-essence</code> can be used as a library in Zig! Prior Art Credit where credit's due! Thanks Janne for the <a>awesome blog post</a> as well as the <a>SGA viewer tooling</a> that inspired this effort. A dozen lines of documentation are based off of a table in Janne's blog post. \&lt;3 License MIT All files in <code>dump</code> are also MIT licensed and generated by other SGA tools. Please do not add any official game archives to <code>dump</code>!
[]
https://avatars.githubusercontent.com/u/3718227?v=4
wasm4-docker
christopher-kleine/wasm4-docker
2021-11-25T20:07:24Z
Dockerfile to create a docker image than compiles AssemblyScript, C, Go, Rust and Zig
main
0
4
1
4
https://api.github.com/repos/christopher-kleine/wasm4-docker/tags
-
[ "assemblyscript", "co", "d", "docker", "fantasy-console", "game-development", "go", "nelua", "odin", "rust", "wasm", "wasm4", "webassembly", "zig" ]
11
false
2022-11-20T15:54:15Z
false
false
unknown
github
[]
wasm4 Docker image to create and develop games for the Fantasy Console <a>WASM-4</a>. Image variants: anihex/wasm4:- All variants include the following tools: - The <code>w4</code> CLI - Binaryen (<code>wasm-opt</code> etc) Aside from that, there currently there are the following variants: <code>full</code>, <code>assemblyscript</code>, <code>c</code>, <code>d</code>, <code>go</code>, <code>nelua</code>, <code>nim</code>, <code>odin</code>, <code>rust</code> and <code>zig</code>. Almost all variants include the C-variant. Exceptions are <code>assemblyscript</code> and <code>go</code>. Examples: <code>shell docker pull anihex/wasm4:2.1.0-full docker pull anihex/wasm4:2.1.0-c docker pull anihex/wasm4:latest # Implicit full-variant docker pull anihex/wasm4:go</code> Usage The default command is <code>w4 watch</code>. This can be changed by overriding the command. If a completely different command is required, the entrypoint needs to be overridden. Examples: <code>shell docker run --rm -v $PWD:/cart -p 4444:4444 anihex/wasm4:latest # Starts the watcher in the current directory docker run --rm -v $PWD:/cart anihex/wasm4:latest new --c hello-c # Creates a new project called hello-c docker run --rm -it $PWD:/cart -entrypoint bash anihex/wasm4:latest # Starts the bash-terminal</code> Ports The default port is 4444. For examples, look at <code>Usage</code>. Mounts The standard-mountpoint is <code>/cart</code>. For examples, look at <code>Usage</code>. Contributing WASM-4 is OpenSource and is hosted on GitHub: https://github.com/aduros/wasm4 The docker-files for this can be found on https://github.com/christopher-kleine/wasm4-docker
[]
https://avatars.githubusercontent.com/u/1458409?v=4
ziglings
ratfactor/ziglings
2021-01-03T17:17:12Z
Learn the Zig programming language by fixing tiny broken programs.
main
2
4,443
470
4,443
https://api.github.com/repos/ratfactor/ziglings/tags
MIT
[ "beginner-friendly", "educational", "exercises", "learning-by-doing", "zig", "ziglang" ]
545
false
2025-05-21T15:55:05Z
false
false
unknown
github
[]
Ziglings ⚠️ Attention! Ziglings has moved to Codeberg! Check out directly our handy new URL: https://ziglings.org Or visit the repo at: https://codeberg.org/ziglings/exercises
[]
https://avatars.githubusercontent.com/u/65322356?v=4
zls
zigtools/zls
2020-04-24T22:19:50Z
A Zig language server supporting Zig developers with features like autocomplete and goto definition
master
134
3,786
357
3,786
https://api.github.com/repos/zigtools/zls/tags
MIT
[ "language-server", "language-server-protocol", "lsp", "lsp-server", "zig", "ziglang", "zls" ]
8,411
false
2025-05-21T22:46:11Z
true
true
0.15.0-dev.441+c1649d586
github
[ { "commit": "aa24df42183ad415d10bc0a33e6238c437fc0f59.tar.gz", "name": "known_folders", "tar_url": "https://github.com/ziglibs/known-folders/archive/aa24df42183ad415d10bc0a33e6238c437fc0f59.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/ziglibs/known-folders" }, { "commit": "a20dd1f11b10819a6f570f98b42e1c91e3704357.tar.gz", "name": "diffz", "tar_url": "https://github.com/ziglibs/diffz/archive/a20dd1f11b10819a6f570f98b42e1c91e3704357.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/ziglibs/diffz" }, { "commit": "3b26e5781bb7d0c7b547bb48e154d1ab13180b69.tar.gz", "name": "lsp_codegen", "tar_url": "https://github.com/zigtools/zig-lsp-codegen/archive/3b26e5781bb7d0c7b547bb48e154d1ab13180b69.tar.gz.tar.gz", "type": "remote", "url": "https://github.com/zigtools/zig-lsp-codegen" }, { "commit": "refs", "name": "tracy", "tar_url": "https://github.com/wolfpld/tracy/archive/refs.tar.gz", "type": "remote", "url": "https://github.com/wolfpld/tracy" } ]
<a></a> <a></a> <a></a> <strong>Need support? Wanna help out? Join our <a>Discord server</a>!</strong> ZLS is a non-official implementation of the <a>Language Server Protocol</a> for <a>Zig</a> in Zig. It provides developers with IDE <a>features</a> in their editor. Installation See the <a>Installation Guide</a> for editor and binary installation instructions. From Source Building ZLS requires <a>a build of Zig master</a>. <code>bash git clone https://github.com/zigtools/zls cd zls zig build -Doptimize=ReleaseSafe</code> Features ZLS supports most language features, including simple type function support, using namespace, payload capture type resolution, custom packages, cImport and others. Support for comptime and semantic analysis is Work-in-Progress. The following LSP features are supported: <ul> <li>Completions</li> <li>Hover</li> <li>Goto definition/declaration</li> <li>Document symbols</li> <li>Find references</li> <li>Rename symbol</li> <li>Formatting using <code>zig fmt</code></li> <li>Semantic token highlighting</li> <li>Inlay hints</li> <li>Code actions</li> <li>Selection ranges</li> <li>Folding regions</li> </ul> Related Projects <ul> <li><a><code>sublime-zig-language</code> by @prime31</a></li> <li>Supports basic language features</li> <li>Uses data provided by <code>src/data</code> to perform builtin autocompletion</li> <li><a><code>zig-lsp</code> by @xackus</a></li> <li>Inspiration for ZLS</li> <li><a><code>known-folders</code> by @ziglibs</a></li> <li>Provides API to access known folders on Linux, Windows and Mac OS</li> <li><a><code>zls</code> by @zigtools</a></li> <li>Used by many ZLS developers to more efficiently work on ZLS</li> </ul> Quick Thanks :) We'd like to take a second to thank all our awesome <a>contributors</a> and donators/backers/sponsors; if you have time or money to spare, consider partaking in either of these options - they help keep ZLS awesome for everyone! <a></a>
[]
https://avatars.githubusercontent.com/u/89790094?v=4
river
riverwm/river
2020-03-20T21:53:10Z
[mirror] A dynamic tiling Wayland compositor
master
67
3,553
156
3,553
https://api.github.com/repos/riverwm/river/tags
GPL-3.0
[ "wayland", "wayland-compositor", "window-manager", "wlroots", "zig" ]
3,135
false
2025-05-22T05:32:29Z
true
true
unknown
github
[ { "commit": "v0.2.0.tar.gz", "name": "zig-pixman", "tar_url": "https://codeberg.org/ifreund/zig-pixman/archive/v0.2.0.tar.gz.tar.gz", "type": "remote", "url": "https://codeberg.org/ifreund/zig-pixman" }, { "commit": "bd8afd256fb6beed7d72e3580b00f33dea7155a1.tar.gz", "name": "zig-wayland", "tar_url": "https://codeberg.org/ifreund/zig-wayland/archive/bd8afd256fb6beed7d72e3580b00f33dea7155a1.tar.gz.tar.gz", "type": "remote", "url": "https://codeberg.org/ifreund/zig-wayland" }, { "commit": "afbbbbe5579c750feed8de12b073fa50b0651137.tar.gz", "name": "zig-wlroots", "tar_url": "https://codeberg.org/ifreund/zig-wlroots/archive/afbbbbe5579c750feed8de12b073fa50b0651137.tar.gz.tar.gz", "type": "remote", "url": "https://codeberg.org/ifreund/zig-wlroots" }, { "commit": "v0.2.0.tar.gz", "name": "zig-xkbcommon", "tar_url": "https://codeberg.org/ifreund/zig-xkbcommon/archive/v0.2.0.tar.gz.tar.gz", "type": "remote", "url": "https://codeberg.org/ifreund/zig-xkbcommon" } ]
Overview River is a dynamic tiling Wayland compositor with flexible runtime configuration. Check <a>packaging status</a> — Join us at <a>#river</a> on irc.libera.chat — Read our man pages, <a>wiki</a>, and <a>Code of Conduct</a> The main repository is on <a>codeberg</a>, which is where the issue tracker may be found and where contributions are accepted. Read-only mirrors exist on <a>sourcehut</a> and <a>github</a>. <em>Note: river has not yet seen a stable 1.0 release and it will be necessary to make significant breaking changes before 1.0 to realize my longer term plans. That said, I do my best to avoid gratuitous breaking changes and bugs/crashes should be rare. If you find a bug don't hesitate to <a>open an issue</a>.</em> Features Currently river's window management style is quite similar to <a>dwm</a>, <a>xmonad</a>, and other classic dynamic tiling X11 window managers. Windows are automatically arranged in a tiled layout and shifted around as windows are opened/closed. Rather than having the tiled layout logic built into the compositor process, river uses a <a>custom Wayland protocol</a> and separate "layout generator" process. A basic layout generator, <code>rivertile</code>, is provided but users are encouraged to use community-developed <a>layout generators</a> or write their own. Examples in C and Python may be found <a>here</a>. Tags are used to organize windows rather than workspaces. A window may be assigned to one or more tags. Likewise, one or more tags may be displayed on a monitor at a time. River is configured at runtime using the <code>riverctl</code> tool. It can define keybindings, set the active layout generator, configure input devices, and more. On startup, river runs a user-defined init script which usually runs <code>riverctl</code> commands to set up the user's configuration. Building Note: If you are packaging river for distribution, see <a>PACKAGING.md</a>. To compile river first ensure that you have the following dependencies installed. The "development" versions are required if applicable to your distribution. <ul> <li><a>zig</a> 0.13</li> <li>wayland</li> <li>wayland-protocols</li> <li><a>wlroots</a> 0.18</li> <li>xkbcommon</li> <li>libevdev</li> <li>pixman</li> <li>pkg-config</li> <li>scdoc (optional, but required for man page generation)</li> </ul> Then run, for example: <code>zig build -Doptimize=ReleaseSafe --prefix ~/.local install</code> To enable Xwayland support pass the <code>-Dxwayland</code> option as well. Run <code>zig build -h</code> to see a list of all options. Usage River can either be run nested in an X11/Wayland session or directly from a tty using KMS/DRM. Simply run the <code>river</code> command. On startup river will run an executable file at <code>$XDG_CONFIG_HOME/river/init</code> if such an executable exists. If <code>$XDG_CONFIG_HOME</code> is not set, <code>~/.config/river/init</code> will be used instead. Usually this executable is a shell script invoking <em>riverctl</em>(1) to create mappings, start programs such as a layout generator or status bar, and perform other configuration. An example init script with sane defaults is provided <a>here</a> in the example directory. For complete documentation see the <code>river(1)</code>, <code>riverctl(1)</code>, and <code>rivertile(1)</code> man pages. Future Plans Currently details such as how tags work across multiple monitors are not possible for users to configure. It would be possible to extend river's source code to allow more flexibility here but this comes at the cost of complexity and there will always be someone who prefers something slightly different. My long term plan to address this is to move as much window management policy as possible out of the river compositor process and into the "layout generator" process which will need to be renamed to "window manager." This will give users much more power and control over river's behavior and also enable some really cool workflows. For example, it would be possible to write a window manager in lisp and use hot code reloading to edit its behavior it while it is running. This is a non-trivial architectural change and will take a while to implement. I plan to focus on this change for the 0.4.0 release cycle. Unfortunately, it will almost certainly break existing river configurations as well. I think the benefits outweigh that downside though and I will do my best to offer a reasonable upgrade path. Donate If my work on river adds value to your life and you'd like to support me financially you can find donation information <a>here</a>. Licensing River is released under the GNU General Public License v3.0 only. The protocols in the <code>protocol</code> directory are released under various licenses by various parties. You should refer to the copyright block of each protocol for the licensing information. The protocols prefixed with <code>river</code> and developed by this project are released under the ISC license (as stated in their copyright blocks). The river logo is licensed under the CC BY-SA 4.0 license, see the <a>license</a> in the logo directory.
[]
https://avatars.githubusercontent.com/u/32980656?v=4
raylib-zig
Not-Nik/raylib-zig
2020-02-15T09:58:13Z
Manually tweaked, auto-generated raylib bindings for zig. https://github.com/raysan5/raylib
devel
12
1,132
181
1,132
https://api.github.com/repos/Not-Nik/raylib-zig/tags
MIT
[ "binding", "bindings", "game-development", "gamedev", "raylib", "zig", "zig-package" ]
2,899
false
2025-05-22T06:39:34Z
true
true
0.14.0
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": "1536ae35c7b42d863135f4181fd2a225e531f68b", "name": "raygui", "tar_url": "https://github.com/raysan5/raygui/archive/1536ae35c7b42d863135f4181fd2a225e531f68b.tar.gz", "type": "remote", "url": "https://github.com/raysan5/raygui" } ]
raylib-zig Manually tweaked, auto-generated <a>raylib</a> bindings for zig. Bindings tested on raylib version 5.6-dev and Zig 0.14.0 Thanks to all the <a>contributors</a> for their help with this binding. Example ```zig const rl = @import("raylib"); pub fn main() anyerror!void { // Initialization //-------------------------------------------------------------------------------------- const screenWidth = 800; const screenHeight = 450; <code>rl.initWindow(screenWidth, screenHeight, "raylib-zig [core] example - basic window"); defer rl.closeWindow(); // Close window and OpenGL context rl.setTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- // Main game loop while (!rl.windowShouldClose()) { // Detect window close button or ESC key // Update //---------------------------------------------------------------------------------- // TODO: Update your variables here //---------------------------------------------------------------------------------- // Draw //---------------------------------------------------------------------------------- rl.beginDrawing(); defer rl.endDrawing(); rl.clearBackground(.white); rl.drawText("Congrats! You created your first window!", 190, 200, 20, .light_gray); //---------------------------------------------------------------------------------- } </code> } ``` Building the examples To build all available examples simply <code>zig build examples</code>. To list available examples run <code>zig build --help</code>. If you want to run an example, say <code>basic_window</code> run <code>zig build basic_window</code> Building and using Using raylib-zig's template <ul> <li>Execute <code>project_setup.sh project_name</code>, this will create a folder with the name specified</li> <li>You can copy that folder anywhere you want and edit the source</li> <li>Run <code>zig build run</code> at any time to test your project</li> </ul> In an existing project (e.g. created with <code>zig init</code>) Download and add raylib-zig as a dependency by running the following command in your project root: <code>zig fetch --save git+https://github.com/Not-Nik/raylib-zig#devel</code> Then add raylib-zig as a dependency and import its modules and artifact in your <code>build.zig</code>: ```zig const raylib_dep = b.dependency("raylib_zig", .{ .target = target, .optimize = optimize, }); const raylib = raylib_dep.module("raylib"); // main raylib module const raygui = raylib_dep.module("raygui"); // raygui module const raylib_artifact = raylib_dep.artifact("raylib"); // raylib C library ``` Now add the modules and artifact to your target as you would normally: <code>zig exe.linkLibrary(raylib_artifact); exe.root_module.addImport("raylib", raylib); exe.root_module.addImport("raygui", raygui);</code> If you additionally want to support Web as a platform with emscripten, you will need to use <code>emcc.zig</code> by importing raylib-zig's build script with <code>const rlz = @import("raylib_zig");</code> and then accessing its functions with <code>rlz.emcc</code>. Refer to raylib-zig's project template on how to use them. Passing build options raylib allows customisations of certain parts of its build process such as choosing an OpenGL version, building as a shared library or not including certain modules. You can optionally pass these options to raylib-zig dependency like so <code>zig const raylib_dep = b.dependency("raylib_zig", .{ .target = target, .optimize = optimize, .shared = true, // Build raylib as a shared library .opengl_version = rlz.OpenglVersion.gl_2_1, // Use OpenGL 2.1 (requires importing raylib-zig's build script) });</code> Defining feature macros raylib lets the user enable and disable options for different features, loading different file formats for images, fonts, 3D models and audio, linkage variants. You can specify these options for your raylib-zig build by defining the corresponding C macro before you link with it, e.g.: <code>zig raylib_artifact.root_module.addCMacro("SUPPORT_FILEFORMAT_JPG", "");</code> Exporting for web To export your project for the web, first install emsdk. Once emsdk is installed, set it up by running <code>emsdk install latest</code> Find the folder where it's installed and run <code>zig build -Dtarget=wasm32-emscripten --sysroot [path to emsdk]/upstream/emscripten</code> once that is finished, the exported project should be located at <code>zig-out/htmlout</code> When is the binding updated? I plan on updating it every mayor release (2.5, 3.0, etc.). Keep in mind these are technically header files, so any implementation stuff should be updatable with some hacks on your side. What needs to be done? <ul> <li><em>(Done)</em> Set up a proper package build and a build script for the examples</li> <li>Port all the examples</li> <li>Member functions/initialisers</li> </ul>
[ "https://github.com/0xErwin1/langton.zig", "https://github.com/EarthmanMuons/clefcraft", "https://github.com/Frost-Phoenix/zig-sweeper", "https://github.com/IWhitebird/Zimacs", "https://github.com/Jacquwes/Zip-8", "https://github.com/JamzOJamz/terraria-classic", "https://github.com/Mario-SO/zig-pong", "https://github.com/Roeliefantje/zig-explorer", "https://github.com/apesteguia/zchess", "https://github.com/cowboy8625/pixel-edit", "https://github.com/dbtreasure/zig-bpe", "https://github.com/deevus/zig-squarified", "https://github.com/h2cone/pong", "https://github.com/jrachele/tunnel", "https://github.com/mtimbs/zig-8086-simulator", "https://github.com/pyranota/ZBody", "https://github.com/quot/Zig-Raylib-Flake-Template", "https://github.com/roy-corentin/ProceduralAnimation", "https://github.com/rozukke/zig-gol", "https://github.com/slingercode/chafacad" ]
https://avatars.githubusercontent.com/u/304904?v=4
zigup
marler8997/zigup
2020-05-30T17:33:47Z
Download and manage zig compilers.
master
52
998
70
998
https://api.github.com/repos/marler8997/zigup/tags
MIT-0
[ "zig", "zig-compilers" ]
155
false
2025-05-22T01:37:14Z
true
true
0.14.0
github
[]
zigup Download and manage zig compilers. <blockquote> NOTE: I no longer use zigup. I've switched to using <a>anyzig</a> instead and recommend others do the same (here's <a>why</a>). Zigup will continue to be supported for those that just love it so much! </blockquote> How to Install Go to https://marler8997.github.io/zigup and select your OS/Arch to get a download link and/or instructions to install via the command-line. Otherwise, you can manually find and download/extract the applicable archive from <a>Releases</a>. It will contain a single static binary named <code>zigup</code>, unless you're on Windows in which case it's <code>zigup.exe</code>. Usage ``` fetch a compiler and set it as the default zigup zigup master zigup 0.6.0 fetch a compiler only (do not set it as default) zigup fetch zigup fetch master print the default compiler version zigup default set the default compiler zigup default list the installed compiler versions zigup list clean compilers that are not the default, not master, and not marked to keep. when a version is specified, it will clean that version zigup clean [] mark a compiler to keep zigup keep run a specific version of the compiler zigup run ... ``` How the compilers are managed zigup stores each compiler in a global "install directory" in a versioned subdirectory. Run <code>zigup get-install-dir</code> to see what this PATH is on your system. You can change this default with <code>zigup set-install-dir PATH</code>. zigup makes the zig program available by creating an entry in a directory that occurs in the <code>PATH</code> environment variable. On posix systems this entry is a symlink to one of the <code>zig</code> executables in the install directory. On windows this is an executable that forwards invocations to one of the <code>zig</code> executables in the install directory. Building Run <code>zig build</code> to build, <code>zig build test</code> to test and install with: ``` install to a bin directory with cp zig-out/bin/zigup BIN_PATH ``` TODO <ul> <li>set/remove compiler in current environment without overriding the system-wide version.</li> </ul> Dependencies On linux and macos, zigup depends on <code>tar</code> to extract the compiler archive files (this may change in the future). Why Anyzig? Zigup helps you download/switch which version of zig is invoked when you run <code>zig</code>. In contrast, Anyzig is one universal <code>zig</code> executable that invokes the correct version of zig based on the current project. Anyzig came about from the realization that if you have <code>zig</code> installed system-wide, then it should work with any Zig project, not just those that happen to match the current version you've installed/enabled. Instead of manually switching versions yourself, it uses the <code>minimum_zig_version</code> field in <code>build.zig.zon</code>. An added benefit of anyzig is any project that uses it is guaranteed to have their zig version both documented and up-to-date. In practice, I've also found that anyzig frees some mental load because you no longer need to track which version of Zig each project is on, which version the system is on, and keeping the two in sync.
[]
https://avatars.githubusercontent.com/u/5464072?v=4
zigmod
nektro/zigmod
2020-11-09T22:56:32Z
📦 A package manager for the Zig programming language.
master
22
860
39
860
https://api.github.com/repos/nektro/zigmod/tags
MIT
[ "package-manager", "zig" ]
779
false
2025-05-21T15:13:54Z
true
false
unknown
github
[]
zigmod <a></a> <a></a> <a></a> <a></a> A package manager for the Zig programming language. Zig <ul> <li>https://ziglang.org/</li> <li>https://github.com/ziglang/zig</li> <li>https://github.com/ziglang/zig/wiki/Community</li> </ul> Download <ul> <li>https://github.com/nektro/zigmod/releases</li> </ul> Built With <ul> <li>Zig <code>0.13.0</code></li> <li>See <a><code>zig.mod</code></a> and <a><code>zigmod.lock</code></a></li> </ul> Build from Source <code>$ git clone https://github.com/nektro/zigmod $ cd zigmod $ zig build -j1</code> Usage Check out our <a>docs</a> or the website: https://nektro.github.io/zigmod/. There is now also a tutorial-style getting started guide that goes over various use cases that Zigmod provides and caters to. It is <a>available here</a>. A package index for Zigmod packages is also available at https://aquila.red/. Contact <ul> <li>[email protected]</li> <li>https://twitter.com/nektro</li> </ul> License MIT
[]
https://avatars.githubusercontent.com/u/15335529?v=4
zig.guide
Sobeston/zig.guide
2020-06-19T07:16:57Z
Repo for https://zig.guide content. Get up to speed with Zig quickly.
master
55
818
204
818
https://api.github.com/repos/Sobeston/zig.guide/tags
MIT
[ "documentation", "education", "educational", "learn-to-code", "learning", "learning-by-doing", "programming-language", "zig", "ziglang" ]
639
false
2025-05-20T21:45:57Z
true
false
unknown
github
[]
zig.guide Repo for https://zig.guide content. Feedback and PRs welcome. Testing <code>bash zig build --summary all</code> Contributing <ol> <li>Make use of <code>zig build</code> - it handles fmt and testing for you.</li> <li>Use the correct Zig version; <code>zig build</code> will select what content to test based on your compiler version.</li> <li>When fixing a regression, fix it in both the latest major release &amp; master where applicable, and improve test coverage where possible.</li> <li>Raise an issue or reach out before making large changes (e.g. new pages).</li> </ol> Running the dev server <code>bash cd website npm install npm run docusaurus start</code>
[]