With the current version of the SDK, JavaScript can only read files in the
package folder. It would be great to be able to read files in the work
directory too. Allowing this would open up many possibilities for WASM modules
to write a data to a file and have JavaScript consume it, without needing to
send this data in tiny chunks over L-Vars.
I really don’t think we want file-io as the preferred method of passing
structured data in real-time between systems. Would the JS be polling the file
to see if anything new is in there? A basic implementation of event-driven
async message passing (e.g. callbacks) would fit the JS model particularly
well, i.e. the JS would register a callback that the WASM could trigger.
Ideally this would be possible in both directions. If bridging JS and wasm/c++
structured data is too complex, the lowest common denominator would be an
argument including a string payload, so similar to your file-io but without
the polling.