Evan Hahn's blog

https://evanhahn.com/blog/

My blog, mostly about programming.

フィード

記事のアイキャッチ画像
LLMs: harmful to technical innovation?
はてなブックマークアイコン 1
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
4日前
記事のアイキャッチ画像
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.
6日前
記事のアイキャッチ画像
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
9日前
記事のアイキャッチ画像
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
9日前
記事のアイキャッチ画像
My failed attempt to shrink all npm packages by 5%
はてなブックマークアイコン 5
Evan Hahn's blog
In 2022, I had an idea that could decrease the size of all newly-published npm packages by about 5%, and it was completely backwards compatible. This would have improved performance and reduced storage costs.I eagerly pitched this idea to the npm maintainers, convinced it was a clear win. But after a few months, my proposal was rejected. To be clear: I think this was the right call!Here’s what happened. I hope this story will be useful to others.Technical backgroundTwo things to know before diving in: how npm packages are distributed, and about the Zopfli compressor.npm packages are just gzipped tarballsFirst thing to know: npm packages are distributed as tar archives compressed with gzip. In other words, they’re just .tar.gz or .tgz files.You can download these archives using npm pack $PACKAGE_NAME:npm pack express && ls# => express-4.21.2.tgzIf you extract this tarball, you’ll see all of the package’s files, such as package.json.Zopfli, a gzip-compatible compressorThe second thing to
10日前
記事のアイキャッチ画像
string-timing-safe-equal, a new Node package
Evan Hahn's blog
I just published string-timing-safe-equal, a small Node package that compares strings in a way that’s resistant to timing attacks and handles Unicode weirdness. It’s basically a version of crypto.timingSafeEqual() that works with strings.If you’re not familiar, this mitigates timing attacks. In short, a hacker could use the duration of a string comparison to learn about a secret string.Example usage:import timingSafeEqual from "string-timing-safe-equal";timingSafeEqual("abc", "abc");// => truetimingSafeEqual("abc", "xyz");// => falseHope this is useful!
22日前
記事のアイキャッチ画像
A black cat in 2032 bytes
Evan Hahn's blog
Taper describes itself as “an online literary magazine for small computational pieces”. Submissions need to be 2048 bytes or fewer.I submitted this little piece, “Light Switch”, to their 13th issue:The rest of this post describes how I did it.Shrinking the imageThe black cat is the most significant part of the piece. It’s a highly-edited version of a photo I took:This is a cute picture but it’s 2.5 megabytes, which is over 1000 times too big.After a lot of editing, I crushed it down to a 502-byte PNG. Here’s what it looks like in the final submission:I went through several steps to achieve this.I started by using iOS’s “lift a subject” feature to isolate the cat and remove the background. I still needed to do some editing, but it was a helpful first pass.I used Squoosh to change the color palette to just black and transparent. Black-and-white PNGs are generally smaller because each pixel can be stored with just one bit (0 for black, 1 for white/transparent)1. I also shrunk the image to
1ヶ月前
記事のアイキャッチ画像
Makeshift hot reload: my submission to HTMHell 2024
Evan Hahn's blog
HTMHell’s Advent Calendar is a December celebration of cursed web development topics.My submission, “Makeshift hot reload”, was just published. It talks about a hacky, primitive alternative to hot reloading.Go give it a read!
2ヶ月前
記事のアイキャッチ画像
95% is very different from 99%
Evan Hahn's blog
This post is a rant.I feel a vast difference between interfaces that work most of the time and ones that seem to work every time.Some interfaces that mostly work:AutocorrectGenerative AIFraud/bot detectionVideo game motion controlsWireless connections like wifi, BluetoothAudio transcriptionThese tools can be useful, but I think lots of people have been frustrated by them. Many of us have sent the word “ducking” in a text when they meant to say…a different word. Who hasn’t gotten annoyed at unreliable wifi or Bluetooth? Who hasn’t seen an AI “hallucination”?Other interfaces feel like they work 100% of the time:Pen and paperPhysical keyboards and miceTraditional video game controllers with buttonsWired connectionsFiles on your computerKitchen appliancesNone of these systems are perfect—I’ve had pens with low ink, files corrupted, wires frayed—but I think these frustrations are of a different class.I use my computer’s file system every day, and though I occasionally run into problems, the
3ヶ月前
記事のアイキャッチ画像
A little trick to reduce Zoom bandwidth
Evan Hahn's blog
In short: use Zoom’s floating thumbnail window to use less bandwidth.Video calls use a lot of data, and Zoom is no exception.If you’re on a call with a bunch of people and you want to reduce your data usage, here’s a simple trick: put Zoom into a mini floating thumbnail window. Instead of showing everybody on the call, it will just show one person in a tiny window, and it will only load that person’s tiny video.Here’s what that little window looks like:When doing this, I noticed my downloads go from about 900 kb/s to about 175 kb/s. That’s about ⅕ the size!Of course, it has a big disadvantage: you can only see one person in a tiny box! But it’s sometimes useful to do this when you’re having connection issues or you’re on a poor network. It can be a good alternative to asking everyone to turn their video off.This is a small tip, but I hope it’s useful!
3ヶ月前