RSSAmplifier

Blog

Tinkering

Come for the Foo, stay for the Bar

tinkering.xyzRSS feed ↗22 posts

Latest posts

I wrote an API client for my water-cooled bed

Now that I have your attention, let's break that down a little bit. I recently purchased a Sleep.me Chilipad 2.0 , which is a system that allows you to control the temperature of your bed using a thin, water-filled mattress topper that's connected to a device that contains a pump, reservoir, and thermostat. It was $1700 1 . Yes it's ridiculous. I know. I make software engineer money, I'm single, I…

I don't care that it's X times faster

Yeah, this is a rant. I saw a post on r/rust and it triggered me. Rather than putting it in my diary or keeping it between me and my therapist I'm putting it on the internet because I suspect there are some kindred spirits out there. I'm sure this will go well for me. Also, yeah, I've written a post about making things faster, but that was about the incremental improvements I made to (1) something…

Composition: the feature I've wanted in Flox since I joined the company

Yes, this post is going to be about Flox , my employer, but this isn't an advertisement. This is me, both an engineer and a user, describing why I think a new feature I worked on is interesting, how it can change the way you develop your software, and what it was like to take point on the feature. We called this feature "composition", and it allows you to build developer environments in a modular…

proctrace - a high level profiler for process lifecycle events

proctrace is a profiler that runs on top of bpftrace (for now) and traces the execution of a process tree rooted at a user-provided command. Right now it records the following events and the time between them: fork exec exit setsid setpgid In the future I'd like to extend that to opening/closing/inheriting file descriptors and reads/writes. You can find the repository on GitHub and usage…

Evaluating a process manager

