Skip to content

Slang yul#1395

Closed
Janther wants to merge 4 commits intomainfrom
slang-yul
Closed

Slang yul#1395
Janther wants to merge 4 commits intomainfrom
slang-yul

Conversation

@Janther
Copy link
Copy Markdown
Member

@Janther Janther commented Jan 30, 2026

adding support for .yul files.

@fvictorio
Copy link
Copy Markdown
Member

Sadly I don't think this works 😞

The problem is that Yul is a very overloaded term. It can refer to:

  • The language used inside Solidity assembly blocks. That's what Slang can parse.
  • Yul files, which have a Yul object. Slang can't parse this as far as I can tell.
  • Yul is also the IR to which solc compiles when using the IR-based codegen, but that's not important for this discussion.

So this, as it is, it's not very useful. For example, if you try to format this file, you'll get an error:

[error] source/deterministic-deployment-proxy.yul: Error: We encountered the following syntax error:
[error] 
[error]         Expected OpenBrace.
[error] 
[error] We couldn't infer a Solidity version based on the pragma statements in your code so we defaulted to 0.8.33. You might be attempting to use a syntax not yet supported by Slang or you might want to specify a version in your `.prettierrc` file.

I guess it wouldn't be hard for Slang to add support for Yul objects though.

cc @OmarTawfik @alcuadrado

@Janther
Copy link
Copy Markdown
Member Author

Janther commented Feb 8, 2026

Sadly I don't think this works 😞

The problem is that Yul is a very overloaded term. It can refer to:

  • The language used inside Solidity assembly blocks. That's what Slang can parse.
  • Yul files, which have a Yul object. Slang can't parse this as far as I can tell.
  • Yul is also the IR to which solc compiles when using the IR-based codegen, but that's not important for this discussion.

So this, as it is, it's not very useful. For example, if you try to format this file, you'll get an error:

[error] source/deterministic-deployment-proxy.yul: Error: We encountered the following syntax error:
[error] 
[error]         Expected OpenBrace.
[error] 
[error] We couldn't infer a Solidity version based on the pragma statements in your code so we defaulted to 0.8.33. You might be attempting to use a syntax not yet supported by Slang or you might want to specify a version in your `.prettierrc` file.

Interesting 🤔, glad we opened the conversation about this subject.

I'll change the PR to a work in progress for now.

@Janther Janther marked this pull request as draft February 8, 2026 13:12
@OmarTawfik
Copy link
Copy Markdown

Thanks for the heads up! I don't think we have looked into supporting Yul objects as an input format so far.
I wonder how often these files are edited by users/how urgent this is for the plugin to support it?

@fvictorio
Copy link
Copy Markdown
Member

It's somewhat niche. It would be cool to support it but there's no rush really. I also think we could write a sort of wrapper that parses the "envelope" and then delegates to Slang, although that would be less than ideal.

@Janther
Copy link
Copy Markdown
Member Author

Janther commented Mar 27, 2026

close=ing for now as I don't plan to work on this for the near future

@Janther Janther closed this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants