Skip to content

asm.js -> wasm migration path #5279

Closed
Closed
@buu700

Description

@buu700

Is it planned for the migration path for existing asm.js projects to wasm to be as simple as adding -s WASM=1 to an existing Makefile?

That doesn't seem to be the case right now, based on a quick test with one of the asm.js libraries that I maintain, but I understand that wasm support is still early right now. It would be very convenient for everything to eventually work exactly as it does now for asm.js, without any extra required tooling or rewriting of existing code.

Specific concerns that come to mind:

  • --pre-js/--post-js support — my implementations use pre.js to start a closure and post.js to call into Module; does (or will) this already work as-is for wasm?

  • Module API — does this change at all when using wasm?

  • wasm bundling, as in the webpack wasm-loader which simply converts wasm ES6 imports into Uint8Arrays (we have a constraint that requires our asm libraries to each compile to a single JavaScript file)

  • asm.js bundling — I'd be fine waiting a year or two for non-wasm-supporting browser versions to lose market share before flipping the wasm switch, but for my purposes it would really be ideal if I could just start using it today in newer browsers for the performance benefit, even at the cost of inflating the bundle size

I see in #5104 that the last two aren't currently implemented, but as a whole this seems like a separate issue since that ticket looks to be more focused on the XHR-based implementation (which explicitly won't apply to my use case).

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