Stream: wasi

Topic: disallowing extra exports for commands incompat w/ subtyping


view this post on Zulip fitzgen (he/him) (Sep 07 2021 at 19:23):

A random thought I just had: from a module-linking perspective, you can always add extra exports to a module and it can still be used wherever it could have been used before due to module-level subtyping. However, with WASI commands, we explicitly check for and disallow (or sometimes just warn) extra exports other than _start.

It might make sense to switch to the subtyping paradigm for WASI commands.

I understand we don't want to encourage random code shapes turning into de facto standards, but I don't see how that is an issue if we are ignoring the extra exports. Mostly I've just found these restrictions to be annoying when trying to benchmark/run existing Wasm modules that happen to have some extra exports but which don't rely on them being used/called at all.

cc @Dan Gohman @Luke Wagner

view this post on Zulip Dan Gohman (Sep 07 2021 at 19:27):

Part of the context is that with module linking, the vision is more "user designs an interface in a witx file" and less "user adds -Wl,-export-dynamic which isn't really meant for this, but it's a way to export all their symbols because they want to call some of them".

view this post on Zulip Dan Gohman (Sep 07 2021 at 19:28):

So as we transition into module linking, I expect it'll make sense to be careful about module linking ABIs, and to relax the restrictions on core-wasm ABIs.


Last updated: Oct 23 2024 at 20:03 UTC