wasm-clang
wasm-clang copied to clipboard
Stdin input
So far, the input had to be provided before running the program. This was a bit complicated, as the function that handled this, 'host_read', expected a synchronous response, and to get a real-time response from the user, it was necessary to wait for a while (asynchronous). That's why I have implemented a possible solution.
Could you take a look at it?
https://github.com/nullxx/compy/blob/81b5463dad671335825f74ea27c78681b2a71cea/src/lib/worker/lib/memfs.ts#L139-L157
Sorry I didn't take a look at this earlier!
I think it makes sense to turn this into an async function, but I don't recall where else it's being used. It may be that it's required to be synchronous elsewhere. In any case, it looks like you were able to get it working for the most part.