editor
editor copied to clipboard
MoLang: Test whether custom function is side effect free & then completely resolve it at compile time
side effect free: Static arguments, no var.
access, ...
I could look into this later this year. I plan on looking at the constant folding / common subexpression elimination, so I could take a look at this too (as well as #154)
What would be the benefit of this feature? A smaller file size?
Also better performance within Minecraft. The most performant code is code that doesn't exist
Exactly. In my project, we have a lot of math based animations, that are in essence just some sin/cos with some constant factors, but those factors are often spread out over several additions and multiplications. This is currently already a feature, but it only optimizes from left to right, and not right to left. Doing both could save some operations.