Firstly foundry is pushing Ethereum development to the next level, giving us tools just as good as you have in the web2 space. This is key for mass adoption, bringing new developers into the space, so thanks for smashing it guys.
Was chatting to @gakonst about this on Twitter DMs and he told me to put the idea in here as a feature request:
From seeing what foundry has built already when focusing on the amazing gas breakdowns it seems the bulk of the complex problem has been solved (working all that stuff out) and it's now pushing these amazing solutions as far as we can.
Idea:
Gas optimization is very important to a lot of the Ethereum builders but even though it's incredible to quickly run a script to compare the gas changes how amazing would it be to see it in real-time as you change the code?
The idea is to build a vscode extension that outputs the gas consumption of each method and even each line which on save recomputes these figures and re-renders them in real-time. This allows solidity developers to see these changes next to the executing code itself (very powerful), it also allows them to see if they have increased the gas or decreased it as they change their code (again very powerful).
With the ability to compile rust code into WASM we could expose a simple TypeScript wrapper allowing the vscode extension to easily call it and then use all the built-in stuff vscode extension package has already solved to call on changes etc.
If the rust code had methods like:
// lazy load call on file open initial time then cache
computeAllGas(fileLocation)
// on change of a line after a 2-second break or whatever recall this to computer
recomputeGas(fileLocation, lineNumber)
// just another nice way to compute the gas
recomputeGas(fileLocation, methodName)
It would then be pretty easy in the vscode extension to call that interface to make this work really nicely for developers.
Happy to write the vscode extension if the WASM rust part was done and exposed as a simple TypeScript wrapper.
I think this could be a game changer in how people work and would improve the gas visibility a lot.
On top of this once we get this initial solution working we can then extend it to include code coverage, gas suggestions, and many more things! (foundry-vs-code)
Anyway just dumping this here, let me know what people think 👍
Component
Brand new package.
Describe the feature you would like
Firstly foundry is pushing Ethereum development to the next level, giving us tools just as good as you have in the web2 space. This is key for mass adoption, bringing new developers into the space, so thanks for smashing it guys.
Was chatting to @gakonst about this on Twitter DMs and he told me to put the idea in here as a feature request:
From seeing what foundry has built already when focusing on the amazing gas breakdowns it seems the bulk of the complex problem has been solved (working all that stuff out) and it's now pushing these amazing solutions as far as we can.
Idea:
Gas optimization is very important to a lot of the Ethereum builders but even though it's incredible to quickly run a script to compare the gas changes how amazing would it be to see it in real-time as you change the code?
The idea is to build a vscode extension that outputs the gas consumption of each method and even each line which on save recomputes these figures and re-renders them in real-time. This allows solidity developers to see these changes next to the executing code itself (very powerful), it also allows them to see if they have increased the gas or decreased it as they change their code (again very powerful).
With the ability to compile rust code into WASM we could expose a simple TypeScript wrapper allowing the vscode extension to easily call it and then use all the built-in stuff vscode extension package has already solved to call on changes etc.
If the rust code had methods like:
It would then be pretty easy in the vscode extension to call that interface to make this work really nicely for developers.
Happy to write the vscode extension if the WASM rust part was done and exposed as a simple TypeScript wrapper.
I think this could be a game changer in how people work and would improve the gas visibility a lot.
On top of this once we get this initial solution working we can then extend it to include code coverage, gas suggestions, and many more things! (foundry-vs-code)
Anyway just dumping this here, let me know what people think 👍