Is there a way to build Zig libraries to be used by Zig instead of as C libraries?

This page summarizes the projects mentioned and recommended in the original post on /r/Zig

WorkOS - The modern identity platform for B2B SaaS
The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
workos.com
featured
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.
www.influxdata.com
featured
  • zig-error-abi

    Library that allows zig errors to be returned from external functions

  • The thing that most provoked me to wonder about this was finding this project: Zig Error-ABI. It is designed to turn errors into hash codes so that they can be passed across the ABI boundary. As a Zig library, this only seems to make sense if there is Zig on both sides of the ABI boundary. It is counterintuitive that this should ever have reason to happen.

  • SDL.zig

    A shallow wrapper around SDL that provides object API and error handling

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • zig

    General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

  • The related issues (so far and to my knowledge) are - https://github.com/ziglang/zig/issues/3786 - https://github.com/ziglang/zig/issues/10156 - https://github.com/ziglang/zig/issues/10558

  • dmd

    dmd D Programming Language compiler

  • Since you're familiar with C and Zig, you might be interested to know about the D Langauge approach which is somewhere in between. When you import a file in D, it does not mean "include it's code in the compilation" like it would in Zig (unless you supply the '-i' argument to the compiler, I added that here https://github.com/dlang/dmd/pull/7099). Instead, when it imports a module it will parse the file but only look at interfaces (i.e. types, constants, function signatures, etc). By convention if this module comes from a library, then it would have been compiled beforehand and the source code is used to like a C header file.

  • zig-wayland

    Discontinued Zig wayland scanner and libwayland bindings

  • You do not need pre-compiled libraries for generated code. As an example, see zig-wayland, which generates code based on the Wayland protocol XML files during a build-step.

  • 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
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Buzz: A lightweight statically typed scripting language

    6 projects | news.ycombinator.com | 26 Dec 2023
  • Zig: The Modern Alternative to C

    12 projects | news.ycombinator.com | 10 Mar 2023
  • Some Thoughts on Zig

    9 projects | news.ycombinator.com | 21 Jul 2022
  • Why the use of semicolons?

    4 projects | /r/Zig | 8 Jul 2022
  • Terra Programming Language Releases Version 1.0.0

    5 projects | /r/programming | 8 Jun 2022