Skip to content

Adam Chalmers

Video: Error handling

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 next episode we used a better-quality recording system.

Video: Analyzing performance

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 Zoom's "record screen" feature. Starting from episode 5 we used a better-quality recording system.

Investigating crazy compile times

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.

Video: Parsing a programming language

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 this to YouTube, so it's just using Zoom's "record screen" feature. Starting from episode 5 we used a better-quality recording system.

Video: Parsing text with Winnow

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 Nom. I'm a big fan of Nom, and I've written about it a lot. I've been interested in Winnow since it was announced, so here's an hour-long explanation of how to use Winnow.

Apologies for the low video quality, I didn't know we'd be releasing this to YouTube, so it's just using Zoom's "record screen" feature. Future episodes should have higher video quality!

Rustconf 2023 recap

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.

Missed opportunities for git aliases

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 notice which peers use vim for everything, and pick up on all their awesome little keybindings to jump around the document. Or you realize that one peer has installed a bunch of awesome VSCode extensions that you can steal.

Several coworkers have remarked that I use shell aliases way more often than them! For example, I mostly work with rust, so I used alias c="cargo" to tell my shell "when I type c, replace it with cargo". Then I use Cargo's built-in aliases, e.g. cargo check and cargo c are equivalent. So, when I want to run cargo check I just type c c and my shell expands it to cargo c and Cargo expands it to cargo check. My coworkers were very amused by this! I think a suite of nice, easy aliases can really save you time and avoid interrupting your flow state. I'm trying to use more aliases for common tasks, and here's how I've been doing it.

Introduction to HTTP Multipart

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 to explain how it works, at a high level, so you'll recognize when you could use it to save time and memory in your HTTP servers/clients.