Blog
My reflections on programming, what I'm working on in open source, or what I'm learning about at the moment.
Writing an Async Runtime in Rust
Learning async Rust in depth by building a simple runtime from scratchIf you’ve used Rust to build anything for the web (or anything that needs to talk to something else over a network), more than likely you’ve encountered async / await syntax. You’ve probably had to install an async runtime (more than likely tokio ). Most of the time, things like tokio d...
Table-Driven Development
Use table-like datastructures to express your code as data and limit error-prone logic.Have you ever written code that looked like this? enum Foo { first = 'first', second = 'second', third = 'third' } /** * Given some string, determines what kind of "Foo" it is. */ function classifyFoo(value: string): Foo { if (value === 'foo') { return Foo.first } else if (value === 'bar'...
Testing Node.js APIs with Microtest
Microtest 2.0 is a utility library for integration testing Node.js applicationsMicrotest was born from the desire to test my Node.js APIs the same way that they would be consumed by clients: by making real HTTP requests to a real server. I believe that tests are most effective when they most closely resemble the way the software will ultimately be used, and for an API, that ...