optimize the stack placement of constructor params (at first usage instead of at the beginning) #217
Labels
cashc-compiler
Relates to the cashc compiler
Milestone
Instead of placing all contructor params at the beginning of the contract, the compiler could auto-insert the params at first usage. This would be a nice default, resulting in optimized contracts with limited extra complexity for the compiler. Stack juggling the constructor parameters will likely become a bigger overhead with the increased VM Limits CHIP.
Changing the placement of constructor variables would be a breaking change but if it can be bundled together with other compiler changes, then it is not too bad that compatibility is broken as CashScript is still evolving and improving.
Simulated state is a pretty niche use-case now after CashTokens and developers using it already need to be aware of many intricacies
For simulated state there could be a way to explicitly opt-out of this compiler optimizations. ChatGPT suggested a keyword
anchor
The text was updated successfully, but these errors were encountered: