Yul, eWasm, Solidity: Progress and Future Plans

By Christian Reitwiessner

Over the last months, the Yul language has matured and proved its flexibility. The Solidity team has implemented an optimizer and an eWasm dialect and is now full steam working on rewriting the Solidity code generator to produce Yul code to replace sequences of EVM instructions.

The Yul optimizer now matches the old EVM optimizer and already surpasses it with features like function inlining and cross-function optimization. This is also the main reason why the new code generator can be written in a super-modular way. Furthermore, it can equally operate on EVM- and eWasm-flavoured Yul code, which is important to cope with the 256- to 64-bit translation.

Through this, the Solidity compiler can now output eWasm code, which makes efficient use of 64 bit types. Furthermore, the new code generator includes automated overflow checks everywhere, again something that would have destroyed the old optimizer.

Future work:

We plan to use a more intricate formal system to remove redundant operations and checks based on range-relations between variables.

The introduction of memory area types will help optimizing memory allocation.

Finally, a super-optimizer could prove useful, since it is worth spending extra time on compilation to save gas.

Devcon V: Day 3: Room 7

Share your thoughts, add a comment!

You must be logged in in order to place a comment.

Article comments

Loading...
No comments yet, be the first to comment this article