HN Hall of Fame Weekly email

Write Your Own Virtual Machine

justinmeiners.github.io Books & learning Tutorials & guides Computer science Candidate
Screenshot of justinmeiners.github.io captured 2026-07-20
Page preview · captured 2026-07-20

Resurfaced independently across 3 calendar years, with breakout response in 2 of them.

submissions
3
submitters
3
observed span
2018–2021
peak thread · 77 comments
546 pts
latest 20+ return · 2020-08-15
326 pts

Submission timeline

2007–2026

One slot for every year since HN launched. Height is that year's peak points; orange marks a 100+ point or 50+ comment breakout. Select a bar to open its strongest thread.

First comments on top threads

HN comment order

One of my favorite techniques for implementing VMs is the "computed goto": https://eli.thegreenplace.net/2012/07/12/computed-goto-for-e... Consider this example for dispatching instructions from the article: while (running) { uint16_t op = mem_read(reg[R_PC]++) >> 12; switch (op) { case OP_ADD: {ADD, 6} break; case OP_AND: {AND, 7} break; case OP_NOT: {NOT, 7} break; case OP_BR: {BR, 7} break; ... } } That code has a lot of branching. The switch statement has to jump to the corresponding case, the break statement…

I was tricked into writing a VM while doing Advent of Code last year and it really deepened my understanding of programming (e.g., on how to implement simple coroutines). Advent of Code is supposed to be 25 daily programming puzzles leading up to christmas. I went in thinking they were going to be algo/datastructure tasks but half of them were actually about implementing and using a VM for a made up assembly language! The difficulty ramp was gradual enough that…

ghj·326-point thread·

The first top-level comment from each of the four biggest threads, in HN’s own order. Excerpts are shortened; open a comment for full context.

Breakout years
2

100+ points or 50+ comments

Total points
880

reference only — not used in Hall rules or ranking

Total comments
119

reference only — not used in Hall rules or ranking

Every submission

DateTitle as submittedByPointsComments
2018-12-14Write Your Own Virtual MachineFirst breakout · Best threadvedosity54677
2020-08-15Write Your Own Virtual MachineLatest 20+ point returnChankeyPathak32642
2021-12-09Write Your Own Virtual Machinesigna1180