This week I reached a milestone in my most useless side project so far. I finished writing a tic-tac-toe game in Lean 4, along with proofs to guarantee that the game behaves correctly! It “only” took me 20 hours, 1000 lines of code and endless suffering… Totally worth it, as you might expect. Chances are you haven’t heard about Lean before, so I’ll share more details below. But first, let’s have an overview of this article’s contents, since it ended up quite long:| Adolfo Ochagavía
Since I got into programming, I’ve regularly seen operating-systems tutorials and implementation guides pass by. They always leave a lingering desire behind them, an echo of the well-known siren song: “when are you going to create your toy operating system?” Inevitably, time passes and the desire fades, till the next tutorial shows up and the cycle repeats. Today I’m breaking the cycle. I’m setting a challenge for myself, and I’m publishing it for the sake of the many curious soul...| Adolfo Ochagavía
Here’s a problem you might be familiar with: I keep forgetting what AEAD exactly means and why you would ever use it. Yes, I know the acronym stands for “Authenticated Encryption with Associated Data”, but does that really clarify anything? Not to me, so I’ve finally decided to sit down and write this blog post as a piece of help for my future self… and for anyone else who finds AEAD hard to retain.| Adolfo Ochagavía
At last, here’s the final installment of the JIT calculator saga! In previous blog posts, I presented the JIT calculator challenge and followed up with my own solution. Today we’ll get to look back on the submissions sent by some readers who were nerd-sniped into cracking the puzzle. As you can imagine, people are creative and came up with things I didn’t expect, like using Cranelift to generate code… That was a pleasant surprise!| Adolfo Ochagavía
It’s time to present the solution to the JIT calculator challenge! If you missed it, here’s the original post in which I introduced it. It was a nice excuse to finally learn more about JIT compilation! I wasn’t alone in this, many people were nerd-sniped into implementing their own solutions and sent me their submissions. Thanks for participating! I’ll discuss them in a third blog post, to keep this one from becoming too long.| Adolfo Ochagavía
Advent of code has come and passed, what should I do now with so much free time? Fear not! The JIT calculator challenge is here. 1. The challenge Back when Rust was in its infancy, the official website featured an example program to showcase the language’s syntax. It was a toy calculator, implemented as an interpreter in 20 lines of code. Why talk about website archaeology, though? We are not here for nostalgia’s sake, are we?| Adolfo Ochagavía
Have you heard about Bell Labs? Recently, an article about it reached the Hacker News frontpage, triggering a flood of nostalgic comments. Bell Labs is, for many, a symbol of the ideal working environment for a curious mind: a place where there’s time, money and freedom to research whatever you want. In my own case, having a curious mind drew me from a young age towards computers and lured me into the world of programming.| Home on Adolfo Ochagavía
Have you come across the fancy async / await syntax of some programming languages? Not everyone has jumped onto the bandwagon1, but many popular languages out there support the feature (e.g. Python, Typescript, C#, and obviously Rust). How does it work under the hood, though? What kind of magic is your software doing when you await an asynchronous function? There’s lots to learn about the topic, so what would you say to enlightening ourselves through an unusual experiment?| Adolfo Ochagavía
One of my friends, an outstanding programmer who likes to fly under the radar, frequently tells me he admires my “ability to broadcast”. I guess he refers to the fact that I’m keeping a blog, and that I’m not afraid of writing with transparency about my adventures in software engineering. To me, it all feels natural, so his comment motivated me to explain in more detail why I’m doing what I’m doing.| Adolfo Ochagavía
For the last four months I’ve been developing a custom container image builder, collaborating with Outerbounds1. The technical details of the builder itself might be the topic of a future article, but there’s something surprising I wanted to share already: you can use S3 as a container registry! You heard it right. All it takes is to expose an S3 bucket through HTTP and to upload the image’s files to specific paths.| Adolfo Ochagavía
Roughly two months ago I posted a fragment of Fred Brooks’ The Mythical Man-Month, which I find particularly inspiring. And guess what… I’m not the only one who feels touched by that passage! Upon reading it, a friend sent me the following message, which I include here with his permission: WOWWWWWW, THIS IS BEAUTIFUL. It’s exactly what I felt last weeks but could not put into words!1 Motivated by his reaction, I thought about other texts I’ve come across that inspire me as a program...| Adolfo Ochagavía
Breaking news! Here’s a blog post about async Rust, and it’s not a philosophical debate1! Today we’re going down the rabbit hole of download accelerators, though of course that’s just an excuse to explore a living async Rust program. After all, I spent last 12 months writing quite some async code, so I thought I’d give back and share a taste of its exotic flavor. If you have been reluctant to try async because of a negative sentiment on the internet, I hope this post may trigger you...| Adolfo Ochagavía
Today would have been the birthday of one of my computer heroes, Fred Brooks, who passed away a few years ago aged 91. Unfortunately, I didn’t have the luck to meet him in person (living on a different part of the planet definitely didn’t help). Still, I did meet him through his book The Mythical Man-Month, which I read during my student years. Programming lore masters held it as an all-time classic, so my curiosity was kindled… and I was not disappointed!| Adolfo Ochagavía
Hello there! In case you felt inspired by my previous article on The Undercover Generalist, you’ll like to hear I was invited to The Changelog podcast to talk a bit more about it. Thanks to the random person who got my article on The Changelog’s radar in the first place! Below is an embedded player, for those of you who want to listen to it. The Changelog will soon publish the transcript on their website, which you might prefer if podcasts are not your thing (you can ask to be notified wh...| Adolfo Ochagavía
Back when I was pursuing my Computer Science degree, one of the big questions that kept me busy was: what am I going to do after I graduate? I felt like I could work on pretty much anything, thanks to the solid foundations I received at the university and to my real-world experience contributing to Rust. So… what to choose? Lured into full-stack development After reading Never Eat Alone I decided to start meeting people in order to answer my question.| Adolfo Ochagavía
Today marks 10 years since my first pull request to the Rust compiler. Though I’m no open source legend, to me it’s an important date still. As I’ve mentioned in the past, my involvement in Rust was pivotal to my development as a software engineer, so I can’t let this day pass without a mention in my blog! How did it happen that I, a bored student yearning to learn interesting stuff, ended up contributing to Rust?| Adolfo Ochagavía
Dear Internet, I’ve never written to you on this special day before, so I thought I’d give you a surprise this time! After all, we’ve been through a lot together, since our first encounter over a dial-up connection in the early two thousands. I was late to the party, I know, but it’s not my fault to have been born in the early nineties! Some people say you are slowly dying.| Adolfo Ochagavía
Recently I spent two weeks collaborating with Prefix.dev to further develop resolvo, their SAT-based dependency solver. The main goal was to fix a nasty bug, where the solver unexpectedly panicked upon hitting code that was supposed to be unreachable. “That will make for a good war story!”, I thought, so I kept notes of my debugging process to serve as a basis for this article. I was being overly pessimistic, though, thinking it would take days to find the source of the bug… In reality ...| Adolfo Ochagavía
Recently a friend had to set up some cloud infrastructure on Azure. He was trying to create a VPN Gateway through the web UI, but couldn’t find the “Basic” tier (the cheapest on Azure). The only available options started at more than $100 / month! He later stumbled upon this support request (archived), where a Microsoft employee shamelessly explains what’s going on: the Basic SKU is no longer available in Azure portal.| Adolfo Ochagavía
Since starting out as an independent contractor, I’ve always felt a tension between being a generalist software engineer, yet having to market myself as a specialist. I’ve been wanting to write about it for years and even have kept some notes for that purpose. Recently I came across an article by Ben Collins-Sussman, which gave me the last bit of inspiration I needed, even though his article only indirectly touches on the topic.| Adolfo Ochagavía
This is a story of how a random person on the internet set me thinking and eventually triggered a change to this blog. It started last September, when someone suggested offering email subscriptions in addition to the existing RSS feed. The thing is… I was purposefully not offering email subscriptions! What a waste, someone might say: you had multiple articles reach the Hacker News frontpage in 2023, yet you failed to “capitalize” on the opportunity to “grow” your email subscriber base.| Adolfo Ochagavía
Last December, I completed a half-year project to develop a continuous benchmarking system for the popular rustls library. My work was financed by ISRG, the makers of Let’s Encrypt, who are interested in rustls as a memory safe alternative to OpenSSL. The thing is, replacing OpenSSL is only realistic if you offer at least on-par performance. But how do you achieve that? What do you measure to ensure performance keeps improving and to avoid regressions?| Adolfo Ochagavía
A few months back I had an email exchange with Drew Capener, from filtra.io, who is interviewing professionals involved in the Rust community. We ended up having a nice chat, which he transcribed and posted online under the title “Contributing to Rust as a novice”. It even triggered some discussion on Hacker News! What did we talk about? The adventure of contributing to Rust in 2014 as a beginner to programming, the crucial role of friendly maintainers, and the challenges involved in work...| Adolfo Ochagavía
This week I finished my contract for Seamly1, where I spent 7 months developing a SaaS messaging platform for customer service in Elixir. The project was incredibly interesting, so in our last conversation I asked if they would mind me sharing a “war story” with the world. They gladly agreed, so here goes an account of my dealings with unicode, performance tuning and Rust-based NIFs. Enjoy! 1 - The problem From a pure technical point of view, we needed a way to split strings in chunks up ...| Adolfo Ochagavía
How many roads must a programmer walk down before you call them a contractor? It’s been about three years since I went down this (bumpy) path, and I finally have the feeling that my contracting business is “bootstrapped”1. Here’s an account of my journey so far, hoping you find it inspiring! 0. Contents Articles about contracting and freelancing usually take the form of abstract advice: how to find clients, how much you should charge, etc.| Adolfo Ochagavía
Dependency resolution is something programmers usually take for granted. Be it cargo, npm, or whatever package manager you use, no one is actually surprised when this black-box figures out, all by itself, the specific set of packages that should be installed. To me, though, it is a fascinating feat. It feels magical when a machine solves an abstract problem like that, with minimal input from me as a user! I was, therefore, delighted when the nice folks at Prefix.| Adolfo Ochagavía
Regular readers of my blog1 know I have been planning to write on my recent contract contributing to Quinn, the popular Rust implementation of the QUIC protocol. I originally intended to write a deep-dive into the QUIC features I implemented, but the blog post took a life of its own and ended up as a short essay on being paid to learn. Enjoy! Taking on the project When Stormshield2 reached out to me with a proposal to work on Quinn, I felt honoured that they were considering me for the task, ...| Adolfo Ochagavía
Yesterday I had the fortune to attend the RustNL conference in Amsterdam. It was incredibly energizing and reminded me of my fascination for the language, when I started contributing back in 2014. On the train back home this post was born, as a way to put this fascination into words. About the title If you are one of today’s lucky 10000 who haven’t heard of the meme before, it seems to have originated when the iPhone 4 was released with antenna problems.| Adolfo Ochagavía
For the last two months I have been on a contract to enhance Quinn, the popular Rust implementation of the QUIC protocol. I hope to write one or two articles about my work at a later moment1, but today I want to offer you a partial (and runnable!) introduction to QUIC by implementing the hangman game over the network. You can find the code here. A tiny bit of context If you have never heard of QUIC before, you can think of it as an alternative to TCP with better performance on at least two fr...| Adolfo Ochagavía
Since my time at the university, pursuing a Computer Science degree, I have always been fascinated by programming languages and the tooling around them: compilers, IDEs, package managers, etc. Eventually, that got me involved as a hobbyist in the development of the Rust compiler and rust-analyzer, but I never got the chance to work professionally on programming language tooling… until two months ago! In January, the nice folks at prefix.dev asked me to help them develop the rattler package ...| Adolfo Ochagavía
Last month I have been developing a Rust tool to create container images from Conda environments, without going through Docker. It was a wild trip down the rabbit hole of OCI images, so I thought I’d share part of the adventure here. Enjoy! But why? If you are used to building container images, you might be asking yourself why on earth someone would want to deviate from the well-trodden path of Dockerfiles.| Adolfo Ochagavía
In December 2021, a company from San Francisco asked me to port a Rust library to Java. The task seemed simple, but it ended up requiring a from-scratch implementation of the MySQL protocol and even fixing a bug in the main Rust MySQL client! Below follows an account of the adventure. The task Originally, the idea was to port the msql-srv library from Rust to Java. For context, msql-srv makes it possible to create a fake MySQL/MariaDB server, which accepts MySQL connections and handles them w...| Adolfo Ochagavía
In 2013 I started my Computer Science degree at Utrecht University (The Netherlands). Due to my previous experience with programming, and because I was genuinely interested in the course subjects, I aced my first year and even had time to investigate additional topics I found interesting. When my friend Jouke Waleson told me about the existence of Hacker News, I quickly became a daily visitor, as it seemed to me like an endless source of programming knowledge.| Adolfo Ochagavía
When I try to recall what first triggered my interest in computers, there are many anecdotes that come to my mind. Back when I was 13 years old, a classmate showed me how to create visual programs using Word and its built-in visual editor for VBA. Though I never actually wrote any serious VBA program, the fact that you could give the computer instructions and receive visual feedback was an intriguing discovery.| Adolfo Ochagavía
A while ago, a friend presented me an optimization problem that he stumbled upon in his day job. The problem seemed interesting, so I considered writing a program to solve it, though after a while I decided to let the occassion pass. The thing is, I don’t know that much about optimization and I had no idea about where to start! Besides, I had tried solvers for linear programming in the past, but the lack of documentation and difficulties to get them working on Windows were really off-putting.| Adolfo Ochagavía
Two weeks ago, Alex Crichton’s PR adding a target for WebAssembly to the Rust compiler was merged. There are many differences between this target and the Emscripten one, but the important one for me is that it doesn’t depend on external stuff like the Emscripten SDK (which IIRC used to be a pain to get working on Windows, but seems to be better now). After seeing the examples on hellorust.com, I thought it would be interesting to try to adapt my game Rocket to work on the browser through ...| Adolfo Ochagavía
If you have been following my previous posts on Rust’s drop order, you may want to know how it all ended. In january, I summarized my research in an RFC and submitted it for consideration of the Rust community. Today, after six months of discussion (with around 80 replies), it has been finally accepted as RFC 1857! Besides reading the RFC itself, you may want to check my previous posts to see the reasoning that led to it:| Adolfo Ochagavía
There seems to be a wide consensus that the current (unspecified) drop order in Rust is weird and arbitrary. If you are not yet convinced, you should definitely take a look at a previous post exploring the current rules. While changing the drop order seems attractive, there are many aspects that need to be considered before embarking in such a quest. In this post I would like to expand on the consequences of changing the drop order.| Adolfo Ochagavía
After my previous post, I thought it would be interesting to run some experiments to determine the unspecified drop order within different constructs of Rust. After you read this, I guarantee you will understand why there is so much discussion about changing the current drop order before stabilizing it :) TLDR: the current drop order is really weird! In this post we are going to look at: Local variables Tuples Structs and enums Slices Closure captures We will be reusing the PrintDrop struct, ...| Adolfo Ochagavía
Some days ago I stumbled upon an old issue on Rust’s GitHub repository. While the title of the issue is “should struct fields and array elements be dropped in reverse declaration order (a la C++)”, the discussion also extends to whether the current drop order should be stabilized. Surprising as it may seem, drop order in Rust is unspecified and could theoretically be changed in the future. However, there are use cases that require enforcing a given drop order (see, for instance, this SO...| Adolfo Ochagavía
Note: this blog post was not written by me. It was posted as a comment on r/rust by user matthieum, and was so well received that I thought it deserved to reach a broader audience. He gave me permission to repost it here. Everything below this paragraph has been taken verbatim from there. — Disclaimer: I love logging. I’ve implemented no less than 4 complete logging systems at various companies in the last 16 years, two of which were low-latency.| Adolfo Ochagavía