binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Add APIs for introspection of imports

Open eyebrowsoffire opened this issue 3 years ago • 0 comments

As of right now, the current outward facing API (C, JS/TS, etc) allows you to enumerate all exports in a WASM module. These can be further introspected to get more specific info about that export.

However, there is no affordance for this on imports. This means the only real option is to enumerate all functions and see if each function is an import, enumerate all tables, etc. This is less than ideal.

In addition, for some reason there doesn't appear to be any way to determine whether memory is imported or not through the exposed APIs. There is also some additional metadata that would be useful on a few different object types that you can't get through the exposed APIs, which is tracked here: https://github.com/WebAssembly/binaryen/issues/3573. There a PR that was opened for that a while back but it looks like work on it stalled out before being merged.

eyebrowsoffire avatar May 04 '22 22:05 eyebrowsoffire