Welcome to nickb.dev, a blog by Nick Babcock! Below are my most recent articles. You can find the history of all my writings in the archive or just find out more about me.


Stumbling with WebGL Image Processing banner

Stumbling with WebGL Image Processing

I’ve tried to learn WebGL to reimplement an image processing pipeline that I have setup on the CPU that involves indexed colors, edge detection, pixel-art upscaling, and more but the steep learning curve combined with other life changes has caused me to temporarily abandon the effort. I thought I’d document my thoughts so that I have a point of reference when explaining to others.

Read more...


Cargo Workspace and the Feature Unification Pitfall banner

Cargo Workspace and the Feature Unification Pitfall

In Rust, workspaces help organize a project into smaller packages. The downside is if there are shared dependencies that list different features, then one will most likely see unexpected behavior when compiling just a single package. This post shows an example of when this can occur and what solutions exist.

Read more...


Leveraging Rust to Bundle Node Native Modules and Wasm into an Isomorphic NPM Package banner

Leveraging Rust to Bundle Node Native Modules and Wasm into an Isomorphic NPM Package

I recently published highwayhasher as an npm package. It exposes Google’s HighwayHash to the JS world through the pure Rust reimplementation. Browsers will use the Wasm implementation while nodejs installations will use native modules built against hardware intrinsics. Both implementations expose the same API so clients don’t need to worry about which implementation is selected.

Read more...


Writing a Secure Systemd Service with Sandboxing and Dynamic Users banner

Writing a Secure Systemd Service with Sandboxing and Dynamic Users

This post will walk one through a real world migration on how to apply the principle of minimal privilege to a systemd service. This is accomplished by extracting sensitive configuration fields into an environment file, templating the config, running the service as a dynamic user, and sandboxing the application with systemd primitives.

Read more...


A Quick Tour of Trade-offs Embedding Data in Rust banner

A Quick Tour of Trade-offs Embedding Data in Rust

Embedding data in Rust code can be good idea so one doesn’t worry about acquiring the data at runtime. However, how one goes about bundling data in the application can have a significant impact on compile times, code size, and runtime performance.

Read more...


Designing a Decaying Leaderboard with Redis banner

Designing a Decaying Leaderboard with Redis

The EU4 achievement leaderboard and save file analyzer, Rakaly, has several requirements when it comes to maintaining the leaderboard. One of these requirements is to have current leaderboard submission decay overtime as EU4 receives updates. Redis has tools builtin to cater to this use case

Read more...


Results of Authoring a JS Library with Rust and Wasm banner

Results of Authoring a JS Library with Rust and Wasm

I recently overhauled a JS parsing library to delegate to the Rust implementation via Wasm. The result to users is seamless as the small Wasm bundled is inlined in the library as base64 encoded. Along the way, I saw that parsing can be much faster than object creation.

Read more...


Migrating a 160k Word Jekyll Blog to Hugo banner

Migrating a 160k Word Jekyll Blog to Hugo

At 160k words, this is by no means a small blog. When years of annoyances with Jekyll boiled over, I decided to migrate the Jekyll blog over to Hugo. The results were amazing and will hopefully lower the barrier needed for me to continue writing unencumbered.

Read more...


Backblaze B2 as a Cheaper Alternative to Github's Git LFS banner

Backblaze B2 as a Cheaper Alternative to Github's Git LFS

When cost optimizing, consider using Backblaze B2 over Github’s git LFS. B2 has a much more generous free tier compared to Github’s: 10x more storage (10GB vs 1GB) and 30x more bandwidth (30GB vs 1GB). Even after exceeding the free tier, Github’s git LFS still commands a 12x price premium. Before abandoning git lfs, there are several tips to keep in mind.

Read more...


My Bet on Rust has been Vindicated banner

My Bet on Rust has been Vindicated

I chose Rust for a project and I had struggles along the way which made me second guess this decision, but after releasing and fulfilling use cases I hadn’t considered, the decision was vindicated. The wins that Rust brings outweighed any struggles.

Read more...