A practical introduction to kill-safe, concurrent programming in Racket


I’ve written a long tutorial exploring the user of Racket’s Concurrent ML (CML) inspired concurrency paradigm to write an API wrapping git-cat-file. It is meant to serve as an introduction to kill-safety and CML concurrency, while assuming some existing knowledge of Racket or other Schemes. I found that there weren’t a lot of resources beyond the reference documentation that explained how to put these APIs together, and I hope this can fill that hole.…
Read more ⟶

Racket Beyond Languages


Chris Krycho, a person I really respect, is learning Racket to build programming languages. Racket is generally slotted as a language to build languages. The popular books focus on Racket innovations related to constructing Domain Specific Languages. This include hygienic macros, the Racket loading and evaluation phases and the module system. While it is uniquely suited for creating languages 1, Racket is also a research vehicle for a large body of programming language research.…
Read more ⟶

Working through Gossip Glomers in Racket


Gossip Glomers is a series of distributed systems programming challenges from Fly.io. It uses Maelstrom, a platform for describing test workloads that can run your programs as distributed systems nodes. Maelstrom workloads can provide inputs to these nodes (as if they are arriving over a network), inject delays and partitions and then check that your system still satisfies the invariants of each challenge. So far I have made it through 3 of the 6 challenges1.…
Read more ⟶

Python Gotcha: Idiomatic file iteration has bad performance


Here is a performance footgun I encountered at work in a more complicated form. Python allows iterating over a file object. However, this iteration is defined as yielding lines, regardless of if the file is a text or binary file. In fact IOBase specifically says: IOBase (and its subclasses) supports the iterator protocol, meaning that an IOBase object can be iterated over yielding the lines in a stream. Lines are defined slightly differently depending on whether the stream is a binary stream (yielding bytes), or a text stream (yielding character strings).…
Read more ⟶

Remote Dbus Notifications over SSH


I often tack on notify-send at the end of a long running command to get a desktop notification when the command is done. ./long-running-build-command; notify-send "Build done" notify-send uses the Desktop Notification spec that relies on DBus to propagate a request to show a notification. This is a widely supported standard in the Linux ecosystem powering all notifications, regardless of which desktop environment you use. However my simple approach doesn’t work as soon as I’m logged into a remote machine.…
Read more ⟶

Nuphy Air75 Wireless Receiver does not work on Linux


I recently bought a Nuphy Air75 and ran into a weird issue on Linux. The Air75 can be connected to the computer in 3 different ways: Wired Bluetooth USB Wireless Receiver (comes with the keyboard) When I connected via wired or Bluetooth, the Fn key would correctly work. That is, F12 would map to F12 and Fn + F12 would increase the volume. 1 However, when I used the wireless receiver, the Fn key was never registered, and the keyboard would only send F12.…
Read more ⟶

A Racket program to decrypt files encrypted with Synology Cloudsync


I’ve been playing with Racket for the past few weeks. While I haven’t explored all the language-oriented-programming aspects yet, I’ve created a simple program to decrypt files encrypted with Synology Cloudsync. It is available as synology-decrypt (The Racket version). As I’ve written before, I use Backblaze to backup files to the cloud. My Synology NAS encrypts these files before uploading them using Cloudsync. The decryption software is not open source, and is a Windows and macOS-only GUI app.…
Read more ⟶

RAII Footguns in Rust and C++


I’ve been getting back into C++ at Skydio, and I’ve twice lost several hours to debugging weird code behavior because of an RAII footgun in the language. A similar footgun is present in Rust, and I’ve been bitten by that too, so I figured I’d write down both. RAII classes are often used to keep resources alive or hold locks for a given scope. There observable side-effects usually occur only in the constructor and destructor.…
Read more ⟶

Using a Digital Ocean Droplet to backup Google Takeout to Backblaze B2


Notes on using a Digital Ocean Droplet to copy Google Takeout data to Backblaze B2, for my own reference and in case they are useful to others. This uses rclone to perform the sync. Google Takeout allows exporting all your Google data, but requires a modern browser, with GUI and JS. The total data can be huge (~36GB for my last export), so downloading it to my local machine and uploading it can be slow (even on a Gigabit connection).…
Read more ⟶

Tracking the Books I've Read Using Svelte, XState and Quagga


I read a fair amount of books, but I’ve never kept track of them except in my brain because the friction to track books is just too high. Recently, I wondered how easy it would be if I could just use my phone to scan the barcode on the back of the book, and that would automagically insert the book into a list. The theory Each book is identified by a ISBN, a 13-digit number that is usually printed on the back of the book using a barcode.…
Read more ⟶