Patrick Dubroy
dubroy.com
Patrick Dubroy
@dubroy.com
Programmer & researcher, co-creator of https://ohmjs.org. ๐Ÿ‡จ๐Ÿ‡ฆ ๐Ÿ‡ฉ๐Ÿ‡ช ๐Ÿ‡ช๐Ÿ‡บ

Co-author of https://wasmgroundup.com โ€” learn Wasm by building a simple compiler in JavaScript.

Prev: CDG/HARC, Google, BumpTop
Pinned
Patrick Dubroy @dubroy.com ยท Mar 10
Here it is โ€” very happy to officially release the book that @marianoguerra.org and I have been working on for the past 2ยฝ years.

If you bought it in early access, thanks for your support! ๐Ÿ™

If you haven't bought it yet, please check it out!!
Excited to announce the official launch of our online book, WebAssembly from the Ground Up! ๐ŸŽ‰

It's the book we wish we'd had 3 years ago.

No messing with tools and frameworks. It's a hands-on guide to the core of Wasm: the instruction set and module format.

Link below. ๐Ÿ‘‡
It's even responsive!
November 21, 2025 at 3:59 PM
Definitely one of the cooler language playgrounds I've seen: pinky.cool.omg.lol
November 21, 2025 at 3:46 PM
Excited to finally release the blog post that @marianoguerra.org has been working on for a while!
Per your request, please find enclosedโ€ฆa new blog post!

A WebAssembly interpreter (Part 1)
โ†’ wasmgroundup.com/blog/wasm-vm...

We build up a simple interpreter from scratch, in JavaScript, for a small subset of Wasm instructions (arithmetic and comparison).
A WebAssembly interpreter (Part 1)
Implementing a Wasm Interpreter to explore its design and semantics
wasmgroundup.com
November 20, 2025 at 2:02 PM
Interesting, thanks! Apparently it comes from Modula-3.
November 20, 2025 at 5:20 AM
TIL: Branded types in TypeScript
โ†’ github.com/pdubroy/til/...
November 19, 2025 at 7:40 PM
"Some compiler-development experiences are long slogs where you write code for months without ever having a thing that produces an actual executable that you can run."

"My First Fifteen Compilers" by Lindsey Kuper
blog.sigplan.org/2019/07/09/m...
November 18, 2025 at 12:34 PM
A new blog post โ€”

devlog: garbage collection is useful
โ†’ dubroy.com/blog/garbage...

Trying something new: quick, technical posts about things I'm working on. Let's see if it sticks.
November 14, 2025 at 4:14 PM
(Just noticed that the Kotlin doc shows assigning into a temp var, yeah I don't use it that way.)
November 14, 2025 at 10:29 AM
Sure, I use assertions as well (depends on the situation). But I find checkNotNull very handy for stuff like this:

const newCount = checkNotNull(refCounts.get(node)) - 1;

I generally wouldn't assign the result into a new var, I agree that an assertion or type predicate is preferable then.
November 14, 2025 at 9:13 AM
In basically every TypeScript codebase I touch, I end up adding a `checkNotNull` function exactly like the one from the Kotlin stdlib.

So useful! Surprisingly I haven't seen many TS resources which mention this specific pattern.
November 14, 2025 at 8:05 AM
Yeah, I'm not sure either. I think the argument is that due to the conversion rules in C++, you aren't (effectively) making the invalid states unrepresentable.

So I buy the argument for C++, but it's less clear to me that it makes sense for languages like Mojo or Odin.
November 12, 2025 at 4:13 PM
Bjarne Stroustrup: "Subscripts and sizes should be signed" open-std.org/jtc1/sc22/wg...
November 12, 2025 at 5:35 AM
Thanks for writing/sharing this! Definitely interesting, and you're writing is always a pleasure to read.
November 11, 2025 at 5:39 PM
This seems like such a tiny thing but I always thought using unsigned ints for sizes was the "correct" thing to do, so I do it even though it's generally a little annoying (b/c casts, fretting about whether temp vars should be unsigned or signed, etc.)
November 11, 2025 at 3:52 PM
Somewhat surprising (to me) advice in Google's C++ style guide:

"Try to avoid unsigned types (except for representing bitfields or modular arithmetic). Do not use an unsigned type merely to assert that a variable is non-negative."

Example of a possible bug: abseil.io/tips/227

(via @wingolog.org)
November 11, 2025 at 3:45 PM
A cool paper from OOPSLA '25 โ€”

An Empirical Evaluation of Property-Based Testing in Python
โ†’ dl.acm.org/doi/pdf/10.1...

Some interesting findings:
- "Each property-based test finds about 50x as many mutations as the average unit test"
- "76% of mutations were found within the first 20 inputs"
November 8, 2025 at 7:31 PM
Reposted by Patrick Dubroy
Ever thought about writing #WebAssembly by hand? ๐Ÿค”

Authors Patrick @dubroy.com and @marianoguerra.org think it's crucial for learning. They join #WasmAssembly host Thomas Steiner to discuss their ebook, "WebAssembly from the Ground Up" โ†’ goo.gle/3Ln67Pp
November 4, 2025 at 9:00 PM
Did you know that Microsoft MakeCode (a Scratch-like coding environment) supports a variant of TypeScript called "Static TypeScript"?

github.com/microsoft/px...

Also described in a 2019 MPLR paper: www.microsoft.com/en-us/resear...
October 31, 2025 at 8:58 AM
Reposted by Patrick Dubroy
jumpscared by my own research paper appearing halfway down this blog post
A blog post from last year, which I never posted here โ€”

Bytecode VMs in surprising places
โ†’ dubroy.com/blog/bytecod...
October 29, 2025 at 11:47 PM
Periodic reminder (since I apparently don't talk about it enough) โ€”

If you are interested in a hands-on way to learn #wasm, check out the book that @marianoguerra.org and I wrote together!
Excited to announce the official launch of our online book, WebAssembly from the Ground Up! ๐ŸŽ‰

It's the book we wish we'd had 3 years ago.

No messing with tools and frameworks. It's a hands-on guide to the core of Wasm: the instruction set and module format.

Link below. ๐Ÿ‘‡
October 29, 2025 at 12:29 PM
Oh, cool! Looks like you actually took a very similar approach :-)
October 29, 2025 at 12:05 PM
Working on a diagram for an upcoming @wasmgroundup.com blog post.
October 29, 2025 at 10:24 AM
(Needed a thread here where I can post new examples!)

Dodrio (by Nick Fitzgerald) is an experimental virtual DOM library for Rust and Wasm. It uses bump allocation for the VDOM nodes and uses a stack machine language to represent change lists: github.com/fitzgen/dodrio
October 29, 2025 at 7:25 AM
A blog post from last year, which I never posted here โ€”

Bytecode VMs in surprising places
โ†’ dubroy.com/blog/bytecod...
October 29, 2025 at 7:19 AM
Looking forward to this tomorrow!
This week the W3C WebAssembly Community Group is holding an in-person meeting in Munich.

We (@dubroy.com and @marianoguerra.org) are planning to be there. Patrick tomorrow, and both of us on Thursday for the Research Day.

If you see us, come say hi!
October 27, 2025 at 4:44 PM