3 ms·
I've used wazero for a pet project (raw wasm generation from simple query plans) and it was really nice to work with! I also had to play around a bit with wasm
by cube2222 3y ago
I've used wazero for a pet project (raw wasm generation from simple query plans) and it was really nice to work with!
I also had to play around a bit with wasm relocations and the encoding/decoding libraries they've built are very readable, too, so I was able to hack together what I needed.
Fingers crossed for the optimizing compiler that's planned for some point!
- pdyc 3y agowhat are you using for generating wasm? tinygo or new go runtime support of wasm? what are the sizes of wasm binaries? last i checked helloworld was in the order of few MB's.
- evacchi 3y agotinygo still wins for size, and the reflection story got better (json works!). The traditional Go compiler produces larger binary but OTOH it's super-fast, as fast as native builds!
- cube2222 3y agoThe project was a custom compiler to turn a simple query plan (think select, where, group by) into wasm. So it was basically hand-written raw wasm generation. I did compile some helper functions from Rust though, which also served as the "skeleton" of the wasm artifact I was later generating my wasm into, since wasm doesn't have any kind of proper dynamic linking right now.
- eudoxus 3y agoLove to see what this looks like if its available to look at somewhere (Github?). Sounds super interesting, even as a toy project
- cube2222 3y agoNever got it to anything close to a finished state, instead moving on to doing the same prototype in llvm and then cranelift. That said, here's some of the wazero-based code on a branch - https://github.com/cube2222/octosql/tree/wasm-experiment/wasmsql https://github.com/cube2222/octosql/tree/wasm-experiment/was... It really is just a very very basic prototype.