slog is aptly named
I used to use the go log package, then I switched to the slog package, and it’s been a bumpy ride.
more...
I used to use the go log package, then I switched to the slog package, and it’s been a bumpy ride.
more...
Apple released “Liquid Glass” which looks a lot like a revival of UI fashion from two decades. Everything is transparent. But I doubt Apple has the courage to bring back wobbly windows. No matter, I hardly move my windows around anyway, but what does move is the text inside. So why not wobbly letters? Wobbletters. Definitely in the category of felt cute might delete later.
My original idea was to add a little spin to each letter as it scrolls. Like the letters are hanging on a backboard, and as it bounces up and down, momentum is transferred to the letters. Didn’t quite make it that far, but maybe next time.
To start, I just wanted to check I could shift the vertices around a bit. The same wobble for every vertex, no distortion.
var wobblex, wobbley float32
if smoothAmt != 0.0 {
wobblex = (rand.Float32() -0.5) / 50.0
wobbley = (rand.Float32() -0.5) / 50.0
}
for k := 0; k < 6; k++ {
base := &baseverts[x+k]
base.adj[0] += wobblex
base.adj[1] += smoothAmt + wobbley
}
This ended up looking much cooler than I thought. Like a faceted glass privacy screen. Apple should totally add this now. It fits with the glass theme. The sequel to liquid glass, solid glass!
Unfortunately, this renders the text unreadable while scrolling.
Video is at 30 fps, but the illusion is more complete at 90 fps. You no longer see individual letters, just transient edges as they pass by.
<video playsinline controls poster="/images/wobble.jpg">
<source type="video/mp4" src="/images/wobble.mp4">
</video>
Accidentally rebooted after installing this, so I guess it’s wacky week for a while.
X11 is supposed to be dead, but people keep using it because apparently it still works. I have a plan to fix this so everyone does what I want.
It all starts with a popular toolkit library like QTK. Even if people don’t upgrade X11, if they run a browser, they’re on the upgrade treadmill.
I change the internal pixel representation from RGB to BGR and adjust the Wayland backend, but not the X11 backend because that’s community supported.
I am confused when bug reports start coming in. Weird colors on X11? Doesn’t surprise me, there’s tons of weirdness in that pile of jank. Works for me in Wayland, you should try it.
Somebody will figure it out and submit a patch. I’m sorry, but we have a release scheduled and we can’t merge anything that may cause further regressions, even though it only changes x11.c. Are we sure this is even the correct fix? Have you tested with a Voodoo2 card?
This is the internet, so after sufficient slow walking, someone is bound to say something unpleasant on the tracker. I write a blog post outlining how not only is X11 support a burden on developers, it’s literally unsafe. Just look at these death threats.
I commit the fix with a lengthy commit message fanfic story about frogs and scorpions and the Jem’Hadar.
I revert the BGR change back to RGB pixels. I write another blog post expressing regret about the lack of progress and alluding to all the cool things that would have been possible, if only we weren’t held back by legacy platform support. No need for details, people will get the message.
Users start reporting bugs on X11. Weird colors on X11? Again? How many times do we need to fix this crap? We need to get people off of X11, whatever it takes.
I devise a plan to kill X11.
Back in the olden times, software was hard to build and hard to use, but remarkable improvements have been made, and entire ecosystems of ergonomic languages are now available. I happen to think the old ways still have some merit, but don’t want to spend all my time staring at the cave walls.
more...
I have a web application process, which talks to strangers on the network and stores data in the filesystem. To limit the damage caused by naughty tricksters, it uses pledge and unveil so that even if somebody takes over the process, they can only corrupt this program’s data. As opposed to changing my password, for example.
Users love features, so every day I add a new feature, and then I restart the server. This causes milliseconds of downtime. We can only afford 800 milliseconds of downtime per day in order to meet our five nines availability target, and two restarts in a single day puts us very close to the limit. So I added a smooth restart feature, where sending SIGHUP to the server will cause it to reëxec itself, but with the listening socket already open. No connections are lost.
Fork and exec require additional promises to pledge. But this opens the door to trouble. What happens if the trickster wants to exec a new process? Fortunately, unveil restricts exec to only the same program, but they can still restart it with new options, like setting the log file to /etc/passwd. The command line interface offers enough flexibility to accomplish a fair bit of mischief. I spent some time convincing myself this is an unlikely attack scenario, and mostly succeeded, but using pledge suggests I care about unlikely scenarios, so I should do things properly.
As with all problems, the solution is to add another layer of abstraction. Now the main process execs a worker process, and the worker process once again loses the ability to exec. I was already using one helper process anyway, managed by the server. After shuffling some code around, our growing family now includes three processes. The result is arguably better organized, as well, since competing concerns are better split among the processes.
Trying to go too fast may be slow.
more...
I got a something old something new laptop and installed OpenBSD. And then the murders began.
more...
I ripped out a dependency and then I found out what it did. I wrote an RSS parser for a very simple project, and then figured, how hard could it be to use in a real feed reader? Well, not very hard, but it was somewhat time consuming, and offers another perspective on using other people’s code.
more...
Not just a new server, a news server, although ironically I think only the olds use the news now. It was really just an experiment in why not. It took me about three hours from opening a blank main.go to mostly done, which was good to cover the Becket joins Dr. Cuddy at the FBI arc on Castle. Then an afternoon faffing about making scripts to load up some content.
The first and most important thing to discuss is the name, nuset. It’s got all the same pheromones as Usenet, subliminally exerting mind control over the reader. In the local dialect, it’s pronounced more like newsd, rhymes with used, as if it’s used news. About right. I was thinking of telling people it’s named after the Assyrian god of information, and could probably get someone to believe that. Or maybe it’s nu-Set, the reincarnation of Set.
The NNTP protocol is specified by RFC 3977. It’s a pretty easy read, and filled with lots of examples, which I found very helpful. Read a section, then copy the client line into the parser and copy the server line into the output. There’s words, too, but it’s much less ambiguous to always see exactly the format of commands and results.
In hindsight, this would have been a good project to experiment with a new language. But I was lazy and already know where go keeps the textproto.DotWriter.
I’m not super into Gemini, the tiny web alike, in part because I think it’s fun to interact with people. But a tiny usenet, without all the spams and trolls, I could get into. Although I’m not there yet. I’ve only got enough commands working to allow local posting, not federation. A little more effort, and we could get there, though.
For now, I’m just mirroring content. You can check it out at nntp://flak.tedunangst.com. Subscriber exclusive: see the behind the scenes markdown I use to write posts!
It’s been one year since our previous adventure, so it’s time for another round of guess why that dependency shows up in the tarball. This time we’re looking at honk, an ActivityPub server that’s supposed to be idiosyncratic with minimal dependencies, so you can keep all your attention focused where it’s needed.
more...