Last year I read a lot of Chinese history. I didn't expect to find it so interesting! China's history has now become a passion of mine. I want to tell you how I fell down this rabbithole, and why I stayed.
It's been a good year. We moved back to Austin from New Orleans, I've watched my first kid grow and develop and really start having a personality, and I've had a lot of fun at work.
This weekend I turned 34. When friends or family have birthdays, I like to ask them what they're excited for in the coming year. Today someone flipped the question on me, and this is what I answered.
Better late than never! It's been a really big year. My wife and I had our first baby, we moved to New Orleans (temporarily), I gave my first in-person conference presentation (at RustConf) then flew to Vienna for my second (EuroRust). And Zoo has grown massively. So it's been a fun but crazy year.
A few months ago I was invited to EuroRust to talk about API servers and clients. When I worked at Cloudflare, I maintained a few API servers and the official Cloudflare Rust API client. There was a lot of toil and stress involved whenever the API servers changed: schemae had to be updated, and then so did clients. When I joined Zoo I was very impressed to find that our CEO Jess Frazelle had…
Recently I gave my first-ever in-person conference presentation! I was invited to RustConf 2024 where I talked about why we're building KCL (KittyCAD language), a programming language for 3D design, at Zoo.dev. The talk has three parts: background about computer-aided design (CAD) software and mechanical engineering, then why we built a programming language, then what I learned from the…
Kris Jenkins of Developer Voices spoke to me on his podcast! We talked about KittyCAD and its language, which I'm building for my work at Zoo . You can listen to it wherever you get your podcasts, or watch it on YouTube. Thanks so much for having me on your podcast, Kris! Developer Voices has become my favourite tech podcast and I really love the range of people he talks to. Kris goes deep…
I'll be at RustConf 2024, speaking about KCL, the 3D manufacturing language we're building at Zoo.dev ! I'm really excited to present, and to meet a lot of other Rustaceans. If you're going to be in Montreal, send me a message or email (contact details here ) and let's make sure we say hi.
I've been using Kitty terminal for five years now, and I'm really happy with it. Recently I got curious about how to make it look prettier (inspired by all the beautiful terminals I see in some programmer subreddits). So, keep reading for a little explanation of my Kitty config file. I also made a video showing how I configure a totally fresh Kitty terminal from nothing. But if you…
My work at Zoo has recently focused on KCL , our CAD programming language. Currently our modeling app uses a tree-walk interpreter, but for various reasons we've been exploring a proper compiler instead. I've been developing the compiler, called Grackle . It compiles to a bytecode VM (i.e. an abstract machine), called the KCVM. I gave a 10-minute presentation about KCVM and its…
Cloudflare has a really generous free tier, and it gets a lot of free users. I often see comments on Hacker News saying "Cloudflare must be doing something shady, so many people use it for free, and if you're not the customer, then you're the product". This is mostly wrong -- Cloudflare gets a lot of value from its free users, in normal, not-shady ways. Here's why it's helpful…
The fourth Rust Club video is up! Every Monday I teach Rust to my coworkers at zoo.dev on video chat. We record the call and put it on YouTube so you can learn too. This week's video is about different ways to handle errors in Rust -- when should you panic and when should you return a Result::Err? And what type should that Result::Err be? Apologies for the low video quality, starting from…
KittyCAD 's third Rust Club video is up! We analyze how fast the demo parser from my [first video][/winnow-basics] is, and find ways to speed it up. We use benchmarks to measure its speed, and flamegraphs to visualize its runtime, to find places we can improve. Apologies for the low video quality, I didn't know we'd be releasing this to YouTube, so it's just using…
I hate long compiles. I spend hours of my time trying to reduce minutes of compile-time. I recently noticed that the KittyCAD Rust API client was taking an incredibly long time to compile in release mode. Weirdly, the compile time in debug mode was totally fine. I managed to shrink the release compile-times from 33 minutes to 1.5 minutes. Here's how.
KittyCAD 's second Rust Club video is up! My [first video][/winnow-basics] covered the Winnow library for parsing text. Today's video shows you a real-world parser example. I'm working on the KittyCAD language (KCL) for designing CAD models, and this reviews the tokenizer and parser I wrote recently. Apologies for the low video quality, I didn't know we'd be releasing…
I had a great time talking to Drew of filtra.io ! We talked what KittyCAD does and why we're all-in on Rust. We also get into my past at Cloudflare and why there's so much Rust there. Check out the piece here .
I had a great time presenting at P99Conf ! I watch their talks every year and I always learn a lot. I was really thrilled to present a talk at this year's conference. It's heavily based on my blog post Why use Rust on the backend? . If you missed the talk, you can watch the recording or view the slides here .
I work at KittyCAD , and every Monday I teach Rust to my coworkers for an hour. We always record them, so that over time we build up an archive of Rust learning videos. Recently I realized we should put some of them on the internet, because other programmers outside KittyCAD might find them helpful too! This is our first episode, and it's about building parsers with Winnow , a new fork of…
I got back from Rustconf 2023 last week, and I had a great time! I thought I'd write up my impressions of the conference, for anyone curious about what it's actually like.
I don't pair program very often, but sometimes when you're stuck on a really annoying problem, it can be helpful to have a coworker looking over your shoulder. My new job is fully-remote, so we occasionally screenshare when someone's stuck. One of my favourite things about pair programming is that I get to see the little idiosyncrasies of everyone's workflow. For example, you…
Multipart, or "form-encoded data", is something I see everywhere but never had to actually understand or use myself, because HTTP libraries handled it for me. Recently, though, I had to dive deeper into how multipart works, because it's pretty important at both Cloudflare and my new job at KittyCAD. Used correctly, multipart makes your file uploads faster and use less memory. I'm going…
I read and liked Andrew Israel's I love building a startup in Rust. I wouldn't pick it again. It makes a lot of sense! He basically says that his startup prioritizes developer productivity over performance. Sensible choice for a start-up founder to make. If Rust is going to slow your developers down, and you don't need its benefits, then you should definitely consider using a…
Hi all! Allen Wyma of Rustacean Station had me on the podcast to talk about Rust at Cloudflare. We cover why and how Cloudflare started using Rust, how my team specifically works with Rust, and how Cloudflare works. We also go on a big tangent about social security numbers. Give the episode a listen if you'd like.
Say you're running a long-lived program, like a server. Let's say the server needs to read some files from disk, like certificates or keys. Every so often, the certificates change, so your server has to reload them. How do you tell the server to reload those files? The traditional way is to use Unix signals. Your server listens for a particular signal, like SIGUSR1 (user-defined signal…
In case you didn't hear, comedy is now legal on Twitter but accounts engaged in parody must include “parody” in their name, not just in bio . Of course, this only made everyone double down . So yesterday, I changed my name to Rust Language and started posting misinformation. The last week on twitter has basically been "the new 3rd grade substitute teacher can't control the class" and…
I first learned Kubernetes ("k8s" for short) in 2018, when my manager sat me down and said "Cloudflare is migrating to Kubernetes, and you're handling our team's migration." This was slightly terrifying to me, because I was a good programmer and a mediocre engineer. I knew how to write code, but I didn't know how to deploy it, or monitor it in production. My computer science degree…
Last week in Tokio's Discord chat server someone asked a really interesting question: how can you stream a multipart body from an incoming request into an outgoing request? My struggle to answer this really helped me understand Rust async lifetimes. We'll explore why this is tricky, then design and benchmark a solution.
I learned about extensions when reading the hyper docs . But they also pop up in lots of other Rust web libraries, like http , tonic , and actix-web . So they must be really useful, if so many libraries offer them. But I personally had no idea what they were or how to use them. Today I'm going to explain what extensions really are (a set of values, keyed by type), and how you can use them to…
Over the last few weeks I built my own DNS client . Mostly because I thought dig (the standard DNS client) was kinda clunky. Partly because I wanted to learn more about DNS. So here's how I built it, and how you can build your own too. It's a great weekend project, and I learned a lot from finishing it.
In the last blog post, we learned how to parse binary, bit-by-bit with Nom. I really wanted to give a real-world example of binary protocols, so here's one from Dingo , a basic DNS client I made.
Programming languages generally only manipulate bytes (groups of 8 bits). It can be pretty tricky to manipulate single bits. But sometimes you need to -- for example, a DNS header has some 4-bit numbers, and encodes some boolean flags into single bits. So we really need a way to parse binary data without chunking it up into bytes of 8 bits. Luckily, Nom can do this! In the last blog post, we…
"Parsing" is turning a stream of raw text or binary into some structured data types, i.e. a Rust type that your code can understand and use. This isn't the textbook definition of parsing, but damnit, this is my blog and my opinion. This tutorial is about nom , my favourite Rust parsing library. It uses a parser combinator approach: you start writing tiny parsers that match, say, a single…
Using async Rust libraries is usually easy. It's just like using normal Rust code, with a little async or .await here and there. But writing your own async libraries can be hard. The first time I tried this, I got really confused by arcane, esoteric syntax like T: ?Unpin and Pin<&mut Self> . I had never seen these types before, and I didn't understand what they were doing. Now that I…
In part one , we defined a Grid trait and implemented it using 1D and 2D vectors. Benchmarks revealed that a 1D vector was a better choice than a nested 2D vector. In this post, we'll write a new implementation that uses arrays instead of Vec. This should be faster!
While making a raytracer in Rust , I needed an efficient way to store the pixels of a 2D image. In this post, we'll compare two different implementations of a 2D grid datatype, dipping our toes into data parallelism with Rayon and benchmarking with Criterion.