212 results for "":

The curse of strong typing

It happened when I least expected it.

Someone, somewhere (above me, presumably) made a decision. “From now on”, they declared, “all our new stuff must be written in Rust”.

I’m not sure where they got that idea from. Maybe they’ve been reading propaganda. Maybe they fell prey to some confident asshole, and convinced themselves that Rust was the answer to their problems.

NeverJam: the game jam jam game

Our January project was ambitious: a 2D puzzle game, a-la lemmings with a twist, with big and numerous levels. And of course, all using our homegrown tools, from the compiler to the level editor to the UI system and game framework.

However, January ended too soon, and, sleepless nights notwithstanding, I had to resolve to publish something completely different. It was a good occasion to get to know Twine.

The thumbnail for this page

Improving error handling - panics vs. proper errors

Before we move on to parsing more of our raw packets, I want to take some time to improve our error handling strategy.

Currently, the ersatz codebase contains a mix of Result<T, E>, and some methods that panic, like unwrap() and expect().

We also have a custom Error enum that lets us return rawsock errors, IO errors, or Win32 errors:

pub enum Error { Rawsock(rawsock::Error), IO(std::io::Error), Win32(u32), }

ooc generics and flawed designs

ooc is perhaps one of my proudest achievements, but at the same time it’s one of the most annoying thorns in my side.

The main reason is that its design is flawed, and some things can’t be easily fixed at this point. Now don’t get me wrong: every design is flawed to some extent. Design, either when done by a lone coder, or by a committee, never comes out “perfect” — ignoring the fact there is no universal/objective measure of “perfectness”.

The thumbnail for this page

Don't shell out!

In this series, I change a critical component of this website’s asset pipeline from “just calling a bunch of external tools” to statically linking with everything I need to process assets. It involves autoconf, CMake, Meson, CI, pkg-config, and some code crimes.

The thumbnail for this page

The builder pattern, and a macro that keeps FFI code DRY

Our ping API is simple, but it’s also very limited:

pub fn ping(dest: ipv4::Addr) -> Result<(), String> // called as: ping(ipv4::Addr([8, 8, 8, 8])).unwrap();

It doesn’t allow specifying the TTL (time to live) of packets, it doesn’t allow specifying the timeout, it doesn’t let one specify the data to send along, and it doesn’t give us any kind of information on the reply.

I won free load testing

Long story short: a couple of my articles got really popular on a bunch of sites, and someone, somewhere, went “well, let’s see how much traffic that smart-ass can handle”, and suddenly I was on the receiving end of a couple DDoS attacks.

It really doesn’t matter what the articles were about — the attack is certainly not representative of how folks on either side of any number of debates generally behave.

The thumbnail for this page

Just paying Figma $15/month because nothing else fucking works

My family wasn’t poor by any stretch of the imagination, but I was raised to avoid spending money whenever possible.

I was also taught “it’s a poor craftsman that blames their tools”, which apparently means “take responsibility for your fuckups”, but, to young-me, definitely sounded more like “you don’t deserve nice things”.

I was also taught from an early age that I was born a sinner, incapable of doing good by myself, and that all the earthly things were temptations, sent by the devil to corrupt me (further I guess?) but also temporary, and that I shouldn’t attach myself.

The thumbnail for this page

Trying to use nix

Now that my website is deployed as a container image, I wanted to give nix a try. I’m still doing it the old-fashioned way right now: with a Dockerfile, running cargo in a “builder” image, copying stuff out of there into a slimmer image (that still has an Ubuntu base, even though distroless images are a thing now).

But why?

I was mostly interested in nix because some parts of my website have pretty big native dependencies. futile itself mostly relies on sqlite3 and some JS engine (used to be quickjs, currently duktape because MSVC Windows builds). But the asset processing pipeline, salvage (which I’d like to integrate with futile at some point) has a bunch more!

The thumbnail for this page

In the bowels of glibc

Good morning, and welcome back to “how many executables can we run with our custom dynamic loader before things get really out of control”.

In Part 13, we “implemented” thread-local storage. I’m using scare quotes because, well, we spent most of the article blabbering about Addressing Memory Through The Ages, And Other Fun Tidbits.

But that was then, and this is now, which is, uh, nine months later. Not only am I wiser and more productive, I’m also finally done updating all the previous thirteen parts of this series to fix some inconsistencies, upgrade crate versions, and redo all the diagrams as SVG.