Evan Hahn's blog

https://evanhahn.com/blog/

My blog, mostly about programming.

フィード

記事のアイキャッチ画像
Filling in the gaps of the internet
Evan Hahn's blog
Here’s a small philosophy I have about the internet:I believe that it’s my duty to publish the answer to previously-unanswered questions. That way, the next person who comes along has an easier time.For example, I was once trying to figure out how to skip the first line of a CSV file in Python. When I did a web search for “python skip first line of CSV”, I couldn’t find the answer.After a few minutes, I figured it out myself. Then, I wrote a quick blog post explaining my solution…and now it’s one of the most popular posts on my site! Even though the post only took a few minutes to write, it’s been one of my most viewed over the last decade, (presumably) because so many people are trying to do the exact same thing.Another post, showing how to disable ESLint for a single file, has been comparably visited. Same story: I figured out how to do something and wrote a few words about it. And now, a few times a year, someone DMs me telling me they came across my blog when trying to disable ESLi
2日前
記事のアイキャッチ画像
Notes from "Beyond Measure: The Hidden History of Measurement"
Evan Hahn's blog
I just finished James Vincent’s Beyond Measure, a 2023 book about the history of measurement and its impact on our lives.The book reveals how the meter’s length is tied to the French Revolution. It highlights many scientific discoveries linked to advances in measurement. It links land surveying and the genocide of Native Americans. It even explains why the US and UK stubbornly refuse to adopt the metric system!I took some notes while reading and thought I’d share them here.Introduction: Why measurement mattersThe metric system is perhaps the most significant side-effect of the French Revolution.Numbers can lie, and that includes measurement.Chapter 1: The kindling of civilizationThere are three main properties of a good measurement: accessibility, proportionality (“no one wants to measure mountains with matchsticks”), and consistency.Old measures of distance included “how much tobacco will I smoke on this journey” or the distance you can hear a dog’s bark.Chapter 2: Measure and the soc
8日前
記事のアイキャッチ画像
Why "alias" is my last resort for aliases
はてなブックマークアイコン 1
Evan Hahn's blog
Aliases were one of the first things I added when customizing my dotfiles. For example, here’s a very early alias I defined:alias g=gitNow, I can run g instead of git, which saves me a little time for a command I run dozens of times a day!# These two commands are now equivalent:git statusg statusI used to define these aliases with alias. After all…I’m defining an alias!But over time, I think I discovered a better way: a script in my $PATH.How it worksIn my home directory, I have a folder of scripts called bin. For example, here’s a simplified version of ~/bin/g:#!/usr/bin/env bashexec git "$@"Running this script basically just runs git.I add this folder to my $PATH. (See Julia Evans’s guide on how to do this.) In my .zshrc, I have a line like this:export PATH="$HOME/bin:$PATH"Now, when I type g, it runs that script.This behaves just like an alias. As before, g status and git status are equivalent.# These two commands are still the same:git statusg statusThis is a lot more verbose than
9日前
記事のアイキャッチ画像
An ode to my favorite mobile game
Evan Hahn's blog
I can’t stop telling my friends about Forward: Escape the Fold and now I’m telling you. I bought it more than two years ago and it’s my favorite mobile game by a mile.Forward describes itself as the “perfect bitesized roguelike dungeon crawler”. You control a character trying to escape a dungeon, and there’s just one way out: keep going forward.It’s a game about making lots of small decisions as your character gets repeatedly pummeled on the path to freedom. Do I attack this monster and hope it gives me treasure, or do I walk through a poison cloud to get a better position? Do I take the weaker powerup that will help me now, or the one that might later turn me unstoppable if I’m lucky? Over time, you develop an intuition for the best moves to make, but every run is still a challenge.The game is easy to pick up, the sessions are the perfect duration, and the controls are satisfying on a touchscreen. All of that adds up to a perfect mobile game.The game’s vibe is another standout. The mu
10日前
記事のアイキャッチ画像
Notes from February 2025
Evan Hahn's blog
Following my notes from last month, here are some ramblings from February 2025.I posted about LLMs and technical innovationI published “LLMs: harmful to technical innovation?”, a short post about how LLMs could maintain the status quo for technology. In short: newer ideas have less available training data, so the LLM experience will probably be worse.Here’s my favorite sentence from one of the comments:[…] it’s sad to think that what we have will be fossilized forever because LLMs can’t dream at all.“LLMs can’t dream”? Incredible. Using the verb “fossilize”? Wow. This is a good writer!A few days later, someone else published “AI is stifling tech adoption”, an essay with an identical thesis but different approach.Tech news I readSome tech news I read this month:The UK secretly ordered Apple to build a global backdoor into iCloud. This is a bad idea that misunderstands how backdoors work and opens the door for the UK to abuse their power. I liked “Apple’s Best Option: Decentralize iCloud
14日前
記事のアイキャッチ画像
How to play a file in reverse with mpv
Evan Hahn's blog
This post was last updated for mpv 0.39.Here’s how to use mpv to play a file in reverse:mpv --play-direction=backward my_video.mp4Or a shorthand:mpv --play-direction=- my_video.mp4However, it may not work well. To quote mpv’s docs:Backward playback is extremely fragile. It may not always work, is much slower than forward playback, and breaks certain other features. How well it works depends mainly on the file being played. Generally, it will show good results (or results at all) only if the stars align.I found this to be true in my cursory testing; mpv could play my videos in reverse but it had trouble. You can read much more about this on the mpv manpage.I couldn’t find this quickly documented anywhere so I thought I’d write this post!
1ヶ月前
記事のアイキャッチ画像
LLMs: harmful to technical innovation?
Evan Hahn's blog
In short: newer ideas have less available training data so the LLM experience will probably be worse. This could help existing technologies maintain their status.I’ve been playing with a few less-popular programming languages like Crystal, Zig, and Gleam. They’re super cool!I want more people to use them…but I understand why someone wouldn’t. Even if you pretend they’re 100% better on a “purely technical” level, you might choose a more popular language like Python because it has a bigger community. It’s easier to find Python programmers than Gleam programmers; there are more JavaScript libraries than Zig libraries; there are more tools made for Ruby than for Crystal.In other words, popularity can be self-perpetuating.I saw these ideas mentioned in “Why Gumroad Didn’t Choose htmx”, a story of how Gumroad evaluated htmx but ultimately decided to use React and Next.js, which are more established. Everything in the post felt level-headed and reasonable to me, even though I was rooting for
1ヶ月前
記事のアイキャッチ画像
Notes from January 2025
Evan Hahn's blog
Here are some poorly-organized notes from January 2025, which I hope might be of interest to somebody.A post of mine did well onlineThis month, I posted “My failed attempt to shrink all npm packages by 5%”. This post has been a draft since 2023 and I finally finished it.It did well, and I had a day of minor programmer fame.In the post, I chronicle my effort to compress JavaScript modules in a backwards-compatible way. I made an RFC to the npm folks, built proofs of concept, and attended a community meeting. Though the idea seemed like an obvious win at first, I later realized that the tradeoffs weren’t worth it and closed my proposal. I talked about the process and the lessons learned.To ensure someone would read it, I promoted my post in three places:On LobstersOn the fediverseOn EchoJS. (Nobody uses this site but everything I post there ends up in the popular JavaScript Weekly newsletter, and this was no exception.)Someone else took it to Hacker News, where it got the most attention.
1ヶ月前
記事のアイキャッチ画像
My experience upgrading from iPhone 11 Pro to iPhone 16 Plus
Evan Hahn's blog
In short: the phones are pretty similar, except for offline dictation which is much faster, making the upgrade worth it for my use case.I recently upgraded from an iPhone 11 Pro to an iPhone 16 Plus. My iPhone 11 was over 5 years old but in reasonably good shape, so I wasn’t sure about making the jump. After months of indecision, I made the switch.I’m writing this post for anyone else in a similar situation. I can’t tell you whether you should upgrade, but here were the differences I’ve noticed in the two weeks I’ve had the thing.Differences I’ve noticedHere are the main differences I’ve noticed between my iPhone 11 Pro and my iPhone 16 Plus:Much faster transcription. I’m a heavy user of Aiko, a simple app that does offline speech transcription. I use it to transcribe myself for things like notes, blog posts (like this one!), emails, and texts. I also use it to transcribe some podcasts and videos because it’s often faster to get the information that way.My 16 Plus is significantly fast
1ヶ月前
記事のアイキャッチ画像
Whisper transcription vs. iPhone 11 Pro and iPhone 16 Plus: an informal test
Evan Hahn's blog
In short: the iPhone 16 Plus is about twice as fast as the iPhone 11 Pro.Everyone seems to be talking about AI these days, but forget generative AI—I’m a constant user of dictation.I’m not an expert at any of this, but Whisper has been a game-changer for me, transforming transcription that felt ~90% effective to something that feels ~99% effective. I use it all the time! I transcribe my own voice a lot, dictating personal notes, emails, blog posts (like this one!), and even texts. I also sometimes transcribe other content, like podcasts and videos—it’s usually faster to read this stuff than to listen to it.When I was considering my upgrade from an iPhone 11 Pro to an iPhone 16 Plus, I wanted to know how much faster transcription would be. I use Aiko for this, and I wanted to know—how much faster would it be on the new phone? So I ran an informal test.I tested the transcription of two files:A 53-second video from Veronica ExplainsThe first chapter of a The Theory of the Leisure Class au
1ヶ月前