Skip to main content

Mike Kreuzer

Do not adjust your sets

August 6, 2024

I'm deep in the depths of a Canberra winter & I've been messing around with the styles on this site for my amusement. As they used to say on the idiot box: do not adjust your sets.

I've been continuing on my minimalism kick. I got rid of the custom font files, which means most pages on the site now weigh in at around 30 instead of 100KB. On the horror show that is the modern web if those were megabytes instead nothing would seem out of place.

The font combinations are from the Modern Font Stacks site, & some of those should be on most devices already.

I've been thinking some more too about the Gemini Protocol, & maybe moving a copy of this site into that world. The heyday of Gemini was probably during the lockdowns, but it still feels like it might be worth it. The aesthetics are certainly a good fit for me.

Tags:

Elixir and Rust - Mea culpa, mea maxima culpa

July 21, 2024

I've been down on Rust lately. Unfairly so. I may even have said – what I totally did say was – "Rust is a terrible language for game development. Probably a terrible language for any app with a GUI right now. Again there are things to like, but more things not to."

Mea culpa, mea maxima culpa. Rust can be a terrible language. It can certainly be used terribly. Lord knows, I've tried. But for the right sort of problem. Where the solution to the problem's framed in the right sort of way… it can work well. It does have a lot going for it. More than I may have implied (than I totally, literally said).

Even if the only thing Rust had going for it was that it wasn't beholden for its existence to one of the giant tech companies that would still be a lot. C# is only ever going to be as open source as Microsoft wants it to be. Kotlin is only ever going to do what Google tells JetBrains to do with it, and theirs is the only Kotlin IDE in town. Swift got result builders because Apple wanted them, & when Apple says jump the answer isn't ever going to be anything but a gung ho "how high?" But the problem Rust is used to solve has to be framed just so.

All of the pain (& a lot of the payoff) in Rust revolves around its rules for references. Any number of read-only ones, or just the one at any one time if it's a mutable reference. Which is fine if the problem's simple. Or small. Or both. It gets harder to do when a problem's large & changing as it's solved, which is what happens often in game development, but it can probably be done.

Rust is not the solution to every problem, & it is galling – which was the source of my, ahem, recent outburst… s (plural) – to be forced to jump through hoops when the business logic prevents the kind of race condition this is all meant to prevent from ever occurring any way. But that's probably a function of breaking up the problem the wrong way. Possibly. It's a baby/bathwater situation, not any kind of breach.

There's a great explanation of ownership on without.boats I read recently, in References are like jumps, & Ownership, that I wouldn't even attempt to summarise here. Interestingly Mojo & Lattner come up again in the context of value semantics. Less flatteringly, as you might guess.

While I'm at it…

The Elixir community on Reddit sucked, but is probably not necessarily all that representative of the Elixir community generally. I have been tempted by the language once or twice again over the years since bad mouthing it here & flouncing away from it. I could never really find a problem big enough to warrant solving with what Elixir brings to the table, but small enough that it couldn't already be done with some combination of other more readily available tools though. Add Redis for caching, Systemd for restarts, or whatever, & most any server-side language can do what Elixir does without having to leave the mainstream behind. (This may not be helping…)

I used Elixir in anger when I self hosted an instance on the Fediverse. That was with Akkoma. I never dug too deeply into the code, & was luckily never personally a victim of "Akkoma Database Rot", where the database gradually falls apart because of some strange schema/JSON choices made with it, so while I don't think I'd recommend it, for the short time I ran it, it ran OK. It wasn't the problem with self hosting.

I did also write a toy Gemini server in Elixir for fun just the other week. But I also wrote one in C#, Go, Python, Ruby, Rust & Swift too. I was interested in playing around with how the different languages deal with TCP & TLS connections, & with the Gemini Protocol. This is Gemini the minimalistic Gopher-like set up, not Gemini the Google AI model. It's really a very small thing a Gemini server, perfect to play with.

But none of that makes me an Elixir developer any more than it makes me a Go developer. Just a curious one. That much hasn't changed.

Chris Lattner on Swift

July 14, 2024

Chris Lattner the original author of the Swift language has had a few things to say about it. Lattner's working on a new language called Mojo so he's out & about spruiking that.

The interview's on YouTube, and is worth watching in full, but the money quote on Swift to my mind starts at about 22 minutes, depending on ads & other annoyances, & it's worth quoting the man at length:

Swift, the original idea was factor complexity. So you have really powerful features that are available and accessible within the language, but you don't thrust them in peoples' face[s], you make it so that it's simple to get going then powerful as you dig in, and so progressive disclosure of complexity is this UI paradigm which is, you know, you can have powerful things that are simple to learn, but then enable power users to discover the power as they progress in their experience instead of thrusting all that complexity into their faces all at once…

that was a big focus of my work on Swift, a big focus of the early language. Massively failed in my opinion by the way. So massive lessons learned. Swift has turned into a gigantic, super complicated bag of special cases, special syntax, special stuff. It's all locally well intentioned…

it had a lot of internal technical debt because it was built very rapidly & we didn't expect the adoption to be so quick, & so the whole team was behind, & then instead of fixing the core what the team did – both when I was there, so partially my fault, but also subsequently – was they started adding all these special cases. There's also some things like SwiftUI added result builders & stuff like this. Result builders is a well intentioned meta programming thingy, you get rid of commas to make some code look better on a slide, right. So, a lot of the stuff got added under extreme time pressure to enable a feature like SwiftUI, & there are good aspects to it, but it's one of the reasons that Swift compile times are not great…

…Swift is still a beautiful language, it's amazing, & it's got a lot of really great things in it, but I can't say it's a simple language…

With apologies for any transcription errors on my part.

Now, he's said similar things before. I've said this sort of stuff before on this blog and elsewhere as a simple user of the language. My 2021 post still sums up the history of the language pretty well I feel. But to hear the man himself say it. Oof.

Tags:

Previously

Earlier posts...