Happy New Year!
In the blink of an eye, 2020 is nearly one-twelfth gone. Has your New Year plan also advanced one-twelfth of the way? The past month has left a knot in my chest: one assault on a doctor after another — outrageous; and then the outbreak in Wuhan, worsening by the day — gut-wrenching. Many of my friends in Beijing can’t go home for the holiday and can only send distant wishes to their families; my friends in Wuhan, by contrast, are philosophical — at last they get some peace and quiet, no visiting relatives, no social calls, just a happy, homebound slob. Talking it over with friends, we all agree: more terrifying than the epidemic itself is the collapse of the human heart.
I’m reminded of a time I drove my father to the airport and later learned his flight was delayed by half a day. I was frantic on WeChat, while he was strolling the terminal racking up steps, telling the family: “Haven’t exercised in ages — perfect chance to get some exercise.” If I remember right, he walked over twenty thousand steps that day. Often the information itself doesn’t matter; what matters is how we interpret it. This epidemic will hit every person, every company (especially startups still struggling on the edge of survival), and every industry differently. Rather than agonize, we might ask: things being as they are, how do we steer the impact in a good direction? Or: what is the worst-case scenario? If we can’t reverse the situation, how do we make the outcome better than the worst case?
Alright. Enough small talk. Today’s post, besides wishing you a Happy New Year, also tries to help sort out a Spring Festival problem we run into every single year: how do I spend this long holiday so that I don’t regret it later?
On Reading
My first grand recommendation is Euclid’s Elements on WeRead (WeChat Reading). I’ve been at it for a while now; during the long waits of travis builds, it has kept me company through those nearly frozen stretches of time. I started reading the Elements purely to keep up with the increasingly demanding task of teaching my kid geometry; to my surprise, I read my way into it. The edifice of classical geometry, raised axiom by axiom under Euclid’s elegant pen, is truly breathtaking (why did I never feel this in middle-school math? Back then geometry seemed utterly dull — just memorizing theorems and proving theorems). These days many people invoke “first principles” as if they’ve found a treasure, never realizing that the essence of first principles is embodied, in full, in the Elements.
Why read the Elements on WeRead? Because a tome like the Elements is exactly the sort of thing you flip through in scattered moments to rest your brain: each proposition is its own section, two or three minutes to read, a few to a dozen minutes to prove — just about the length of one travis build. Open the WeRead public account in the WeChat Mac client and read it in the browser; couldn’t be more convenient.
The other math book I recommend is Math with Bad Drawings. I don’t know whether there’s a Chinese edition; if there is, do take a look. Readers in the US can borrow it from the library — it’s quite in demand. Late last year I got a copy, read the first two chapters, and when it came due I found someone else had it on hold so I couldn’t renew; I quickly placed a hold myself, and by the time it was back in my hands it was New Year’s Eve. The book goes like this:

One big reason I love it: the questions it raises are all both interesting and challenging. Take the tic-tac-toe game in the opening: every square of the nine-square grid contains another nine-square grid, and each of those is itself a tic-tac-toe game. You have to win the local battles to have a chance at winning the global war; but fixate too much on the local and you’ll lose the whole board.
This book is suited to long stretches of slow reading, with A4 paper close at hand. Many of its problems are brain-burners that demand serious pondering. I’m also studying the author’s approach and technique, hoping to grasp how to make a dry math book compelling.
The last one is the renowned Algorithms to Live By, which I bought a year ago and have been reading on and off, still unfinished. The Chinese translation is called 《算法之美》. The beauty of this book is that it marries computer algorithms to life, guiding us toward better strategies and wiser choices. Everyone knows LRU as the best cache strategy in most cases; and in life, organizing your closet, dealing with the papers on your desk, and the “declutter” practice of tossing what you don’t use — all can use the same strategy.
On Coding
For those who don’t feel like reading, or who’ve already read the books above, spend some time on coding games — level up your character.
Game one: learn Rust.
Game two: build a WebAssembly program in Rust.
Are those two “games” too lacking in goal-orientation to drive real, effective learning? Then try these:
Game one: implement base32 and base58 encoding in Rust. Compare their performance. Hint: base32 forward encoding can use a lookup table — can you design the reverse encoding with a lookup table too?
Game two: in Rust, derive a root CA key from a user passphrase, generate the root CA, then derive a server key and have the root CA sign the server’s certificate. The whole process leaves no trace of any key on disk. Benchmark it. Note: libraries you may need include argon2 (password hashing), blake2s / blake3 (HMAC), pkcs8 (key format), yasna (ASN.1), ring (crypto), etc.
Game three: rewrite a gRPC microservice using prost / tonic / tokio.
Why Rust? This thing has, almost by accident, taken Stack Overflow’s “most loved language” title four years running — don’t you want to know why? New year, new clothes: try a new language on for size.
In the coming years of software development, portable binaries (platform-independent, controlled executables) will matter more and more, and WebAssembly appears to be the only direction currently backed with full force by the major vendors. WebAssembly’s use cases go far beyond the web (bringing big games to the browser, say); it is also a new — perhaps superior — solution for server-side virtualization. Solomon Hykes, Docker’s founder and CTO, said:
If WASM+WASI existed in 2008, we wouldn’t have needed to created Docker. That’s how important it is. Webassembly on the server is the future of computing. A standardized system interface was the missing link. Let’s hope WASI is up to the task!
Just look at the level Fastly’s Lucet has taken serverless cold-start times to (for comparison: AWS Lambda typically takes 200ms to start):

