How Safe Is Zig?

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

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

    An implementation of a LRU cache

  • You didn't seem to click the commit the guy linked with the rust code https://github.com/jeromefroe/lru-rs/pull/121/commits/416a2d...

    It has nothing to do with opting out. Zig, Rust and no language saves you when you write incorrect unsafe code. My original point is disqualifying c tools is misleading and everything suffers from incorrect unsafe code

  • pure

    A static analysis file format checker. (by ronomon)

  • Wow, that's saying something!

    The tool is called Pure [1]. It was originally written in JavaScript and open-sourced, then rewritten for Microsoft in C (running sandboxed) after it detected David Fifield's “A Better Zip Bomb” as a zero day.

    I'd love to rewrite it in Zig some day to benefit from the checked arithmetic, explicit control flow and spatial safety—there are no temporal issues for this domain since it's all run-to-completion single threaded.

    Got to admit I'm a little embarrassed it's still in C!

    [1] https://github.com/ronomon/pure

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

    Empowering everyone to build reliable and efficient software.

  • The headline feature of rustc memory management is the use of arenas: https://github.com/rust-lang/rust/blob/10f4ce324baf7cfb7ce2b...

        //! The arena, a fast but limited type of allocator.

  • zig

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

  • zorrow

    Borrowchecker in Zig

  • Somebody implemented part of it in the past, but it was based on the ability to observe the order of execution of comptime blocks, which is going to be removed from the language (probably already is).

    https://github.com/DutchGhost/zorrow

    It's not a complete solution, among other things, because it only works if you use it to access variables, as the language has no way of forcing you.

  • stable_deref_trait

    Unsafe marker trait for types that deref to a stable address

  • Unsafe Rust is an esoteric language without iron-clad guarantees, and type-level programming and async Rust is an esoteric metalanguage (https://hirrolot.github.io/posts/rust-is-hard-or-the-misery-...). For example, matklad made a recent blog post on "Caches In Rust" (https://matklad.github.io/2022/06/11/caches-in-rust.html). The cache is built around https://docs.rs/elsa, which is built around https://docs.rs/stable_deref_trait/latest/stable_deref_trait..., which is unsound for Box and violates stacked borrows: https://github.com/Storyyeller/stable_deref_trait/issues/15

    There is a recurring trend of sound C programs turning into unsound Rust programs, because shared mutability is often necessary but it's difficult to avoid creating &mut, and Stacked Borrows places strict conditions on constructing &mut T (they invalidate some but not all aliasing *const T).

  • tigerbeetle

    Discontinued A distributed financial accounting database designed for mission critical safety and performance. [Moved to: https://github.com/tigerbeetledb/tigerbeetle] (by coilhq)

  • It's a pleasure. Let me know if you have any more questions about TigerBeetle. Our design doc is also here: https://github.com/coilhq/tigerbeetle/blob/main/docs/DESIGN....

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