buzz-language / buzz

👨‍🚀 buzz, A small/lightweight statically typed scripting language

Home Page:https://buzz-lang.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More aggressive constant folding

giann opened this issue · comments

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.