Comment

Comment by WalterBright

1. Zig and C++ cannot allocate memory for CTFE.

2. Zig and C++ require any code to be run at compile time to be specially marked (comptime, constexpr). D will run any code that appears in a const-expression at compile time.

3. Zig and C++ require that if a function is to be used for CTFE, the entire function must be compatible with CTFE. D only requires the path taken through the function to be compatible with CTFE. D even has a `__ctfe` pseudo-variable that can be used to branch within a function to compile-time and run-time paths.

https://dlang.org/spec/function.html#interpretation

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton