Chosen links

Links - 9th January 2022

Trauma & growth

I don’t know who needs to hear this but in case it’s one of you: trauma and developing mechanisms to cope with trauma isn’t growth. Anybody telling you that you need to join a traumatic environment or workplace to grow in your job or as a person is doing you a huge disservice.

A library for building cross-platform native desktop applications with Node.js and CSS

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling.

NodeGUI is powered by Qt5 which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.

You can’t copy code with memcpy; code is more complicated than that

The idea is that they want to inject some code into a target process, so they use Virtual­Alloc to allocate some memory in that process. The first part of the memory block contains some data that they want to pass. The second part of the memory block contains the code bytes that they want to execute, and they tell Create­Remote­Thread execution at those code bytes.

I’m just going to say it right now: The entire idea that went into this code is fundamentally flawed.

The gift of it’s your problem now

Here’s the thing about gifts: the sender chooses them, not the recipient. We can have norms around what gifts are appropriate, and agreements to not over-spend, and wishlists, and so on. But I won’t always get the exact gift I want. Sometimes I didn’t even want a gift. Sometimes the gift interprets JNDI strings in my log messages and executes random code from my LDAP server. This is the nature of gifts.

Many developers and companies have been disappointed to learn that just uploading your code to GitHub doesn’t make a community of developers appear. (It does make it more likely that AWS will fork your product and make more money from it than you do.)

ANNOUNCE, RFC “Fast kernel headers” tree -v1: eliminate the Linux kernel’s “dependency hell”

The fast-headers tree offers a +50-80% improvement in absolute kernel build performance on supported architectures, depending on the config. This is a major step forward in terms of Linux kernel build efficiency & performance.

A justified question would be: why on Earth 2,200 commits??

Turns out it’s not easy to reduce header dependencies, at all:

  • When I started this project, late 2020, I expected there to be maybe 50-100 patches. I did a few crude measurements that suggested that about 20% build speed improvement could be gained by reducing header dependencies, without having a substantial runtime effect on the kernel. Seemed substantial enough to justify 50-100 commits.

  • But as the number of patches increased, I saw only limited performance increases. By mid-2021 I got to over 500 commits in this tree and had to throw away my second attempt (!), the first two approaches simply didn’t scale, weren’t maintainable and barely offered a 4% build speedup, not worth the churn of 500 patches and not worth even announcing.

  • With the third attempt I introduced the per_task() machinery which brought the necessary flexibility to reduce dependencies drastically, and it was a type-clean approach that improved maintainability. But even at 1,000 commits I barely got to a 10% build speed improvement. Again this was not something I felt comfortable pushing upstream, or even announcing. :-/

  • But the numbers were pretty clear: 20% performance gains were very much possible. So I kept developing this tree, and most of the speedups started arriving after over 1,500 commits, in the fall of 2021. I was very surprised when it went beyond 20% speedup and more, then arrived at the current 78% with my reference config. There’s a clear super-linear improvement property of kernel build overhead, once the number of dependencies is reduced to the bare minimum.

What this thing is

I decided to make a bad micro blogging platform that uses the iOS notes app as its content source. It seemed like a good/bad idea, but also an easy one, side I already had the reading list code.

How it works:

  1. I write content inside the iOS notes app, in a dedicated folder for posts.

  2. I run an iOS shortcut which gathers up the information and formats it. This formatting is joining some properties like the creation and modification date, and the actual text, with the unicode UNIT SEPARATOR character. Then, joining each post with the FILE SEPARATOR character. Finally, sending a request to my server with that as the body.

  3. This passes through nginx as a (reverse?) proxy so I don’t have to do HTTPS in the Rust server (Rocket 🚀 doesn’t support it in a production ready way yet.)

  4. The Rust server saves the file in a directory as a dated file and also current.usv

  5. The Rust server renders current.usv with a Tera template and saves that in my web content folder

  6. nginx serves static files out of that folder so you can see these

I think iOS shortcuts are really cool, and I love building tiny servers, and USV is a good format.

Debian’s approach to Rust - Dependency handling

That leaves two possibilities for the semantics of a dependency A depends B, version(s) V..W: Precise: A will definitely work if B matches V..W, and Optimistic: We have no reason to think B breaks with any of V..W.

Writing as yourself

There’s a simple method to doing anything. Do you know it?

It goes like this:

  1. Be the sort of person who can do the thing.

  2. Do the thing.

How do you become the sort of person who can do the thing?

Well, if you’re not already, first you need to be the sort of person who can become the sort of person who can do the thing, then you become the sort of person who can do the thing.

This isn’t an infinite regress. It’s just the fully general system for learning to do hard things - eventually you bottom out by finding something that is only just outside your comfort zone.