bytecodealliance / bytecodealliance/wasm-tools

wasm-tools in wasm & JS

Open
#2,374 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
16h 57m
Merged PRs (30d)
38

Description

One thing I've been thinking about was making a project that essentially provided all the wasm-tools that *could* be compiled to WASM in wasm, with WITs to expose their functionality.

We do this already informally in Jco via the [`wasm-tools-component` subproject](https://github.com/bytecodealliance/jco/tree/main/crates/wasm-tools-component), but it would be great to get this functionality upstream and built into the release processes, etc.

Thanks to @tschneidereit to noting that I should make an issue to get the discussion started on this.

Happy to work on this of course and build this against this repo itself or build it on the side and use the rust crates as dependencies to prove it out and integrate via PR afterwards once we're happy with it.

P.S. In addition to having Wasm produced for individual tools (we could also do an amalgam with some composition of course), it would also be very convenient to have the *transpiled* (as in `jco transpile`d) versions be available somewhere (this likely fits better downstream) so that users have another way to consume the libraries (via a JS package *and* Wasm components directly).

The end goal is for a project like [`@bytecodealliance/componentize-js`](https://www.npmjs.com/package/@bytecodealliance/componentize-js) to import `@bytecodealliance/wams-tools-metadata` like so:

```js
import { addMetadata } from '@bytecodealliance/wasm-tools-metadata/wasm/transpiled';

async addProducerMetadata(fields) {
const wasmBytes = readFile(...);
const updatedBytes = addMetadataSection(bytes, { producer: fields });
return updatedBytes;
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.