(I’ll write more later, when I have time, on the relative merits of Lucet and AWS’s Firecracker.)
As the 5G era arrives, high bandwidth will blur the network boundary: data becomes fluid, and computation follows — sometimes on the client, sometimes on the server. When more and more computation can happen directly on the client, a platform-independent, secure code execution environment becomes crucial — and that is WebAssembly’s opportunity.
And which language has the best WebAssembly support today? Rust. So learning Rust brings at least these benefits:
- A new paradigm. The Master once said: if a programming language doesn’t give you a new paradigm, it isn’t necessarily worth learning — like learning .NET then Java, or Python then Ruby; from the standpoint of expanding your boundaries, there’s little point.
- It compiles to WebAssembly — the future executable that may finally deliver “write once, run anywhere”: in browsers, on IoT devices, on all kinds of servers, on phones.
- A language close to C/C++ in performance, and no less expressive than Ruby / Elixir.
So, while the holiday spares you annoyances like “has your mother nagged you into marriage yet?”, grab your beloved VS Code and go write some code.
On Parenting
This part is for the middle-aged and elderly programmers. Young programmer friends may skip to the end and tap “Wow.”
Last night I got home around nine (my whole day is the 69 shift — six in the morning to nine at night), and the little one dragged me up to the third floor, announcing that she was the chief director of this year’s family Spring Festival gala and that I was to rehearse a dance with her. The dance she assigned me goes like this: first she solos for ages, then she beckons me onstage. I play a lotus flower — the moves are simple enough — left foot slides in front of the right foot and taps, body angled to the front-right, rear end stuck out, hands together then unfurling into lotus-leaf shape and placed under the chin (so my head is the bud?), then the right foot slides in front of the right foot and taps, body angled to the front-right, hands together, unfurl into lotus leaves, place under the chin, repeat. Try it yourself and you’ll see just how flagrantly sassy this move is.
I tried hard to perform it to the director’s standard. Then the director spoke: “Dad, you have to act harder — like a fake lotus trying to get my attention. Then I slowly realize you’re fake, so I make a pushing motion, and you lean forward; when I push hard, you fall down and roll off the stage.”
Oh my. So my fake lotus has to play a real fake lotus… The ending is still good triumphing over evil: I rolled away.
For mid-career and older programmers, the holiday is a rare chance to unwind. After 996-ing your heart and soul out all year, you don’t dare travel the world now; holed up at home, you don’t feel like reading and don’t feel like coding — perfect time to spend with the kids and grow closer. LEGO, storybooks, cartoons together, spinning tops, even Chinese jump rope. Let the taut string slacken a bit — after all, you only have to suffer a week at home, and once you endure it you can happily roll back to the office for some 996-style health regimen.
Right, that’s about it. Do you now have a clear idea how to spend the holiday happily, gracefully, and without regret? Happy Spring Festival to all! Peace and health! We are always together, thinking of one another. Your loving Coder.

A Sage’s Moment
The cricket chirps within the hall; the year is drawing to its end. If I take no joy now, the days and months will pass me by. Yet do not revel to excess; remember the duties of your station. Love pleasure without ruin — thus the good man stays ever watchful.
The cricket chirps within the hall; the year is slipping away. If I take no joy now, the days and months will march on. Yet do not revel to excess; remember your duties beyond the home. Love pleasure without ruin — thus the good man strives unceasingly.
The cricket chirps within the hall; the service carts now rest. If I take no joy now, the days and months will wear away. Yet do not revel to excess; remember the sorrows that may come. Love pleasure without ruin — thus the good man rests easy.
— Book of Songs, Airs of the States