As part of #23, we need to evaluate an expression at compile time. With the computation mode (#26), we know when building ahead of time (AOT) is possible.
let x = 7 + 5
General-purpose CTFE will leave results in VVM, though literal results (eg., integers or strings) are brought back to Sema. This is necessary for templates and macros.
let declarations and return statements will carry the evaluated literal in the HIR. var cannot have CTFE because it can always be reassigned.
User-defined types and functions must be sent to VVM ahead of time.
As part of #23, we need to evaluate an expression at compile time. With the computation mode (#26), we know when building ahead of time (AOT) is possible.
General-purpose CTFE will leave results in VVM, though literal results (eg., integers or strings) are brought back to Sema. This is necessary for templates and macros.
let
declarations andreturn
statements will carry the evaluated literal in the HIR.var
cannot have CTFE because it can always be reassigned.User-defined types and functions must be sent to VVM ahead of time.