At Flox 1 we recently released a feature that we call "service management", which is essentially an analog to Docker Compose that runs processes instead of containers. In short, you define some services in your manifest and they get started as part of activating your environment with flox activate --start-services . When there are no more activations of this environment (i.e. you've closed all…

April Cools 2024: Physics Edition

Ghost triggers This particular experiment was driven by a laser that periodically spit out pulses that were 5ns long. A photodiode would pick up when a pulse was emitted, and we'd use that as the trigger for the oscilloscope. The oscilloscope would then record signals from our two other detectors. One of these is called "probe" and the other is called "reference". Here's a block diagram of the…

How I finally installed NixOS

I've been in the Nix world for about a year now, I work at a company that uses Nix daily, and it was only last week that I finally installed NixOS on the PC that I've been meaning to install it on for close to a year. Why? What kept me from installing it for so long? What was the breakthrough? The motivation Every time I get a new machine there's a feeling of dread that now I have to (try) to set…

Today we launched Flox 1.0

Intro A little over a year ago I was working full time as a software engineer while finishing my PhD in physics (you're probably already questioning my judgement, please keep reading). After I defended my thesis I had some free time to be a real human being again and decided to pick up Nix. I’ve always had a thing for documentation, and I noticed that the Nix documentation was notoriously hard to…

Talks

The Highlights These are the talks I'm most proud of: NixCon 2025 - You can't spell "devshell" without "hell" RustConf 2023 - Async Building Blocks: A Streaming Data Drama in Three Acts NixCon 2025 - You can't spell "devshell" without "hell" This talk is a deep dive into how "development shells" work, like those provided by nix develop and flox activate . It begins with a discussion about how nix…

Nix journey part 1: My grand unified theory of Nix documentation

Update 2023-11-19: This series is effectively dead. Since publishing this post I've joined the Nix Documentation Team, started, lead, and left a working group (which is now dissolved) based on teaching Nix to new users, and joined a company making a product that uses Nix as an implementation detail, and spoken at NixCon 2023 . That's left me pretty busy! Needless to say, with this much Nix…

Nix journey part 0: Learning and reference materials

The story before the recipe I've been following the Nix project for a while but now that I'm done with my PhD I finally have some free time and energy to try using it in earnest. This series is going to be me learning Nix by showing you how things work and how to put the pieces together. For those of you unaware, Nix takes reproducible builds to their logical conclusion by making package builds…

Bitmask tables

At $WORK I have a need to create some bitmasks over a 64-bit field. I've never done this before. I figured that surely tables exist for grabbing a certain number of bits from a certain position, but I never found those tables. So, to scratch my own itch I wrote a very simple Python program to generate the tables and used a CSV to Markdown converter to create the tables. Here you go, now we both…

Optimization story - quantum mechanics simulation speedup

Click here for tl;dr and spoilers I wanted to make a physics simulation 100x faster. I got it 4x faster exercising my best NumPy skills, and 50x faster after rewriting in Rust with a couple of other optimizations. After getting a machine with more (and faster) cores this jumped to 250x. As part of my research I've been modeling absorption spectra from first principles i.e. computing how much light…

Using notifiers to give yourself the day off

In keeping with the title, this will be a short post. The experiments that I do take roughly 2 hours each. The program that runs the experiments is written in Python and uses the click module for the command line interface. click provides an easy to use progress bar , so I have some visual indicator of how the experiment is progressing and some estimate of when it will complete. If I know roughly…

Interacting with Assembly in Rust

Note: I originally wrote this article for LogRocket. You can find the original here . For many Rust developers the process of producing a binary from their Rust code is a straightforward process which doesn’t require much thought. However, modern compilers are complicated programs in and of themselves, and may yield binaries that perform very differently in response to a minor change in the source…

Property-based testing in Rust with Proptest

Note: I originally wrote this article for LogRocket. You can find the original here . Software testing is an industry standard practice, but testing methodologies and techniques vary dramatically in their practicality and effectiveness. Today you’ll learn about property-based testing (PBT) including how it works, when it makes sense, and how to do it in Rust. What is property-based testing? To…

How to build a dice roller service in Rust

Note: I originally wrote this article for LogRocket. You can find the original here . Let’s get this out of the way: I’m a huge Dungeons & Dragons nerd. There’s something special about getting a bunch of adults in a room together to play pretend. Most of D&D involves using your imagination to make choices for your character, but the outcomes of some actions are determined by dice rolls. For…

Polsim - a case study for small-scale scientific computing in Rust

MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); Let's get this out of the way: polsim is a command line utility for doing pol arization sim ulations. I'm a physicist by day (shell of a man by night), and I work with lasers on a daily basis. My PhD is based on a measurement technique 1 that's polarization-sensitive, so it would be useful to be able to predict or ballpark…

Bringing macros to Python by abusing type annotations

Introduction The desire to bring macros to Python came from my experience with Rust's procedural macros, so we're going to talk about Rust for a second. If you'd like to skip ahead to the Python stuff, click here . Rust is becoming more and more popular by the day for reasons that you've probably heard about: It's really fast. It has a nice, modern type system. It prevents lots of memory errors.…

Using Python's asyncio with serial devices

I'm an experimental physicist, so part of my job entails writing software that orchestrates equipment in my experiment. Most of the code that runs my experiment is written in a proprietary scripting language that I guarantee none of you have ever heard of. The old code is brittle, difficult to debug, and generally makes it too much of a pain to add features unless absolutely necessary. Lately I've…

About

Hi, I'm Zach. I love learning how things works and using that knowledge to build new things. When I'm not reading about software you can find me on a disc golf course, rolling dice with a Dungeons & Dragons group, or curling. I've used Rust since 2018, but lately I'm on the Zig train. I'm neurotic about dependencies, so I also use Nix, run NixOS on several machines, etc. I did a physics PhD at…

Introduction to Procedural Macros in Rust

As a newcomer to Rust, I heard the phrase "procedural macro" thrown around a lot without really understanding what it meant. I figured that I would learn about them if I ever needed them. Well, I'm working on the guts of relm , and a large chunk of it is procedural macros. I've learned enough about procedural macros to be dangerous, so I thought I would pass on some knowledge. The purpose of this…