Plurrrr

week 43, 2022

Ted 2 (2015)

Newlywed couple Ted and Tami-Lynn want to have a baby, but in order to qualify to be a parent, Ted will have to prove he's a person in a court of law.

In the evening Alice, Esme, and I watched Ted 2. I liked the movie a little more than Ted so I give it a 6.5 out of 10.

The Perfect Commit

For the last few years I’ve been trying to center my work around creating what I consider to be the Perfect Commit. This is a single commit that contains all of the following:

  • The implementation: a single, focused change
  • Tests that demonstrate the implementation works
  • Updated documentation reflecting the change
  • A link to an issue thread providing further context

Our job as software engineers generally isn’t to write new software from scratch: we spend the majority of our time adding features and fixing bugs in existing software.

The commit is our principle unit of work. It deserves to be treated thoughtfully and with care.

Source: The Perfect Commit, an article by Simon Willison.

Dutch Design Week in Eindhoven

Late in the morning Alice, Adam, Esme, and I left by public transport for the Dutch Design Week. After a bus trip, and two train trips we arrived in the city of Eindhoven where the event was held.

Adam, Esme, and Alice walking towards the Evoluon
Adam, Esme, and Alice walking towards the Evoluon.

After we had bought our family ticket we took a bus to the Evoluon museum, which is shaped like a flying saucer.

Urban Reef by Max Latour & Pierre Oskam
Urban Reef by Max Latour & Pierre Oskam.

On the ground floor I admired the Urban Reef and the Algorithmic Perfumery. We also saw all kinds of materials made by bacteria and funghi.

Algorithmic Perfumery by Frederik Duerinck
Algorithmic Perfumery by Frederik Duerinck.

After we had walked around a bit and eaten an ice cream we got for free we decided to pay the fee for visting the other levels of the museum which held the Retro Future Expo. We didn't have to pay for Alice and Adam. We spent quite some time on those levels: there was a lot to see and do.

After the expo we walked to a nearby building for another part of the Dutch Design Week. We had to go to the back of a building and enter a creepy looking elevator which took us to the eight floor.

Hyle square 22.2 by Jochem Esser
Hyle square 22.2 by Jochem Esser.

I liked "Hyle square 22.2" a lot, and both the sea turtle and exoot "animaltroniek".

Chelonia mydas animaltroniek
Chelonia mydas animaltroniek.
Exoot animaltroniek
Exoot animaltroniek.

After looking around for a bit longer we left the building and paid a visit to several nearby small shops. We had a nice dinner in nearby restaurant "Ketelhuis". Afterwards we took the bus to the central station and soon where on our way back home.

Early speed optimizations aren’t premature

As you code, you might have a coworker, or friend, or a little voice in your head, reminding you of Knuth’s famous saying: “premature optimization is the root of all evil.” But what makes an optimization premature, anyway?

The short answer is that this aphorism is a tautology. “Premature” means “too early,” so we can rephrase the point as “doing things at the wrong time isn’t ideal.” Can’t argue with that!

The problem with this saying is that many people wrongly interpret it as “early optimization is the root of all evil.” In fact, writing fast software from the start can be hugely beneficial.

Source: Early speed optimizations aren’t premature, an article by Itamar Turner-Trauring.

Swift vs. Rust: Comparison guide

With their diverse use cases, Rust and Swift share numerous similar features. The languages are both general-purpose and provide modern programming features.

While Apple built the Swift programming language to replace Objective-C and the Mozilla Foundation built Rust as a substitute for C++ for writing memory-safe code, the languages have increased in popularity amongst the developer community.

Source: Swift vs. Rust: Comparison guide.

Ted (2012)

John Bennett, a man whose childhood wish of bringing his teddy bear to life came true, now must decide between keeping the relationship with the bear, Ted or his girlfriend, Lori.

In the evening Esme, Alice, and I watched Ted. I liked the movie just a little so a 6 out of 10.

systemd isn't safe to run anywhere

