software engineer @vercel • I write about performance, compilers, puzzles, &more on my website • @recursecenter alum

Joined January 2019
168 Photos and videos
Pinned Tweet
I wrote a very fast disk usage program for macOS most of the popular disk usage CLIs aren't using getattrlistbulk to reduce the number of syscalls required to scan directories (it's free real estate)
4
5
64
5,401
quickjs is GOATed delightful API surface I was able to hack together a tiny runtime and event loop v quickly with it
1
1
23
1,618
I built a tiny shell with C so I could learn more about syscalls and pipes great fun I found C to be quite suited for the task (fork, execvp) ... until I had to manage some string lifetime stuff 🥲
2
4
47
3,733
glad y'all like this one 🫡
18
795
I suggested to my friend that writing a semaphore is fairly trivial but when I sat down to write one I was pretty humbled the edge cases around context cancellation are no joke more notes and my solution below down there ⇣
1
6
253
2
184
I built a solver for NYT's daily Pips puzzle I started with a brute-force search and optimized it to be 16× more efficient (by the number of nodes that need to be checked)
2
6
939
I also made a search-tree view that I used to debug the solver and get a feel for how it behaved with different optimizations
1
3
208
I made a Forth compiler and VM with some visualizations for the tokenization->bytecode->VM steps here's the VM running (it's calculating the 10th Fib. sequence)
1
5
225
and here's tokens -> bytecode
1
165
playing around with an idea for an article called 'the algorithms behind minecraft' probably with everything in 2d I've just got terrain generation working in a canvas
2
12
554
added stone, and ore veins (based on seed, and placed via biased random walk) added torches/BFS lighting (attenuates by 1 per cell, blocked by stone/ore) I'm cheating a bit with the lighting because there's just a dark overlay that is reduced by the lighting effect
1
3
331
added sheep! they spawn when a chunk is created and then randomly walk around, avoiding obstacles (added very rudimentary 'entity system') added torch flicker (sine wave whose phase is derived from cell coords, scales with light level so cells nearer a torch flicker a bit more)
3
200
I made a small 2d programming language called icepath I wanted the same vibe as the ice puzzles in the johto caves in pokemon gold and silver 🧊 sliding around a cave and hitting opcodes
4
3
21
2,057
wrote the same word-counting program 5 times, each faster than the last best result: 494× faster than my first Python version — by using SIMD in C all are O(n), but some squeeze far more from the CPU and memory!
13
45
515
45,959