>  - Constant-folding is left, at best, to optional compiler passes. It
>    might be nice to be able to guarantee a certain quantity of it to
>    language users, done in the front-end.

I always wondered about this, what is wrong with specifying in a
language that if a function only consists of 'ret <const-expr>' then
it is compiled as a constant? I know C++ started doing something like
this with constexprs and I think it might be the good approach for
this as well instead of adding another feature to the language (then
again, the ability to differentiate between constants and function
calls by looking at the code where the symbol is referred has an
appeal of it's own).



-- 
1110101111111110 - it's a way of life
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to