Crabtime: Zig's Comptime in Rust

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

InfluxDB high-performance time series database
Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
influxdata.com
featured
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai
featured
  1. advent

    My solutions to Advent of Code (by nindalf)

    I tried the library out and it worked pretty well for me.

    I had previously written a declarative macro to generate benchmark functions [1]. It worked, but I didn't enjoy the process of getting it working. Nor did I feel confident about making changes to it.

    When I rewrote it using crabtime I found the experience much better. I was mostly writing Rust code now, something I was familiar with. The code is much more readable and customisable [2]. For example, instead of having to pass in the names of the modules each time I added a new one, I simply read the files from disk at compile time.

    [1] - https://github.com/nindalf/advent/blob/13ff13/benches/benche...

    [2] - https://github.com/nindalf/advent/blob/b72b98/benches/benche...

  2. InfluxDB

    InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.

    InfluxDB logo
  3. watt

    Runtime for executing procedural macros as WebAssembly

  4. clr

    Checker for Lifetimes and other Refinement types (by ityonemo)

    It sounds like you haven't seen projects like this yet:

    https://github.com/ityonemo/clr

    They're popping up all over. For some reason, Zig folk want Rust things and Rust folk want Zig things.

  5. rfcs

    RFCs for changes to Rust

    > so your claim is that rust compiler knows in advance which will be used by the target and adjusts its softfloat accordingly?

    Rust performs FP operations using the precision of the underlying type. For compile time evaluation this is enforced by Miri, and for runtime evaluation this is enforced by carefully emitting the appropriate LLVM IR.

    > IIRC there are cases for SIMD where there is only a 2 ULP guarantee and some tryhard silicon gives you 1 ULP for the same opcode.

    Rust only permits operations in constant contexts when it's confident that it can make useful guarantees about their behavior. In particular, FP ops in const contexts are currently limited as follows:

    "This RFC specifies the behavior of +, - (unary and binary), *, /, %, abs, copysign, mul_add, sqrt, as-casts that involve floating-point types, and all comparison operations on floating-point types."

    https://github.com/rust-lang/rfcs/blob/master/text/3514-floa...

  6. rust

    Empowering everyone to build reliable and efficient software.

    That's because the linked issue is a different, but related tracking issue. The FP-in-const tracking issue was this one: https://github.com/rust-lang/rust/issues/57241

  7. interface.zig

    Dynamic dispatch for zig made easy

    Of course they count, but they never reached Zig's expressivity/simplicity ratio. For example, Oberon doesn't have generics. You could argue that Zig doesn't have dynamic dispatch as part of the language, but it's expressive enough for that to be done in a library (https://github.com/alexnask/interface.zig).

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

  • Tail Call Recursion in Java with ASM (2023)

    2 projects | news.ycombinator.com | 30 Mar 2025
  • When Zig is safer and faster than (unsafe) Rust

    3 projects | /r/rust | 7 Mar 2023
  • I've been learning Rust for 3 days and this is my first impression

    4 projects | /r/ProgrammerHumor | 5 Mar 2023
  • Linus Torvalds: Rust For The Kernel Could Possibly Be Merged For Linux 5.20

    4 projects | /r/programming | 21 Jun 2022
  • Rust's async isn't F# king colored

    3 projects | news.ycombinator.com | 11 Mar 2021

Did you know that Rust is
the 5th most popular programming language
based on number of references?