More aggressive constant folding
giann opened this issue · comments
Benoit Giannangeli commented
Right now we do constant folding in specific locations. We could systematically check if a node is constant before generating it. BUT it requires to separate type checking in their own functions so we could do:
type checking -> is it constant ? yes -> toValue
no -> generate
We already do this work in the JIT since type checking has already been done at this point.