FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.76k stars 5.36k forks source link

Add local Compiler Explorer feature #395

Open adlerjohn opened 2 years ago

adlerjohn commented 2 years ago

I'd like to run something like forc godbolt and have it launch a local instance of Compiler Explorer so I can inspect how the Sway source code maps to asm with different compiler options. Doesn't have to be Compiler Explorer, or even in the browser if IDEs can do it.

Maybe blocked by source mapping #70.

m-fawaz commented 2 years ago

In a dream world, we would have a nightly build of the Sawy compiler accessible through a public godbolt link just like https://rust.godbolt.org/ - Imagine sway.godbolt.org where developers can easily look at the generated assembly.

Do we know if this realistic? Some information on that here: https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/AddingALanguage.md

I've always found godbolt links incredibly useful, not just for looking at assembly, but also for sharing code and for quickly prototyping something.

adlerjohn commented 2 years ago

We don't really need a nightly build, do we? We do tag releases, so simply having each release of forc should suffice methinks.

m-fawaz commented 2 years ago

We don't really need a nightly build, do we? We do tag releases, so simply having each release of forc should suffice methinks.

True - as we're tagging releases often, nightlies are probably an overkill.