Blog
Packaging Swift apps for Alpine Linux
While trying to build my Age Apple Secure Enclave plugin, a small Swift CLI app, on Alpine Linux, I realized that the Swift toolchain doesn’t run on Alpine Linux. The upcoming Swift 6 will support (cross-)compilation to a static (musl-based) Linux target, but I suspect an Alpine Linux version of Swift itself isn’t going to land soon. So, I explored some alternatives for getting my Swift app on Alpine.
Read more ›Generating coverage reports & badges for SwiftPM apps
The age plugin for Apple’s Secure Enclave is a small, platform-independent Swift CLI app, built using the Swift Package Manager. Because it does not use Xcode for building, you can’t use the Xcode IDE for collecting and browsing test coverage of your source files. I therefore wrote a small (self-contained, dependencyless, cross-platform) Swift script to transform SwiftPM’s raw coverage data into annotated source code, together with an SVG badge to put on your project page.
Read more ›A WebAssembly Core for Uxn
While watching a Strange Loop talk on concatenative programming, I learned about Uxn, a small virtual machine that runs games, editors, drawing programs, … Uxn has been ported to various platforms, including classic consoles such as the Nintendo DS, GBA, Playdate, …
There also is a JavaScript version: Uxn5. Since the Uxn5 core was a straight translation of the C reference implementation to pure JavaScript, it wasn’t very performant. After my latest expeditions into WebAssembly, I wanted to give writing a pure emulator in WebAssembly a try as well, so I created uxn.wasm, a WebAssembly core for the Uxn virtual machine.
Read more ›Lightweight structured logging on Cloud Run using slog
In this post, I’ll walk through a small example of a Go web app for Cloud Run that uses
Go 1.21’s standard library slog
package for structured logging to Cloud Logging.
Contrary to the documented ‘standard’ approach for logging, this example doesn’t use any third-party logging package for logging. Instead, it relies on Cloud Run’s support for ingesting structured logs by simply printing JSON to standard error.
Read more ›An age plugin for Apple's Secure Enclave
For my day-to-day encryption needs, I’m a big fan of age. age is a simple, modern and secure file encryption tool, and serves as a better replacement for tools such as GnuPG. You can even use it as the backend for managing your passwords.
For extra convenience and security, I wanted to be able to use my MacBook’s Secure
Enclave (controlled by Touch ID) to encrypt files, so I created an age plugin for this: age-plugin-se
.
A Dynamic Forth Compiler for WebAssembly
In yet another ‘probably-useless-but-interesting’ hobby project, I wrote a Forth compiler and interpreter targeting WebAssembly. It’s written entirely in WebAssembly, and comes with a compiler that dynamically emits WebAssembly code on the fly. The entire system (including 80% of all core words) fits into a 10k (5k gzipped) WebAssembly module. You can try out the WAForth interactive console, or grab the code from GitHub.
Read more ›Ken Burns Effect Slideshows with FFMpeg
One of the first things that impressed me about Mac OS X when I first saw it was its screensaver. Instead of just showing a simple slideshow of your pictures, it actually used a Ken Burns panning and zooming effect with a fancy fading transition to make the otherwise static pictures really come to life. It always sounded like a fun project to create a standalone tool to create slideshow movies that used this effect, with full control over where and how much pictures should be zoomed. It turns out you don’t really need a new tool: you can get the same result using just FFMpeg. In this post, I’ll walk through the steps of creating slideshows using the Ken Burns effect.
Oh, and cats. There will be cats!
Read more ›Universal/Isomorphic React on a Swift Backend
React’s standard flow is to start with an empty HTML template from the server, and populate the DOM entirely on the client. Letting React pre-render the initial HTML for your app on the server before the client takes over has some advantages, though: it lets slower (mobile) clients load your app much faster, and it’s good for SEO for search engines that don’t support JavaScript. Since you have to run React on the server to do this, you need a JavaScript-able backend, which is why such Universal (a.k.a. Isomorphic) apps are mostly built with Node.js backends. However, you can create universal React apps with other languages too, including Swift. In this post, I’ll walk through an example of a universal React app using Swift’s Vapor web framework.
Read more ›A Dutch Diceware List
TL;DR: You can find Dutch Diceware word lists here.
TL;DR 🇳🇱: Je kan hier Diceware woordenlijsten vinden, of er hier wachtwoorden mee aanmaken.
Ever since I read XKCD 936, I’ve been a big fan of the Diceware
approach for picking strong passwords, where you randomly pick words from a
list to create a memorable passphrase. Sometimes, I need to generate Diceware
passwords in Dutch for friends and relatives. Unfortunately, the Dutch word list from
the Diceware page contains
many uncommon words, non-existent words, duplicate words (yikes!), numbers, and characters (as the
example ijler 100 leperd akolei kolkje
on that page proves), which
diminishes the memorability and
usability of the generated passwords. I therefore created my own, improved lists,
which you can try out directly from your browser on my password generator (or in the Dutch version. The list consists of the most common Dutch words, and has an added
benefit that it only contains words that don’t weaken security when leaving
out spaces between words. This post discusses the details how I composed this list. The process and
links can be used as a guide to generate Diceware lists for other languages.
HAProxy Alerts with WebHooks
I want to be notified immediately when one of the backend servers behind my HAProxy instance goes down. HAProxy offers alerting functionality, but only via SMTP: when a backend goes down it sends an email to a list of recipients via an SMTP server you provide. Unfortunately, email isn’t an ideal mechanism for real-time notification, and I don’t have an SMTP server accessible from my HAProxy instance.
Read more ›Extracting Surround Music Discs
I own a couple of multi-channel Surround Sound music albums on DVD, Blu-Ray, and SACD discs. I wanted to extract them all to a hard drive to avoid the nuisance of putting discs in slow (and often stammering) CD/DVD/Blu-Ray players with unfriendly navigation menus, and wanted to have a backup of the audio in case the discs go bad. Each of the different formats requires different tools to convert them to a playable format, so it took me some time to figure out how to convert each one of them. I wrote up a summary of the tools and processes for future reference.
Read more ›More Fun with Monad Do-notation in Scheme
In a previous post, I played around with monad do-notation in Scheme (well, Racket) to have a nicer syntax to play with asynchronous callbacks. This do-notation is actually quite fun to use with other monads as well. What’s interesting is that the same notation gets entirely different meanings and forms depending on which monad you use it with.
There are many interesting monads, and this post shows only a couple of simple ones in action in Scheme (for which you can find the code here). If you want a much better description and in-depth of these monads (and more), I highly recommend you read the awesome Learn You a Haskell for Great Good!
Read more ›Flattening Callback Chains with Monad Do-Notation
A few unrelated topics on my reading list made me want to randomly experiment with a few things. I wanted to understand monads a bit better, see how they applied to callback-based asynchronous programming, and play around with macro programming in a Lisp dialect. This is a partial log of the theoretical-and-probably-not-directly-applicable-but-nevertheless-fun rabbit hole I dived into.
Read more ›Beautiful (XMPP) Testing
O’Reilly recently released the book Beautiful Testing, a collection of essays about testing and QA in general. As I mentioned earlier, I wrote an article in that book on (unit) testing XMPP protocols, using Swift as a motivating example. Since the book’s scope may (oddly enough) not always be as interesting for developers in general, I released my article under a Creative Commons Attribution license (thanks to the good folks from O’Reilly for encouraging us to do this), which you can find here (or directly from my Git repository). The original excerpt from the book (including the index, list of biographies, and all the fancy artwork) is also available for download under the same license.
Read more ›“XMPP: The Definitive Guide” Code Examples
Although the primary focus of XMPP: The Definitive Guide is explaning the XMPP protocol and all its extensions through text and illustrations, we also included a few Python code examples to help people get started with implementing their own ideas. In fact, we devoted a whole chapter to building an XMPP application, starting out with a simple bot implementation, but gradually extending the application into a full server component. For people who want to try this out for themselves, we’re releasing the source code of all code examples, including a simple echo bot, and different variants of the CheshiR microblogging platform XMPP interface.
Read more ›"Beautiful Testing" XMPP Chapter
Adam Goucher and Tim Riley (Director of QA at Mozilla) announced a few months ago that they are putting together a Beautiful Testing book for O’Reilly. I took the opportunity to write a chapter about testing in the context of XMPP (more specifically, about testing protocol implementations in Swift), and just submitted the final draft for technical review. The book is expected to be released this August.
Read more ›XMPP 101 @ FOSDEM
The slides of the “XMPP 101” talk that Peter and I gave at FOSDEM are available below. This presentation gives a fast-paced introduction to XMPP, and is mostly based on “XMPP: The Definitive Guide”. If all goes well, we will be giving a more extended version of this talk as a tutorial at OSCON.
Read more ›We have an animal
O’Reilly just sent us the cover for our upcoming XMPP Book, and it seems we got the world’s smallest ungulate: the lesser mouse-deer. I haven’t seen one in real life before, am not sure I ever want to, but still: great! Have a look below to see what the cover of the book will look like when it hits the stores in 2 months.
Read more ›Final revision of the XMPP book submitted
After a few weeks of heavy labour and long nights, Peter, Kevin, and I just submitted the final revision of “XMPP: The Definitive Guide” to the folks at O’Reilly. All the feedback from our (thorough) reviewers has been processed, we added quite a few extra bits and clarifications (58 pages to be exact), polished the whole thing up, and went through the resulting manuscript with a fine toothed comb. We hope the people who will read this book will be as satisfied with the end result as we are. Read more ›Rough cuts of XMPP book now available
While Kevin, Peter, and I are working very hard to finish the first draft of our upcoming book ‘XMPP: The Definitive Guide’, O’Reilly has recently released early versions of most of the chapters of the book as Rough Cuts. People interested in learning about XMPP today can now get a preliminary version of the book, and get updates as the book progresses.
Read more ›We're writing an XMPP book
I’m excited to announce that Peter, Kevin, and I recently got the green light from O’Reilly to start writing a book about Jabber/XMPP. The book will be targeted at a diverse public: on one hand, people who want to get acquainted with XMPP and will get an introduction and a general overview of XMPP, its workings, and its possibilities. On the other hand, software engineers who want to integrate XMPP into their products will get a guide to implementing different use cases of XMPP through a series of different developer stories. The book is expected to be available in 2009, so start making some room on your bookshelf!
Read more ›Basic Music Theory in Haskell
While doing some spring cleaning around my hard disk, I found a little Haskell program I wrote several years ago in an attempt to learn the basics of music theory. Now, I’m not a pro at writing Haskell, and I know even less about music theory, but I’m hoping that what I wrote down back then is a bit accurate. The program seems to summarize the basics quite consisely: by just having a glance at the program, I’m rediscovering some things I totally forgot about scales and chords.
Read more ›"The First 10 Prolog Programming Contests" available for downloading
Exactly one year after we finished it, our book “The First 10 Prolog Programming Contests” is now freely downloadable. On the home page of the book, you will also find the source code of all solutions presented in the book.
Read more ›Sampling away with the SPD-S
Lately, I have been searching for ways to trigger loops and samples from behind my drum kit. After playing around with a less than ideal setup involving many cables and devices (see below), I decided to buy myself a Roland SPD-S sampling pad. Turned out to be a pretty good move !
Read more ›Building Fancy DMG Images on Mac OS X
On Mac OS X, applications are usually distributed using disk images (DMGs). These images are mounted as a separate volume, and it often suffices to drag the application out of the image into your Applications folder. A nice extra feature of these disk images is that their look can be customized, just as every other folder under Mac OS X.
This post explains how such DMG files with a customized look can be built. Moreover, a Makefile is provided such that, once a template look is created for a DMG, the process of building a DMG file from a set of files can be fully automated.
Read more ›Dvorak: Escaping the typewriter age
About half a year ago, I heard this story that QWERTY keyboards (and their variants) were actually designed to slow down typists (to avoid typewriters getting stuck), contrary to the Dvorak layout, which was specifically designed for speed and comfort. After having learned to count binary on my hands (yes, you can count to 1023 using only your 10 fingers!), this seemed like another fun and freaky thing to learn, and this could actually prove to be useful over time. After all, I switched from AZERTY to QWERTY before, how hard could this be ? At least I was right about it being useful.
Read more ›