News for hackers. Stuff that matters.
Re:Crabtime: Zig's Comptime in Rust by kibwen on Saturday March 22, 2025 @08:46AM (#43445357)
It's the other way around. Rust has always had contexts that are guaranteed to be compile-time (const and static items), and gradually added the ability to run some subset of the language at compile-time (const fn) specifically to accommodate const/static items (e.g. to replace the old lazy_static with the modern LazyLock), and naturally also allows these functions to run at runtime if you want (and in what would otherwise be a runtime context, you can enforce compile-time evaluation with a const block).

There are no comments on this comment yet.