RSSAmplifier

Blog

Andrew Kelley

My personal website - thoughts, project demos, research.

andrewkelley.meRSS feed ↗39 posts

Latest posts

Don't Take the Black Pill (Text Adaptation)

Don't Take the Black Pill (Text Adaptation) This is a blog post version of the talk I delivered at Software Should Work 2026 . Shoutouts to Isaac Van Doren for running such a delightful conference and nailing it first try , and for infecting us all with his charming enthusiasm for Columbia, Missouri. Part 1: The Pill When I gave this talk, I warmed up the crowd by asking the audience who liked the…

My Thoughts on the Bun Rust Rewrite

My Thoughts on the Bun Rust Rewrite Context: Rewriting Bun in Rust History When Jarred joined the Zig community about 5 years ago, I described him as someone who had strong "beginner energy". That is, he moved fast and tried a lot of different stuff, jumping head first into problems that he was not yet equipped to solve, leading to mediocre outcomes in terms of engineering, but learning a whole…

Zig's New Async I/O (Text Version)

Zig's New Async I/O (Text Version) In celebration of the std.Io introduction patchset landing today , here is the text version of a short, interactive demo I gave at Zigtoberfest 2025 . This is a preview of the new async I/O primitives that will be available in the upcoming Zig 0.16.0, to be released in about 3-4 months. There is a lot more to get into, but for now here is an introduction into…

An Open Letter to Everyone I've Butted Heads With

An Open Letter to Everyone I've Butted Heads With Note: This blog post is not a reaction to recent events or some kind of apology. Nothing happened; this is just me doing self-reflection. Zig turned 10 years old , and I've been thinking a lot about the project overall, and what another ten years of my life might look like. More specifically, I've been thinking about my interactions with people…

Renting is for Suckers

Renting is for Suckers A genie offers you a choice: 50% chance to gain 10 million USD 100% chance to gain 1 million USD Which do you pick? Your answer, of course, depends on how much capital you have. If you are struggling to pay rent, then taking the less risky gamble is quite attractive, while if you already have 10 million sitting in the bank, it's a no-brainer to press the button with the…

OpenZFS Bug Ported to Zig

OpenZFS Bug Ported to Zig Someone on IRC shared this link with me: An (almost) catastrophic OpenZFS bug and the humans that made it (and Rust is here too) They wanted to know, would Zig catch this? I went through the trouble of porting the code snippet to Zig, so I thought I'd go the next step and turn it into a small blog post. Original snippet, in C: /* * This code converts an asize into the…

Zig's New CLI Progress Bar Explained

Zig's New CLI Progress Bar Explained Sometimes, programming projects are too easy and boring. Sometimes, they're too hard, never ending or producing subpar results. This past week I had the pleasure of completing a project that felt like maximum difficulty - only possible because I am at the top of my game, using a programming language designed for making perfect software. This problem threw…

Redis Renamed to Redict

Redis Renamed to Redict Redict was originally created by Salvatore Sanfilippo under the name "Redis". Around 2018 he started losing interest in the project to pursue a science fiction career and gave stewardship of the project to Redis Labs . I think that was an unfortunate move because their goal is mainly to extract profit from the software project rather than to uphold the ideals of Free and…

Why We Can't Have Nice Software

Why We Can't Have Nice Software The problem with software is that it's too powerful. It creates so much wealth so fast that it's virtually impossible to not distribute it. Think about it: sure, it takes a while to make useful software. But then you make it, and then it's done. It keeps working with no maintenance whatsoever, and just a trickle of electricity to run it. Immediately, this poses a…

The Techno-Optimist Manifesto

The Techno-Optimist Manifesto Technology is a tool that enhances the power of the wielder. Our tools are getting more and more powerful. Some tools, such as nuclear fission, are so powerful that they pose an existential threat to all of humanity, because human society has a history of wielding tools to maintain power over each other at any cost. The dark desire to subjugate one another is the…

