What's a ktls I started work on ktls and ktls-sys, a pair of crates exposing Kernel TLS offload to Rust, about two years ago. kTLS lets the kernel (and, in turn, any network interface that supports it) take care of encryption, framing, etc., for the entire duration of a TLS connection... as soon as you have a TLS connection. For the handshake...
It’s time for some personal and professional news!TL;DR: I started a podcast with James, I’m stable on antidepressants, I’m giving a P99 CONF about my Rust/io_uring/HTTP work, I’m trying on “they/them” as pronouns, I’m open-sourcing merde_json, rubicon and others, I got a divorce in 2023, I found a new business model.
TL;DR I purchased individual tickets for EuroRust and added my VAT number, so it could be a tax-deductible expense for me as an independent worker. The organizers reached out asking me to buy business tickets instead. I'm asking them to reconsider their policy. ...
I try to avoid doing "meta" / "behind the scenes" stuff, because I usually feel like it has to be "earned". How many YouTube channels are channels about making YouTube videos? Too many.
My family wasn't poor by any stretch of the imagination, but I was raised to avoid spending money whenever possible. I was also taught "it's a poor craftsman that blames their tools", which apparently means "take responsibility for your fuckups", but, to young-me, definitely sounded more like "you don't deserve nice things".
I use the draw.io desktop app to make diagrams for my website. I run it on an actual desktop, like Windows or macOS, but the asset pipeline that converts .drawio files, to .pdf, to .svg, and then to .svg again (but smaller) runs on Linux.
Disclosure: At some point in this article, I discuss The Rust Foundation. I have received a $5000 grant from them in 2023 for making educational articles and videos about Rust. I have NOT signed any non-disclosure, non-disparagement, or any other sort of agreement that would prevent me from saying exactly how I feel about their track record.
(Note: this was originally posted as a gist) Reassuring myself about Rust
We've achieved our goals already with this series: we have a web service written in Rust, built into a Docker image with nix, with a nice dev shell, that we can deploy to fly.io. But there's always room for improvement, and so I wanted to talk about a few things we didn't bother doing in the previous...
There it is. The final installment. Over the course of this series, we've built a very useful Rust web service that shows us colored ASCII art cats, and we've packaged it with docker, and deployed it to https://fly.io.
In the previous chapter, we've made a nix "dev shell" that contained the fly.io command-line utility, "flyctl". That said, that's not how I want us to define a dev shell. Our current solution has issues. I don't like that it has import . Which version of nixpkgs is that? The one you're on? Who knows what that is.
Remember the snapshot we made allll the way back in Part 1? Now's the time to use it. Well, make sure you've committed and pushed all your changes, but when you're ready, let's go back in time to before we installed anything catscii-specific in our VM.
I sold you on some additional functionality for catscii last chapter, and we got caught up in private registry / docker shenanigans, so, now, let's resume web development as promised. Adding geolocation
Wait wait wait, so we're not talking about nix yet? Well, no! The service we have is pretty simple, and I want to complicate things a bit, to show how things would work in both the Dockerfile and the nix scenario.
Disclosure: Because I used to work for fly.io, I still benefit from an employee discount at the time of this writing: I don't have to pay for anything deployed there for now. fly.io is still sponsoring me for developing hring, but this isn't a sponsored post. It's just a good fit for what we're doing here, with a generous free tier.
Now that our service is production-ready, it's time to deploy it somewhere. There's a lot of ways to approach this: what we are going to do, though, is build a docker image. Or, I should say, an OCI image.
Our catscii program does everything we want it to do, except that it's a command-line application rather than a web server. Let's fix that. Enter axum
Now that our development environment is all set up, let's make something useful! Creating the catscii crate
With the previous part's VM still running, let's try connecting to our machine over SSH. Network addresses, loopback and IP nets
The first step to using Nix to build Rust is to do so without Nix, so that when we finally do, we can feel the difference. There's many ways to go about this: everyone has their favorite code editor, base Linux distribution (there's even a NixOS distribution, which I won't cover). Some folks like to develop on macOS first, and then build for Linux.
Some bugs are merely fun. Others are simply delicious! Today's pick is the latter. Reproducing the issue, part 1
This time around, we're porting a solution from C++ to Rust and seeing how it feels, how it performs, and what we can learn about both languages by doing that. See Day 17 for the rationale re: porting solutions rather than writing my own from scratch. TL;DR is: it's better than nothing, and we can still focus about learning Rust rather than...
So you want to do live streams. Are you sure? Okay. Let's talk about it. Let's talk numbers
Advent of Code gets harder and harder, and I'm not getting any smarter. Or any more free time. So, in order to close out this series anyway, I'm going to try and port other people's solutions from "language X" to Rust. That way, they already figured out the hard stuff, and we can just focus on the Rust bits!
Let's tackle the day 16 puzzle! Parsing The input looks like this: Valve AA has flow rate=0; tunnels lead to valves DD, II, BB Valve BB has flow rate=13; tunnels lead to valves CC, AA...
The day 15 puzzle falls into the "math puzzle" territory more than "let's learn something new about Rust", but since several folks asked if I was going to continue... let's continue.
I like how the day 14 puzzle sounds, because I think it'll give me an opportunity to show off yet another way to have Rust embedded in a web page. But first... Let me guess: parsing?