Tim
Tim

Reputation: 8919

WASM-to-Javascript bridge: what types can be passed in 2022?

I am just reading about WASM but have never used it. I read in an article that only integers and floats can be passed from WASM to javascript. The article was dated 2019. Has that limitation changed in the interim?

Upvotes: 0

Views: 269

Answers (1)

user18074821
user18074821

Reputation: 216

Webassembly is a low level language so it deals basic types as number and arrays of of numbers (sometimes called buffers) these can on the other han represent other things such as images or audio files or video files.

So you can for instance load an image via javascript pass it to a webassembly library for processing (like applying a filter).

There are also different frameworks libraries for communicating higher level structures to webassembly. One such is Blazor (for using C# compiled to webassembly) another is e.g. Qt for WebAssembly for creting Qt user interfaces in webassembly.

Upvotes: 1

Related Questions