Since the release of systemd in 2010 the project has been getting a continuous and steady stream of new features and added capabilities. With a code count of more than 1.3 million lines of code, where Lennart Poettering has just added yet another 20.000 new lines of code with the merge of his personal systemd-homed git tree into systemd, and with a continuous open issue counter at about 1.400 issues, where new issues and bugs keep popping up, systemd should be considered experimental and not safe to run anywhere.

Source: systemd isn't safe to run anywhere.

A nub in the haystack

When GHC 9.2 was released in late 2021, I was eager to migrate my projects, particularly to reap the ergonomic benefits of the record dot syntax feature. My disappointment was immeasurable as I discovered that some of my more involved type-level computations caused GHCi to get stuck, just spinning indefinitely at full CPU load – it meant that in order to get productive with the new compiler, I would have to invest a potentially significant amount of time to debug a regression. Since my plate was already full at the time, I postponed this with the hope of an upcoming minor release magically fixing the issue.

Source: A nub in the haystack, an article by Torsten Schmits.

Using dependent types to write proofs in Haskell

We all know that we can use Haskell to write functional programs that compute stuff. But can we also use Haskell to write mathematical proofs? Yes! In case you have never been exposed to dependent types, the concept of writing proofs with a programming language will surely sound alien to you. In this blog I hope to give you an informal introduction to dependent types in Haskell that will allow you to understand what does it mean to prove something in Haskell and how to do it. I strongly recommend that you follow along with ghci on your side.

Source: Using dependent types to write proofs in Haskell, an article by Jan Mas Rovira.

A Potpourri of Emacs Tweaks

Emacs is the “extensible text editor”, and it wouldn’t be fun if one didn’t at least try to take advantage of that, right? Having just written a README for my Emacs configuration, I thought it might be nice to somewhat expand on certain ideas and give a little context to some snippets that have accumulated over time.

Source: A Potpourri of Emacs Tweaks, an article by Tony Zorman.

All The Ways To Introspect Python Objects at Runtime

Python provides a lot of ways to ask questions about your code. Whether it's basic things like help() function, builtin functions like dir() or more advanced methods in inspect module - the tools are there to help you find the answers to your questions.

Let's find out what kinds of questions about our own code can Python answer for us and how it can help us during debugging sessions, dealing with type annotations, validating inputs and much more.

Source: All The Ways To Introspect Python Objects at Runtime, an article by Martin Heinz.

systemd Shutdown Units

Designing a system to shutdown gracefully can be tricky. In an ideal world, every service would be managed by a systemd unit. ExecStart would start a process that handles SIGTERM by stopping itself and an ExecStop would inform the process and block to gracefully stop the process and its resources.

But not all software stops gracefully or does a full teardown of what it set up. In this post, we’ll look at systemd’s shutdown behavior and strategies for writing systemd units that perform custom cleanup tasks before shutdown.

Source: systemd Shutdown Units, an article by Dalton Hubble.

Mushrooms

On our way to do some shopping Esme pointed out some mushrooms she had spotted earlier on. I got off my bike and took a few photos while Esme and Alice waited.

Mushrooms
Mushrooms.

This is probably the same species as can be seen in the second photo of Mushrooms in a Garden as that photo was taken on the other side of the path slightly over three years ago.

Significant Garbage Collection Improvement For Emacs

This commit reduces the total wall clock duration for sweep conses execution by approximately 50%. It does so by reducing branch mispredictions from dereferencing storage blocks while sweeping the cons blocks. Parsing the output from some subprocesses such as LSP servers creates huge amounts of conses, so this commit is significant for increasing the responsiveness for modes such as eglot or company-mode.

Source: Significant Garbage Collection Improvement For Emacs, an article by Tyler Dodge.

How to correctly cache build-time dependencies using Nix

Professional Nix users often create a shared cache of Nix build products so that they can reuse build products created by continuous integration (CI). For example, CI might build Nix products for each main development branch of their project or even for every pull request and it would be nice if those build products could be shared with all developers via a cache.

However, uploading build products to a cache is a little non-trivial if you don’t already know the “best” solution, which is the subject of this post.

Source: How to correctly cache build-time dependencies using Nix, an article by Gabriella Gonzalez.