Hi :wave: I'm trying to understand the implementation of get_default
in wasmtime's Linker. More concretely: it treats ""
as a default export, but I haven't seen this in any of the specs. Is there an underlying reason/use-case for this behavior?
It's something of an experiment. It comes from thinking about wasm components built to be run as commands. We have the _start
convention today, but the way it handles command-line arguments isn't great. And looking forward, in a command-like wasm component, all exports should effectively be entrypoints, and it's desirable to have one as the default so that users can "just run" it.
Using the empty string for the default export is perhaps a little too subtle, but it does kind of have a nice way of suggesting "the export you get if you don't specify a specific entrypoint name"
That makes sense, thanks for the input @Dan Gohman
Saúl Cabrera has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC