A monolithic repository for WASM components to be exported for use in Abridge.
Currently this is all research and experimentation. Please submit pull requests/issues.
At this time, optimization is not a priority. There are several ways to optimize the WASM bundle size once Abridgeβs WASM components are made and algorithms are optimized.
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
rustup update
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
git clone https://github.com/simbleau/abridge-wasm
cd abridge-wasm
wasm-pack build --release --target web
python3 -m http.server
abridge_wasm_bg.wasm and abridge_wasm.js. The other files were generated for npm, and serve us no purpose. I am unsure if there is a way to only generate these 2 files.build --release settings in the Cargo.toml.
twiggy can be used to inspect LLVM-IR to determine which functions are panicking. The functions do not need to call panic(). Instead, they can arise naturally:
my_slice[i]dividend / divisorOption or Result: opt.unwrap() or res.unwrap()
cargo install twiggy--dev to retain function symbols, e.g. wasm-pack build --dev --target webtwiggy garbase pkg/abridge_wasm_bg.wasm, for dead functions. I am unsure how to strip these functions right now.twiggy top pkg/abridge_wasm_bg.wasm | head, for the largest functionstwiggy paths pkg/abridge_wasm_bg.wasm | grep panic -B 1 | grep -v 'β¬' | grep -v '\-\-', A hacky script to check if panics are used in the WASM
wasm-glue.js wrapper which imports the abridge_wasm.js and attaches functionality to certain elements
<script defer type="module" src="wasm-glue.js"></script>.
glue file alltogether. This will be my next experiment.