3 ms·
The practical value is that moving a computation from runtime to compile time can then be purely an optimization, rather than potentially changing its semantics
by weinzierl 13d ago
The practical value is that moving a computation from runtime to compile time can then be purely an optimization, rather than potentially changing its semantics. Think generated lookup tables or numeric constants. Ideally f(x) means the same thing whether evaluated by the compiler or by the generated program.
- chaz72 13d ago> Ideally f(x) means the same thing whether evaluated by the compiler or by the generated program. Absolutely, that’s why I wanted to know what types of things aren’t covered yet, and that’s also why I don’t share your certainty that they won’t be resolved later.
- weinzierl 13d agoYou'd have to read the discussions the Rust community has about this to get a picture. It's complicated. From what I understand, there is hope for sqrt but there is no consensus on transcendentals.
- chaz72 12d agoNo worries, I take your word for the status of these in Rust and I don’t need those features in my own Zig comptime code which as I said in a different comment, has been very predictable over the last few years. Thanks for explaining though!