And oh man, what a ride it was. The WASM ecosystem DX is in a terrible state.
First, the "choose a runtime" part is a timesink in itself. Which one is WASI compliant, what are the supported features, is it active, is it stable, how are the docs (mostly terrible), what are the issues? And invariably you get into the Wasmer debate on the way and using other engines with WASI or their engine and WASIX. If I depend on a VC funded runtime, will the company survive, will it be free?
After choosing a runtime, installing it, setting the host and guest project up, you can finally.. wait, what? do I need to use wit-bindgen first to generate bindings? No, wait the compiler uses `wasi_snapshot_preview1` for which I need to use adapters to use with `wit-bindgen`? Another rabbit hole to dive into.
Then finally, you start working and try to do it by the docs - you get some minimal cases covered and are left to sift through the code, comments and github issues to actually understand what the authors meant and how we should use the API. Instead of showing `guest language` code you compile and embed, they show minified WAT that exports a function returning a hardcoded number. "Oh sorry, you want to try anything else? Good luck and grab your towel while you navigate the WASM universe with it's insane amount of WASM 101 tutorials."
I understand it's early, I understand it's in progress, but man there is a ton to improve on the DX side alone. It feels like the race went to "enable every language ever and make the fastest runtime around" vs "actually support people to properly adopt and build upon the ecosystem". And if it feels like that for someone who understands what's going on and has patience to sift through the docs and the code, I can't imagine how it is for somebody just hearing about it or starting to work on it.
In the end, I managed to implement what I wanted, but it took me a ton of glue and deep dives and searches just to get it running in it's primitive state relying on API's that will break in a month or two. And while I'm okay with sniffing that much glue for a weekend project, a lot of developers won't be, reducing the reach and adoption by a large margin.
Don't get the rant wrong tho - I absolutely love WASM and find it super fun. Hell, I even enjoy reading WASM code itself and figuring out what it does. But damn, the DX side _needs_ some serious improvements.