tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
393 stars 109 forks source link

Constant evaluation should support all types and relevant stdlib functions #430

Open Gusarich opened 4 months ago

Gusarich commented 4 months ago

Basically this issue is a combination and an extension of #400, #284 and #195

The following types aren't supported right now:

Also the types that are already supported don't handle most of the stdlib and built-in functions.

Resolving this issue would mean making constant evaluation complete and full.

Depends on #290

anton-trunov commented 4 months ago

Also the types that are already supported don't handle most of the stdlib and built-in functions.

We need to implement special support for the built-in function, but for pure stdlib functions it would be nicer to evaluate those natively, i.e. implement function calls and interpret statements.

novusnota commented 4 months ago

Also the types that are already supported don't handle most of the stdlib and built-in functions.

We need to implement special support for the built-in function, but for pure stdlib functions it would be nicer to evaluate those natively, i.e. implement function calls and interpret statements.

I don't know if it's the correct place for this, but regarding evaluating stdlib functions and gas optimization we could really look into beginCell()...endCell()-like factory pattern. Like, to try and construct Cells at compile-time if all the prior values in such chained calls are constant and known. I scratched the topic a little in #344 before :)