News for hackers. Stuff that matters.
Re:WebAssembly Text Code Samples by burntcaramel on Saturday April 22, 2023 @07:23PM (#35671815)
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/mas...

There are no comments on this comment yet.