WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.11k stars 439 forks source link

Do there any JS APIs for accessing the WASM GC type? #1646

Closed kylo5aby closed 1 year ago

kylo5aby commented 1 year ago

Hi, Maybe my question is stupid, Currently, if we want to access GC type value through js-api, it output object, I wonder if there have JS APIs to access the fields of wasm gc type value? V8 have already provide C++ related APIs to access them, but in JS it seems not support yet. I would like to know if the JavaScript API will support this feature in the future, and if not, what are the challenges?

Thanks.

rossberg commented 1 year ago

The initial API is described here: https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP-JS.md

It indeed does not offer much in the way of accessing GC objects from JS. That was left for future versions, because such an API is far from trivial (e.g., all the Wasm type structure needs to be reflected in JS), and it's not clear what exactly it should offer.

kylo5aby commented 1 year ago

The initial API is described here: https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP-JS.md

It indeed does not offer much in the way of accessing GC objects from JS. That was left for future versions, because such an API is far from trivial (e.g., all the Wasm type structure needs to be reflected in JS), and it's not clear what exactly it should offer.

get it, thanks for your reply.