Compile-time evaluation
Having this feature will open up a lot of new possibilities for this project.
For example, the evaluation of pure functions with constant arguments. This would require some pretty clever evaluation, because the program needs to understand if a function is pure.
More reasonably, the first rules exploiting this feature could be to evaluate binary expressions using constant expressions (like a literal string or a number).
Examples:
| Original code | Processed code |
|---|---|
10 * 50 + 2 |
502 |
| true or false | true |
| 87 == "hello" | false |
This also opens the possibility to optimize if branches, by evaluating conditions at compile time and stripping unused branches.