@tigerhiddenadam has been trying to get one of the CHERIoT simulators working in a browser so that we can have a complete demo environment working on the web site…
@whitequark @david_chisnall thank you. This is quite rough at the moment. I can get the simulator to display the help flags but it doesn't currently run an ELF. It also wouldn't build for me on aarch64.
If we can, the MPact simulator would be the best one to run in WAsm because it's much faster than the Sail and it also has an integrated debugger, so is more interesting for a live development environment.
@whitequark is there any stumbling blocks I need to be aware of if i have a program - programming language VM - that uses libuv for I/O and timers, or can I take some one-and-done thing where I put a heap of files in on one end and get all files back out on the other end or something?
https://github.com/moarvm/moarvm/ if you would like to take a look yourself
@whitequark being able to run in browser would be dope, even though the full Rakudo (the raku language compiler) may be a little too big to fit in a typical user's patience limit.
the best way we can currently offer to run some Raku code without anything but your browser is compiler explorer; there's also glot.io which supports multiple code files as input, but is one and a half years behind on versions.
With MoarVM we run on a bunch of architectures already, so WASI would not necessarily be a big expansion of available targets.
Maybe if a JIT that spits out web assembly at run time is not too much work to write, it would let us target more than just x86_64 with jit compilation?
@timotimo loading dynamically compiled chunks of Wasm is definitely possible, *but* it's quite a bit of work to implement; it is not something that even a really good developer could do in, say, a week of work
if you run in the browser and rely on libuv i think you first need to do a port of libuv that uses JSPI for waiting and IO, then you can test that on simpler applications and eventually the full language runtime
@whitequark not having spent much time inside libuv's code itself, and not knowing anything about JSPI or the different wasm runtimes / environments, that sounds to me like I'll need a rather enormous Round Tuit before that becomes feasible (completely ignoring the JIT part for now).
thank you for the pointers!
@timotimo yes i would say it is quite a task to bite off and chew on
personally, i would bill two months of time for it and do it in two weeks, if this gives you any sort of useful indication of complexity and uncertainty