So Long, Twitter and Reddit

So Long, Twitter and Reddit It's been over three years since my last blog post. I think that the website code started to feel like it had bitrotted, and so making new blog posts became onerous. But I've taken the time to redo this website using Zig , so it's quite easy to add blog posts now, and plus I added dark mode . Twitter Over the past few years I amassed a healthy number of followers on…

`zig cc`: a Powerful Drop-In Replacement for GCC/Clang

`zig cc`: a Powerful Drop-In Replacement for GCC/Clang If you have heard of Zig before, you may know it as a promising new programming language which is ambitiously trying to overthrow C as the de-facto systems language. But did you know that it also can straight up compile C code? This has been possible for a while, and you can see some examples of this on the home page . What's new is that the…

Why I'm donating $150/month (10% of my income) to the musl libc project

Why I'm donating $150/month (10% of my income) to the musl libc project One year ago, I quit my day job to work on Zig full time . Since then, the project has seen a steady growth in funding. Thanks to the people donating, Zig is on track to become fully sustainable before my savings run out. This support has allowed me to focus on steady improvements to the language and tooling. In the last year,…

Using Zig to Provide Stack Traces on Kernel Panic for a Bare Bones Operating System

Using Zig to Provide Stack Traces on Kernel Panic for a Bare Bones Operating System Last week, I reached an exciting milestone in my career as a programmer. For the first time in my life, I ran code directly on hardware , with no Operating System sitting between the bare metal and my code. For some context, the goal of this side project is to create a 2-4 player arcade game running directly on a…

String Matching based on Compile Time Perfect Hashing in Zig

String Matching based on Compile Time Perfect Hashing in Zig Inspired by cttrie - Compile time TRIE based string matching , I decided to see what this solution would look like in Zig. Here's the API I came up with: const ph = perfectHash([][]const u8{ "a", "ab", "abc", }); switch (ph.hash(target)) { ph.case("a") => std.debug.warn("handle the a case"), ph.case("ab") => std.debug.warn("handle the ab…

I Quit My Cushy Job at OkCupid to Live on Donations to Zig

I Quit My Cushy Job at OkCupid to Live on Donations to Zig I am fortunate to be one of those people who started tinkering with code in their teens, and then found themselves in the position where their hobby could not only pay rent, but afford a comfortable standard of living, even in New York City. For a little over a year now, I worked on the backend team at OkCupid , maintaining a large C++…

Zig: January 2018 in Review

