wasm-clang icon indicating copy to clipboard operation
wasm-clang copied to clipboard

Stdin input

Open nullxx opened this issue 2 years ago • 1 comments

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

nullxx avatar Feb 17 '23 22:02 nullxx

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.

binji avatar Apr 27 '23 16:04 binji