2 ms·
This is fantastic. The specs and the MDN documentation are pretty detailed, but I’ve found I need a fair bit of trial and error to understand some WAT language
by burntcaramel 3y ago
This is fantastic. The specs and the MDN documentation are pretty detailed, but I’ve found I need a fair bit of trial and error to understand some WAT language features.
The loop with a block directly inside is a good regular pattern! I’ll be using that all the time now.
I’ve been writing an Elixir DSL for WAT. Elixir has a powerful macro system, so I can closer to that pseudo C-syntax in this post, plus some other niceties. I plan to open source it as a library soon.
Here are examples I’ve written in it, like an HTML escaper, stateful HTML component, bump allocator, and a few state machines.
https://github.com/ComponentsGuide/components_guide/tree/master/lib/components_guide/wasm/examples https://github.com/ComponentsGuide/components_guide/tree/mas...