Nullus157 / cbor-diag-rs

Support for parsing/encoding CBOR diagnostic notation and annotated hex

Home Page:https://cbor.nemo157.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distribute CLI as precompiled wasm blob

Nemo157 opened this issue · comments

Some very quick testing via cargo-wasi shows that everything except colored output appears to work (probably need to add some support for something in termcolor). From a release build wasmtime appears to need ~7s on a Macbook Air to JIT the optimized wasm blob on first run, and it's pretty much instantaneous on future runs.

How to actually do this? 🤷‍♂

One additional thing I would like to do with this is to sandbox the tool more. The only thing it needs access to is stdin+stdout+args, all network and filesystem access should be disabled. It doesn't look like running from wasmtime as a CLI tool supports this, so maybe cbor-diag-cli should use wasmtime as a library if there's some way to do so there.

An alternative thought I had recently, we can just publish a wasm32-wasi binary via github releases.