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.


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...


Reasons to Migrate away from Gatsby banner

Reasons to Migrate away from Gatsby

Gatsby is a site generation framework. I recently was using it for one of my side projects, sff.life, a site dedicated to small form factor computing (eg: small computers). I decided to migrate away from Gatsby, as it is not a zero cost abstraction for static sites for two reasons: Needless bloat via javascript and JSON bundles Way too many dependencies and releases Before I give a bit more background and expand on these reasons, I still believe that in many situations, Gatsby benefits outweigh the costs.

Read more...


Opinionated Guide for Web Development with Rust Web Workers banner

Opinionated Guide for Web Development with Rust Web Workers

I have a toy site that parses Rocket League replays using the rust crate boxcars. Parsing replays is done synchronously and shouldn’t block the browser’s UI thread, so parsing is offloaded to a web worker. Getting this side project to a point where it works + is maintainable (minimum configuration) has been an exercise in doggedness as I spent weeks exploring options. I believe I’ve found a happy medium and here’s the recipe:

Read more...