Skip to content

wasm-tools in wasm & JS #2374

@vados-cosmonic

Description

@vados-cosmonic

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, 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 transpiled) 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 to import @bytecodealliance/wams-tools-metadata like so:

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions