217 results for "":
Thoughts on going down the network stack
So!
I have no shortage of ongoing writing projects - I still need to edit and publish the final parts of making our own executable packer, and I’ve recently announced I was working on a Rust book/series. Those are still both on the table.
Buuut… I’m also looking at other things. My best writing happens when I’m learning about something at the same time I’m writing about it. So for example, the Rust book is a bit harder to write, because I’m mostly trying to distill knowledge I’ve already absorbed (for the most part).
Pin and suffering
I’d like to think that my understanding of “async Rust” has increased over the past year or so. I’m 100% onboard with the basic principle: I would like to handle thousands of concurrent tasks using a handful of threads. That sounds great!
And to become proficient with async Rust, I’ve accepted a lot of things. There are blue functions and red functions, and red (async) functions are contagious.
ktls now under the rustls org
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 itself (hellos, change cipher, encrypted extensions, certificate verification, etc.), you still have to use a userland TLS implementation.
Day 2 (Advent of Code 2022)
Part 1
In the day 2 challenge, we’re playing Rock Papers Scissors.
We’re given a strategy guide like so:
A Y
B X
C Z
Left column is “their move”: A means Rock, B means Paper, C means Scissors. Right column is “our move”: X means Rock, Y means Paper, Z means Scissors.
Each line corresponds to a turn, and we must calculate the total score we get. Picking “Rock” gives 1 point, “Paper” gives 2 points, and “Scissors” gives 3. Losing the round gives 0 points, drawing gives 3, winning it gives 6.
Day 6 (Advent of Code 2022)
Today I am joining you from the relative discomfort of my living room (since my better half has commandeered the home office due to Way Too Many Calls) to tackle the day 6 challenge, which I’m excited about: maybe despite, maybe because of, the low-grade fever I’m under.
Part 1
Our input is a jumble of letters, and we’re supposed to find the position of the first substring that’s “four different characters”.
When rustc explodes
One could say I have a bit of an obsession with build times.
I believe having a “tight feedback loop” is extremely valuable: when I work on a large codebase, I want to be able to make small incremental changes and check very often that things are going as expected.
Especially if I’m working on a project that needs to move quickly: say, the product for an early-stage startup, or a side-project for which I only ever get to do 1-hour work bursts at most.
Trying to use nix
Now that my website is deployed as a container image, I wanted to give
nix a try. I’m still doing it the old-fashioned way right
now: with a Dockerfile
, running cargo
in a “builder” image, copying stuff
out of there into a slimmer image (that still has an Ubuntu base, even though
distroless images are a
thing now).
But why?
I was mostly interested in nix because some parts of my website have pretty big
native dependencies. futile
itself mostly relies on sqlite3 and some JS engine
(used to be quickjs, currently duktape because MSVC Windows builds). But the
asset processing pipeline, salvage
(which I’d like to integrate with futile
at some point) has a bunch more!
Cross-platform game distribution
ooc makes it easy to compile your application on all major platforms (Windows, OSX, Linux) - the compiler itself runs there, and the SDK supports all these platforms with basic functionality: data structures, file handling, time handling, networking, etc.
But between getting your application running on your dev environment with all the libraries installed, and getting it into a neat package for your users to run without having to install any dependencies by hand, there’s a bag of tricks. Fortunately, I have found the time to figure most of them out. I’ll try to explain these in detail here as clearly as possible, here in this article.
rock 0.9.6 is on the loose!
Just 8 days after the last release, rock 0.9.6 is out.
To update, run git pull && make rescue
as usual. To install from scratch,
clone the repo, cd into it, and run make rescue
from there - it’ll download the latest bootstrap, compile itself from
C, then recompile itself from ooc.
Running rock -V
should give you something like this:
rock 0.9.6 codename loki, built on Wed Feb 20 15:09:08 2013
sam, homebrew-mingw, etc.
I want to write blog posts, but right now I have too much to do.
So instead, here are bullet points:
I wrote an ooc tool named sam, which helps you keep your git repos up-to-date, and helps to remind you what to push when switching workstations. It’s pretty neat, and portable.
A while ago, I started working on homebrew for Windows, or rather, for MinGW+MSYS. Provided you have msysgit and Ruby in your PATH, it’ll let you brew install most packages. I’ve tested a few dozen, send in your pull requests anytime.