Zig zig-library

Open-source Zig projects categorized as zig-library

Top 15 Zig zig-library Projects

  • zig-clap

    Simple command line argument parsing library

  • Project mention: After a day of programming in Zig | dev.to | 2024-01-01

    Zig and Rust both promote explicit error handling, however their mechanisms are different. Rust uses Result enums, while Zig uses a (global) error set type (though similar to an enum) and error propagation. Similarly, Rust uses the Option enum for optional types, while Zig uses a type modifier (?T). Both offer modern, syntactic sugar to handle those (call()? and if let Some(value) = optional {} in Rust, try call() and if (optional) |value| {} in Zig). Since Rust uses the standard library to implement error handling and options, users have the possibility to extend those systems which is quite powerful. However, I like the approach Zig takes in providing those things as language features. While their approach fits well into the C universe, I dislike that there is no pragmatic way to add more context to an error (but well, no allocations). Libraries like [clap](https://github.com/Hejsil/zig-clap) solve this by implementing a diagnostics mechanism.

  • mecha

    A parser combinator library for Zig (by Hejsil)

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • zigimg

    Zig library for reading and writing different image formats

  • http.zig

    An HTTP/1.1 server for zig

  • Project mention: Epoll: The API that powers the modern internet (2022) | news.ycombinator.com | 2024-01-11

    I have a somewhat popular HTTP server library for Zig [1]. It started off as a thread-per-connection (with an optional thread pool), but when it became apparent that async wasn't going to be added back into the language any time soon, I switched to using epoll/kqueue.

    Both APIs allow you to associate arbitrary data (void ) with the event that you're registering. So when you're notified of the event, you can access this data. In my case, it's a big Conn struct. It contains things like the # of requests on this connection (to enforce a configured max request per connection), a timestamp where it should timeout if there's no activity. The Conn is part of an intrusive linked list, so it has a next: Conn and prev: *Conn. But, what you're probably most curious about, is that it has a Request.State. This has a static buffer ([]u8) that can grow as needed to hold all the received data up until that point (or if we're writing the data, then the buffered data that we have to write). It's important to have a max # of connections and a max request size so you can enforce an upper limit on the maximum memory the library might use. It acts as a state machine to track up to what point it's parsed the request. (since you don't want to have to re-parse the entire request as more bytes trickle in).

    It's all half-baked. I can do receiving/sending asynchronously, but the application handler is called synchronously, and if that, for example, calls PG, that's probably also synchronous (since there's no async PG library in Zig). Makes me feel that any modern language needs a cohensive (as in standard library, or de facto standard) concurrency story.

    [1] https://github.com/karlseguin/http.zig

  • websocket.zig

    A websocket implementation for zig

  • known-folders

    Provides access to well-known folders across several operating systems

  • interface.zig

    Dynamic dispatch for zig made easy

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  • ctregex.zig

    Compile time regular expressions in zig

  • Project mention: Compile time regular expression in C++ | news.ycombinator.com | 2023-09-12

    Since other people are posting other lang implementations... someone did it for zig too (probably less polished than this C++ lib) [1]. It is nice that the regexes can be used at compile time too ().

    --

    : I think the difference between C++ template language and Zig comptime is that Zig's comptime is almost equal as Zig's regular language, whereas the experience of programming C++ templates almost feels like learning a separate, equally complex language.

    1: https://github.com/alexnask/ctregex.zig

  • meduza

    🦎 🧜‍♀️ Zig codebase graph generator that emits a Mermaid class diagram. (by tensorush)

  • Project mention: Medusa: Zig codebase graph generator that emits a Mermaid class diagram | news.ycombinator.com | 2023-07-30
  • zig-dns

    Experimental DNS library implemented in zig

  • protozig

    The protozig(uana), or protocol buffers implementation in Zig

  • mruby-zig

    mruby bindings for zig

  • wren-zig

    wren bindings for zig

  • libvlc-zig

    Zig bindings for libVLC media framework.

  • comptime_hash_map

    A statically initiated HashMap

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

Zig zig-library related posts

  • Channels or Actors in Zig?

    3 projects | /r/Zig | 11 Mar 2023
  • Allow download in build flake's build phase.

    4 projects | /r/Nix | 23 Feb 2023
  • What is missing in the zig ecosystem?

    2 projects | /r/Zig | 31 Jul 2022
  • Zig is becoming more production-worthy - zigmonthly

    6 projects | /r/stephentest | 4 Jul 2022
  • How would I compare two []u8?

    2 projects | /r/Zig | 11 Mar 2021
  • Is it possible to create hash maps at compile time?

    3 projects | /r/Zig | 6 Jan 2021
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 19 May 2024
    Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality. Learn more →

Index

What are some of the best open-source zig-library projects in Zig? This list will help you:

Project Stars
1 zig-clap 776
2 mecha 399
3 zigimg 403
4 http.zig 349
5 websocket.zig 221
6 known-folders 205
7 interface.zig 159
8 ctregex.zig 118
9 meduza 59
10 zig-dns 54
11 protozig 42
12 mruby-zig 32
13 wren-zig 26
14 libvlc-zig 16
15 comptime_hash_map 14

Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com