-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output Yul ASTs #9590
Comments
Related to #9053 |
I'm wondering - is it really essential or would it also work to run solidity in yul mode and output the ast? |
Which ast would that be? What I'm imagining is that all the Yul compilation steps could be exported:
|
This is called
This is displayed on cli via
This is not available yet. |
I'm still not sure what this issue is about and what functionality we are really missing here. |
As far as I understood, it's about the YulAST, being output as JSON just like our Solidity AST can be exported... |
This feature was also requested in #11043. |
I believe this issue has its roots in a discussion @acoglio and I had with @leonardoalt . In order to verify the correctness of specific applications of Yul optimizers, you need the before and after Yul code. Right now, the "standard JSON" form can contain "ir" and "irOptimized", but those are source code, not ASTs. Yul surface syntax is unambiguous so that's not too bad. It does require that we trust the prettyprinter and that we have a formal grammar and parser. (We have those now. E.g., the ABNF grammar could be useful to others.) However, it would be higher assurance if, in addition to the before and after Yul code, the before and after internal ASTs (that are input and output to the optimizers) could be serialized to the JSON output structure, as @Marenz suggests. |
This comment has been minimized.
This comment has been minimized.
I notice this is closed, but I don't get any output for |
@gnidan It's independent of |
Hey, so I just tried this with Solidity 0.8.21, and I'm still not getting ASTs for my Yul sources? I'm not using Edit: It's not just that there's no AST; it's that there's no Edit: Oh, I see -- I have to request the AST at the contract level, instead of at the file level. (Even though it ultimately appears in |
Oh, yikes, here's a bug -- the |
It would be helpful/essential for verification tools to have access to the Yul ASTs that are generated throughout compilation via Yul.
The text was updated successfully, but these errors were encountered: