ethereum-optimism / ecosystem-contributions

Find ways to contribute to the Optimism Collective
MIT License
309 stars 119 forks source link

📝 Draft Project Idea: Alternative Solidity Compiler #45

Open smartcontracts opened 1 year ago

smartcontracts commented 1 year ago

What is a Draft Project Idea?

A Draft Project Idea is a concept for a project within the Optimism ecosystem that is generally considered valuable but has not yet been fleshed out into a clearly defined product. Draft Project Ideas may be converted into Ecosystem Project Ideas as they are explored further and more thoroughly specified.


Summary

Solidity is the primary programming language for most EVM-based applications. It currently has a single compiler, solc. Just like client diversity is important for the robustness of Ethereum, compiler diversity is important for the robustness of applications built on top of Ethereum. By introducing new compilers we can eliminate single points of failure and create competition that improves the Solidity experience for everyone.

Impact

Resources

0xJepsen commented 1 year ago

This is a big effort, i think would be really sweet to build a better intermediary representation (IR) first rather than a whole new language + compile. A strong IR imo would be the first step towards a better compile ecosystem for the EVM

David-Web3 commented 1 year ago

I really like this idea, just have following ideas:

I am really interested in this topic and I would like to learn more if there is any discussion.

jommi9 commented 1 year ago

We have also been internally discussing this idea at EQ Labs. We first though of introducing other languages like @David-Web3 mentioned, but maybe this specific project idea is not about that?

MeerKatDev commented 1 year ago

Maybe this RFP should be about joining forces with this project?

David-Web3 commented 1 year ago

Maybe this RFP should be about joining forces with this project?

IMHO, solang is a good compiler trying to have solidity running on different blockchains where EVM is not exist. It translates solidity to LLVM IR (or wasm) and then leverage the LLVM backend to generate binary for different environment.

Another method is to translate EVM opcodes to LLVM IR, and this way may be good at supporting all languages that targets to run on EVM.

also there must be other chain-specific considerations for supporting EVM language to run on non-EVM platform, as there is huge difference for account / storage/ memory accessing design and implementations.

pewulfman commented 11 months ago

Hi all, I totally new to the Optimism project and community. I have been working on the Ligo Languagecompiler for the the past 4 year, internal + toolings, for the Tezos Foundation Some former collegues and I would definitly be interested develloping a new solidity compiler.

How can I know more about this project ? @smartcontracts Is there someone at the Foundation I can contact about this ?

Best

pewulfman commented 11 months ago

This is a big effort, i think would be really sweet to build a better intermediary representation (IR) first rather than a whole new language + compile. A strong IR imo would be the first step towards a better compile ecosystem for the EVM

You don't have to change the syntax, but if you change an AST (IR) you still need to adapt the part before and after. In your opinion, what should be improve regarding the current IR ? I skimed through the code, the sol AST looks fine to me, except it's a CST. The Yul AST, well upon closer looks, it as no multiplicative types and suprissingly few litteral and no collections...

Just trying to understand, I am not very familiar with solidity yet