Why Zig When There Is Already C++ and Rust?

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • zig

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

    that's sort of a feature though, since it makes it less likely to be used ;-)

    rust can also recover from panics, but it's even less ergonomic, which makes it even more of a feature

    zig goes to the extreme and makes panics completely unrecoverable, tho it's unclear how practical that is for e.g. long running servers w/ many clients

    interesting discussion here:

    https://github.com/ziglang/zig/issues/3516

  • www.ziglang.org

    Sorry to pull the rug out from under ya'll like this but that article was a couple years old, so I gave it a once-over pass to update it. Mainly the "No hidden allocations" section is rewritten. You can see the full commit diff here: https://github.com/ziglang/www.ziglang.org/commit/bede1e57b6...

  • 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.

  • wg-allocators

    Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!

    And here's the working group's repo: https://github.com/rust-lang/wg-allocators

  • rules_rust

    Rust rules for Bazel

    With any compiled language you can use the compiler and vendor your dependencies instead of using the language's conventional package manager. For example, nothing prevents skipping Cargo and building Rust directly with rustc the way Bazel does.

    https://github.com/bazelbuild/rules_rust

  • llvm-project

    The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.

    > If Zig code doesn’t look like it’s jumping away to call a function, then it isn’t.

    I'll admit, I don't know zig. But how would it implement 1.0*2.0 for an architecture that doesn't support float multiplication? I assume that it would do something like compiler-rt and replace that operation with a function call. See https://github.com/llvm/llvm-project/tree/main/compiler-rt/l... for examples of "code that doesn't look like a function call" that actually is.

  • JITWatch

    Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

    If you already know any JVM or .NET language, the first step would be to understand the full stack, you don't need C for that.

    Many of us were doing systems programming with other languages before C went mainstream.

    What you need to learn is computer architecture.

    Getting back to JVM or .NET, you can get hold of JIT Watch, VS debug mode or play online in SharpLab.

    Get to understand how some code gets translated into MSIL/JVM, and how those bytecodes end up being converted into machine code.

    https://github.com/AdoptOpenJDK/jitwatch/wiki/Screenshots

    https://sharplab.io/

    Languages like F# and C# allow you to leave the high level comfort and also do most of the stuff you would be doing in C.

    Or just pick D, which provides the same comfort and goes even further in low level capabilities.

    Use them to write a toy compiler, userspace driver, talking to GPIO pins in a PI, manipulating B-Tree data stuctures directly from inodes, a TCP/IP userspace driver.

    Not advocating not to learn Zig, do it still, the more languages one learns the better.

    Only advocating what might be an easier transition path into learning about systems programming concepts.

  • dpp

    Directly include C headers in D source code (by atilaneves)

    dpp* can't do function definitions yet but for declarations it's as easy as #including a C header file natively.

    * https://github.com/atilaneves/dpp

  • 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.

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