Here’s a little benchmark complements of Jann Horn. It’s unexpectedly slow on Linux.| flak.tedunangst.com
I’m aware of two occasions on which Knuth advised editing existing code, as opposed to simply using it. One mention is in this interview, advocating for “re-editable” code instead of the fashionable reusable code, although it doesn’t amount to much more than that statement. In Coders at Work he describes a system of working that’s basically patch and diff. He writes a program, the master version that works for him, and ships it out. People receive and it and then modify it with chan...| flak.tedunangst.com
I used to use the go log package, then I switched to the slog package, and it’s been a bumpy ride.| flak.tedunangst.com
Perl has a regex option /o, which pretends to optimize your code, but actually introduces bugs. Go has been missing out. Until now.| flak.tedunangst.com
what is the go proxy even doing?| flak.tedunangst.com
The go module proxy caches requests from users, so everyone has a consistent and reliable experience regardless of upstream host. But what if the go proxy is contributing to the instability of the upstream host? There have been other complaints about the go proxy, that’s just the way it works, but I collected a few minutes of logs to examine that may be interesting.| flak.tedunangst.com
One of the traps in go is the reuse of loop variables, confounding novices and even catching the unwary expert. It’s so bad they may even change the language to fix it.| flak.tedunangst.com
Whenever a bug is discovered, it’s immediately apparent that three things have gone wrong. They used the wrong language, and this never would have happened if they’d written it in the bugfree language. They used the wrong development methodology, and this never would have happened if they’d used the prevent this bug technique. And finally, they ignored best practice and didn’t use the proper coding style. The bug would have been extremely obvious if only they’d replaced all v_w_ls w...| flak.tedunangst.com
The key to understanding how modern browsers work is to observe them in action. For this, we can use ktrace. I’ve posted a few ktrace snippets before, but here’s some new ones to aid in our understanding. Even if we don’t learn anything, deciphering ktrace and kdump output is a pretty useful skill. I use ktrace to verify software I write does what I think I expect. Using ktrace on other people’s software is like a never ending set of practice exercises.| flak.tedunangst.com
This is a little tour of some software I took today. One of the topics that consistently comes up when people discuss what operating system to run on their laptop is how much battery life to expect, and the answers are all over the map. The focus always seems to be on the kernel and how advanced its scheduler algorithm is, and the minutia of interrupt controllers. We throw around terms like race to sleep. But rarely do I see anyone mention the impact that the software they choose to run spend...| flak.tedunangst.com
Having burned out both the original flash drive and its replacement, I can’t recommend using an ERL in a serious setting.| flak.tedunangst.com
I’ve been a rather happy lua user for a few years. In particular, the luajit implementation. But as part of an ongoing overhaul of this and that, I decided to rewrite all my lua code in go. Or wait, let me rephrase that.| flak.tedunangst.com
The web as we know it will soon crash and burn in a fiery death. 12 days. There’s even a countdown. This is apparently a redux of request smuggling reborn. Request research reborn redux.| flak.tedunangst.com
There was an (almost) catastrophic OpenZFS bug. If they had used zig, the bug would be easily detected. But the question remains, could we detect this bug in C?| flak.tedunangst.com
Once upon a time, there was a university president who couldn’t send an email more than 500 miles, and the wise sysadmin said that’s not possible, so the president said come to my office, and lo and behold, the emails stopped before going 500 miles. Has technology improved? Can we send an email farther than 500 miles in 2025?| flak.tedunangst.com
I had the idea to write a little shell in go. Called gosh, of course. There’s a few people playing with the same theme, but nothing exactly the same.| flak.tedunangst.com
I like to go on the internet and click on links, but some of the links are bad, so then I swipe right to make it go away. The problem is that when I’m running chrome on OpenBSD, the swipe gesture doesn’t seem to work like it does on other platforms. We’re not going to fix it, but we are going to make it work. (Although, I hear the younglings say they swipe right when they like something. Explains a lot, actually.)| flak.tedunangst.com
People keep telling me that X11 doesn’t support DPI scaling, or fractional scaling, or multiple monitors, or something. There’s nothing you can do to make it work. I find this surprising. Why doesn’t it work? I figure the best way to find out is try the impossible and see how far we get.| flak.tedunangst.com
There are a number of network protocols that we might refer to as text protocols, where we send a line of text to the server and it sends back a response. Perhaps I should call them CRLF protocols, to distinguish from protocols where we’re blasting JSON back and forth. To speed things up, it can be tempting to have the client send multiple requests without waiting for individual responses.| flak.tedunangst.com
ASUS laptops generally have a feature that lets the user toggle the fan speed. Fn-F5 on some models, Fn-F on others. The direct effect is to limit the fan speed, from whisper mode to megablast, and indirectly control performance. But it doesn’t work in OpenBSD, so I needed to write an ASUS ACPI WMI driver.| flak.tedunangst.com
I don’t usually recommend budget laptops, which end up being useful for little more than getting online and ordering a real replacement, but occasionally there’s exceptions. Like the ASUS Vivobook 14 (X1404ZA) from 2023, which apparently was made in great numbers but didn’t sell very well, because stores are still trying to unload it. It’s not a great laptop, but for $225 or so, it’s better than most of the alternatives. (Unless you find a good deal on an ebay thinkpad, etc. An X1 C...| flak.tedunangst.com
Computers are kind of fast these days, which means a lot of little inefficiencies vanish from sight. In theory an idle system with nothing to do should be doing nothing, but frequently enough it turns out to be doing nothing. A couple examples.| flak.tedunangst.com
As I move around, I roam between wifi networks, but sometimes lose the connection. Then I click a link and watch in vain as it fails to load. So I’d like an easy way to check which, if any, wifi network I’m connected to, such as by putting it in my dwm status bar. I could run ifconfig and parse the output, but that’s excessively wasteful. I need to get the info myself.| flak.tedunangst.com
It’s the internet, so there’s crawlers, and it’s the future, so they’re mindless wannabe chatbot scrapers, and it’s the cyberpunk world we always dreamed of, so the cool thing to do is to write your own force field to keep the bots out. Which I did.| flak.tedunangst.com
The OpenBSD kernel has a set of functions to help detect memory corruption, the poison subroutines. The memory management code uses these functions, but they themselves have a very simple interface, no complicated types or data structures, meaning they’re easy to replace. What if we rewrite the memory corruption detection functions in rust so it’s impossible for them to cause memory corruption?| flak.tedunangst.com
I have a Pixelbook which Google says I need to stop using, but they’re not the boss of me, and in the process of reflashing it (long story), I needed to get out my trusty USB stick writer, a Zenbook UX305. Well, formerly trusty. After closing the lid, I noticed a small gap in the front. The laptop’s midsection has developed a serious case of the swoles. Okay, let’s get a 3rd gen Carbon X1 Thinkpad from the laptop shelf.| flak.tedunangst.com
Or perhaps more precisely, how do they get there? What happens when you call write?| flak.tedunangst.com
The OpenBSD kernel is getting to be really old, like really, really old, mid 40s old, and consequently it doesn’t like surprises, so programs have to tell it where their syscalls are. In today’s edition of the polite programmer, we’ll learn the proper etiquette for doing so.| flak.tedunangst.com
On OpenBSD, there is a rule that you link with libc to interface with the kernel, because that’s where the syscall stubs live. This causes a great deal of consternation for partisans of other languages, because they don’t want to link “all of libc”. But when does anything link all of libc?| flak.tedunangst.com