Zig: January 2018 in Review One month (and a few days, sorry I'm late!) has passed since I did the December 2017 writeup , and so it's time for another month-in-review for my esteemed sponsors . LLVM 6 Readiness LLVM 6.0.0rc2 was just announced on the mailing list. It's scheduled to be released on February 21, and Zig is ready. I plan to have Zig release 0.2.0 one week after LLVM 6 comes out. We…

Unsafe Zig is Safer Than Unsafe Rust

Unsafe Zig is Safer than Unsafe Rust Consider the following Rust code: struct Foo { a: i32, b: i32, } fn main() { unsafe { let mut array: [u8; 1024] = [1; 1024]; let foo = std::mem::transmute::<&mut u8, &mut Foo>(&mut array[0]); foo.a += 1; } } This pattern is pretty common if you are interacting with Operating System APIs . Another example . Can you spot the problem with the code? It's pretty…

Zig: December 2017 in Review

Zig: December 2017 in Review I figured since I ask people to donate monthly , I will start giving a monthly progress report to provide accountability. So here's everything that happened in Zig land in December 2017: enum tag types You can now specify the tag type for an enum ( #305 ): const Small2 = enum (u2) { One, Two, }; If you specify the tag type for an enum, you can put it in a packed…

A Better Way to Implement Bit Fields

A Better Way to Implement Bit-Fields One of the main use cases for the Zig Programming Language is operating system development and embedded development. So, what better way to make sure the language is suitable than to work on a project in this field? This is why I am creating a 4-player arcade game that runs directly on the Raspberry Pi 3 hardware . The project has only just begun, but already…

Zig: Already More Knowable Than C

Zig: Already More Knowable Than C There is a nifty article created back in 2015 that made its way onto Hacker News today: I Do Not Know C . The author creates a delightful set of source code samples in which the reader is intended to determine the correctness, and if correct, predict the output of the provided code. If you have not done the exercises, I encourage you to take a moment to do so.…

Zig Programming Language Blurs the Line Between Compile-Time and Run-Time

Zig Programming Language Blurs the Line Between Compile-Time and Run-Time Zig places importance on the concept of whether an expression is known at compile-time. There are a few different places this concept is used, and these building blocks are used to keep the language small, readable, and powerful. Introducing the Compile-Time Concept Compile-time parameters Compile-time variables Compile-time…

Troubleshooting a Zig Regression with apitrace

Troubleshooting a Zig Regression with apitrace The past three months I have spent rewriting Zig internals. Previously, the compiler looked like this: Source → Tokenize → Abstract Syntax Tree → Semantic Analysis → LLVM Codegen → Binary Now the compiler looks like this: Source → Tokenize → Abstract Syntax Tree → Intermediate Representation Code → Evaluation and Analysis → Intermediate Representation…

Introduction to the Zig Programming Language

Introduction to the Zig Programming Language The past few months I took a break from working on Genesis Digital Audio Workstation to work, instead, on creating a new programming language . I am nothing if not ambitious, and my goal is to create a new programming language that is more pragmatic than C . This is like to trying to be more evil than the devil himself. So, in order, these are the…

Turn Your Raspberry Pi into a Music Player Server

Turn Your Raspberry Pi Into a Music Player Server A few months ago I published My Quest to Build the Ultimate Music Player , where I described some of the trials and tribulations that led to Groove Basin , an open-source music player server that I've been building off and on for almost 4 years. It ships with a web-based client, which looks like this: You can also tinker with the live demo version…

Laptop Review - Bonobo Extreme

Bonobo Extreme Review I used to have a Dell Inspiron XPS 13 Developer Edition . It was fine, but I needed something with a better graphics card because I wanted to learn some of the new OpenGL features by prototyping a 3D space flight simulator game . I decided to buy the Bonobo Extreme laptop which comes with Ubuntu pre-installed. This thing is a monster. It's huge, bulky, and heavy. Check out…

My Quest to Build the Ultimate Music Player

My Quest to Build the Ultimate Music Player Over the past few years, I have been slowly but surely building my own music player. It's been a wild ride. The codebase has radically changed several times, but is always converging on a better music listening experience. In this article my goal is to take you along for the ride. See the project on GitHub Table of Contents Table of Contents I <3 Amarok…

Do Not Use bodyParser with Express.js

Do Not Use bodyParser with Express.js Note: this post has been edited to take into account TJ 's diligent work in response to this. I came across this Google+ post mentioning this StackOverflow post in which someone is quite wisely asking whether the express.js framework is secure enough to use for production applications. This reminds me of one "gotcha" in particular that you could be bitten by…

JavaScript Callbacks are Pretty Okay

JavaScript Callbacks are Pretty Okay I've seen a fair amount of callback bashing on Hacker News recently. Among the many proposed solutions, one of them strikes me as particularly clean: "asynchronous wait" or "wait and defer". iced-coffee-script had this a while ago. Kal just debuted with an identical solution, only differing in syntax. Supposedly LiveScript supports this with "backcalls" . I…

I am not a "JavaScript Developer".

I am not a "JavaScript Developer". It seems that the tech world is trying to thrust upon me an identity which I do not hold. GitHub puts "JavaScript" right under my name: Here are snippets from actual emails I've received from recruiters: We are currently expanding our Engineering team here in New York City and are looking for a JavaScript Developer to join our team. I think you'd be a great fit.…

7dRTS Game Reviews

7dRTS Game Reviews We all have limited time. This is a guide to help you decide which 7dRTS games to play, and which you might unfortunately have to skip if you don't have time to play them all. It is only one person's opinion. I haven't played these yet Power Grab XenoCombat Congregation Craft and Conquer TAvA TANKBOX 30XX War Shape Frisk Demon Front, A Hero-centric RTS System Command 3D Chess…

Pillagers! 7dRTS Game Development Journal

Pillagers! 7dRTS Game Development Journal I have decided to participate in the 7-Day Real Time Strategy Challenge, July 2013 edition . I am working with Michael Weber who will create sound effects, music, and be in charge of the "atmosphere" of the game. Day 1 Cross-posted on ludumdare.com . I am using chem , a canvas-based game engine I made for rapid development occasions such as this. It has…

Private Methods in JavaScript

Private Methods in JavaScript In JavaScript, we don't have private methods right? We must to resort to using this._somePrivateThing() right? Wrong. Before function Cell(x, y) { this.x = x; this.y = y; this.things = [1, 2, 3]; // I guess I'll have to use an underscore to indicate that this // method is private. this._initializeSomethingElse(); } Cell.prototype._initializeSomethingElse = function()…

Spot the Fail

Spot the Fail It's time to have a little fun. Sometimes when I'm programming, I do something so comically stupid that I feel the need to screenshot the code and share my facepalm moment with someone else. There are a couple guidelines for my flavor of Spot the Fail: Guidelines The fail should be spottable even if you do not know the context of the code. For trickier ones, the mouse or text cursor…

Statically Recompiling NES Games into Native Executables with LLVM and Go

Statically Recompiling NES Games into Native Executables with LLVM and Go I have always wanted to write an emulator. I made a half-hearted attempt in college but it never made it to a demo-able state. I also didn't want to write Yet Another Emulator. It should at least bring something new to the table. When I discovered LLVM , I felt like I finally had worthwhile idea for a project. This article…

Rapid Development Email Templates with Node.js

Rapid Development Email Templates with Node.js Contents Sending Automated Emails in Node.js node-email-templates Gotchas Fundamental Flaws Includes VS Template Inheritance Sharing CSS Dummy Context Conclusion Sending Automated Emails in Node.js When I was tasked with solving the age-old problem of sending automatic email messages to our users at Indaba Music , I surveyed the Node.js landscape to…

How to be Successful at PyWeek

How to be Successful at PyWeek A short series to help you win. Covers these topics: What PyWeek is, and Why You Should Participate Video Games in Python Speed Developing Game Theory - How to Create Fun Getting the Most Out of the Community The Psychology of Judging Conclusion What PyWeek is, and Why You Should Participate PyWeek is a challenge. It asks you to spend one week of your life developing…

John Muir Trail from the Perspective of Andrew Kelley

John Muir Trail from the Perspective of Andrew Kelley 198 miles - July 24, 2011 through August 4, 2011 Journal Entries Day 1 - First Day of Hiking Day 2 - Donahue Pass to Some Lake Day 3 - Some Lake to Deer Creek Crossing Day 4 - Halfway to Duck Lake to Mono Creek Day 5 - Mono Creek to Senger Creek Day 6 - Senger Creek to Something Meadow Day 7 - Muir Pass Day 8 - Mather Pass, Almost Day 9 - The…

Lemming - PyWeek #12 Game Development Journal

Lemming - PyWeek #12 Game Development Journal PyWeek #12 challenge starts in 2 days, 16 hours, and 11 minutes. And I have 23 hours of homework to do in order to clear the Week of Py for development. I've plotted out THIS week in Google Calendar (the week before PyWeek) - an entry for homework time, break time, and even sleep time. I'm following a strict schedule for optimum time management during…