-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wasm-opt-for-rust proposal #1070
Conversation
This application is great! It'll heavily improve the developer experience with PS: A nit ‒ the project name is "ink!", the backstory is that we started out with a "normal" macro and wanted a tip of the hat to that, as well as maximizing the amount of "Dots" in our project name, as another tip of the hat to Polkadot :-). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the application! I’m happy to approve it and mark it as ready for review. If you have any questions feel free to reach out to grants@web3.foundation We are also flexible to amend the grant application at any time, if it makes sense to change it (additional work, certain problems etc.)
| 0d. | Docker | Docker is not required for this project. | | ||
| 0e. | Article | None. | | ||
| 1. | `wasm-opt` binary | Produce a `wasm-opt` binary that can be built by cargo but is otherwise identical to stock `wasm-opt`. | | ||
| 2. | APIs | Write an idiomatic, but possibly incomplete, Rust API for loading wasm, optimizing it, and writing it again. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this imply that milestone 2 will have the complete API? Do you know which parts might be incomplete or why??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does imply that M2 will have a complete API, and I have updated the M2 text to clarify.
For the most part wasm-opt
uses well defined C++ APIs within binaryen, and these will be easy to expose in Rust, and we will probably get them done quickly for M1.
Some API matters that could be punted to M2 include:
- Features provided by the
wasm-opt
binary that aren't provided by binaryen APIs. There are a few, particularly related to fuzzing. - There are also some
wasm-opt
flags that specifically affect console output, that probably don't make sense for a programmatic API, but may want to be accounted for in some way. For example there are flags for printing various things to the console - an API probably wouldn't just print things to the console, but may provide access to the appropriate info such that the caller can do that printing on their own. - For ease of integration into existing tools it may be desirable to let API callers pass the textual command-line options they already use directly to the API. This may especially be true if any tools allow command-line options to be passed-through to
wasm-opt
. This would likely require a custom-written Rust parser for thewasm-opt
command line options.
If you want I can reflect these specifics in the text.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brson thanks for submitting this grant application. I think this is something that would make ink! development more convenient, hence adding plenty of value to the community. I'm happy to go ahead with it. 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for applying to build a useful/core crate in the rust/wasm/cargo/ink! ecosystem. I'm glad your long-term plan is to apply for maintenance grants to maintain it. I'm looking forward to the article part of M2 to understand more about your work and how Layer 0 works in more detail.
Co-authored-by: S E R A Y A <takahser@users.noreply.github.com>
Co-authored-by: S E R A Y A <takahser@users.noreply.github.com>
I have fixed the capitalization and punctuation for the name ink!, accepted suggestions, and clarified the API deliverables. Thanks for the reviews and enthusiasm. |
Let me know if I should squash the commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the update. You don’t need to squash the commits.
Btw. @brson could you sign the latest version of our terms & conditions. See the CLAassistant bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very useful, happy to support it! I would love to see more grants for low-level tooling like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-Approving
Congratulations and welcome to the Web3 Foundation Grants Program! Please refer to our Milestone Delivery repository for instructions on how to submit milestones and invoices, our FAQ for frequently asked questions and the support section of our README for more ways to find answers to your questions. |
I have re-signed the CLA as requested. |
Thanks for the support all! |
Project Abstract
This project makes the
wasm-opt
tool more accessible to Rust programmers.wasm-opt
is a WebAssembly optimizer and is required by most software toolchains that produce WebAssembly binaries.This project is to package
wasm-opt
as a cargo crate, so that it can be installed by typingAdditionally, it will provide a Rust API so that toolchain developers may, if they desire, call
wasm-opt
programmatically, so that their users are not required to manually install the tool.For which grant level are you applying?
Application Checklist
project_name.md
) and updated.@_______
How Did You Hear About our grants program?