xh icon indicating copy to clipboard operation
xh copied to clipboard

Investigate compiling xh to WebAssembly

Open ducaale opened this issue 4 years ago • 2 comments

This could be useful if we decide to have an online playground like jqplay.

ducaale avatar Mar 04 '21 08:03 ducaale

It seems WASI could be the perfect solution for us.

  • https://medium.com/wasmer/webassembly-sh-408b010c14db
  • https://blog.jeremylikness.com/blog/explore-wasi-from-your-browser/
  • https://wapm.io/interface/wasi
  • https://rreverser.com/webassembly-shell-with-a-real-filesystem-access-in-a-browser/
Screenshot 2021-03-11 000511

That being said:

Edit: WASI doesn't seem to support async/await currently so WASM would be the way to go.

ducaale avatar Mar 11 '21 00:03 ducaale

Proof of concept: https://xh-playground.netlify.app/

Screenshot 2021-03-14 235349

crates + npm packages used

Edit: the code is hosted at https://github.com/ducaale/xh-playground

ducaale avatar Mar 14 '21 23:03 ducaale