Skip to content

Slang yul#1395

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

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

Conversation

@Janther
Copy link
Member

@Janther Janther commented Jan 30, 2026

adding support for .yul files.

@Janther Janther requested a review from fvictorio January 30, 2026 20:04
@fvictorio
Copy link
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
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

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
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.

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

Comments