HNHacker News
TopNewBestAskShowJobs

peterldowns

4,615 karma · joined October 20, 2010

https://peterdowns.com

https://github.com/peterldowns

https://twitter.com/peterldowns

Always happy to meet a stranger, please reach out any time: hn @ peterdowns.com

[ my public key: https://keybase.io/peterldowns; my proof: https://keybase.io/peterldowns/sigs/9N-85LOZH1eJMXHLR70WroivxJB1is_s3ye5IT5xzxs ]

submissionscomments
peterldowns··on Accidentally Made a Zig Dotenv Parser
Why do you have so many ads in this blog post?
peterldowns··on I have a GPS bike computer
Would be nice to see an example of one of these cue sheets, I'm curious about the layout.
peterldowns··on NYC Telecom Raid: What's Up with Those Weird SIM Banks?
How did that work economically? Who paid for you to do that and how was it worth it for them to do so?
peterldowns··on The Secret Service found 300 servers capable of crippling NYC's cell system
Direct from them: https://www.secretservice.gov/newsroom/releases/2025/09/us-s...
peterldowns··on Altoids by the Fistful
One object level suggestion is you shouldn't be doing string formatting manipulation to construct valid YAML objects as part of your ops pipeline; instead, do it all with actual data structures and then just render the result. Yes, I know that Helm directly encourages text templating — it's bad and wrong.

Beyond that, this a too-long essay about a deeply poisonous and discouraging worldview. I regret having read it. At least it wasn't written by AI!

peterldowns··on Logging in Go with Slog: A Practitioner's Guide
I know it didn't escape anyone; I'm explaining the downside to the choices made by the stdlib authors, from my perspective. When performance is a concern, people pick uber/zap.Logger or zerolog. When performance isn't a huge concern, slog is overly complicated and annoying. I believe you understand my complaint.
peterldowns··on Logging in Go with Slog: A Practitioner's Guide
1) Right, but this is complicated and annoying. Imagine a world where you could just pass your existing logger in, because my library references an interface like `stdlib/logging.GenericLoggerInterface` and slog, zap, zerolog, etc. all implement that! Would be nice!

2) TIL about `T.Output`, thank you, that's great to know about. Still annoying and would be nice if the slog package showed an example of logging from tests with correct callsites. Golang gets so many things right about testing, so the fact that logging in tests is difficult really stands out and bothers me.

peterldowns··on Logging in Go with Slog: A Practitioner's Guide
That's close, but not what I meant — that's specific to this package, and is the interface for processing log records produced by a slog.Logger. What I mean is that there should be a single interface for Logging that is implemented by slog.Logger, uber/zap.Logger, etc. that library authors can use without needing to reinvent the wheel every time.

For an example from one of my own libraries, see

https://github.com/peterldowns/pgmigrate/blob/d3ecf8e4e8af87...

peterldowns··on Logging in Go with Slog: A Practitioner's Guide
It's fine for application logging but I have two gripes with slog:

1) If you're writing a library that can be used by many different applications and want to emit logs, you'll still need to write a generic log interface with adapters for slog, zap, charmlog, etc. That the golang team refuses to bless a single interface for everyone to settle on both makes sense given their ideological standpoint on shipping interfaces and also causes endless mild annoyance and code duplication.

2) I believe it's still impossible to see the correct callsite in test logs when using slog as the logger. For more information, see https://github.com/neilotoole/slogt?tab=readme-ov-file#defic.... It's possible I'm out of date here — please correct me if this is wrong, it's actually a much larger annoyance for me and one of the reasons I still use uber/zap or charmbracelet/log.

Overall, especially given that it performs worse than uber/zap and everyone has basically standardized on that and it provides essentially the same interface, I recommend using uber/zap instead.

EDIT: just to expand further, take a look at the recommended method of wrapping helper methods that call logs. Compare to the `t.Helper()` approach. And some previous discussion. Frustrating!

- https://pkg.go.dev/log/slog#example-package-Wrapping

- https://github.com/golang/go/issues/59145#issuecomment-14770...

peterldowns··on The origin story of merge queues
No mention of Graphite.dev? Oh, it's written by Mergify, got it.
peterldowns··on Exploring Grid-Aware Websites
Well-written blog post about something I had never, ever, considered. Maybe one day this will come up and I'll remember that something like this is possible. The general trick of "rewrite the entire webpage based on some external API status" seems like an interesting and powerful (... and dangerous) tool.

In terms of achieving the overall goal of "greening" the web, I would be very interested to see even some back-of-the-envelope math explaining how much energy this technique saves and how much of an impact that would have. Understanding the energy cost of webpages and massive edge rewriting serverless platforms like Cloudflare is unintuitive to me.

Cynically, my impression is that the overall approach is more like "greenwashing" than "greening" — at best I would guess it "raises awareness", with all of the implications to efficacy that such actions usually have. I followed the links through from the blog to The Green Web Foundation's FAQ [0] and did not find any tangible estimates of energy impact nor any attempts at measuring such an impact. The success metrics [1] they list do not include any measure of energy saved or understanding of the potential to save energy; rather, basically just attention.

[0] https://www.thegreenwebfoundation.org/tools/grid-aware-websi...

[1] https://www.thegreenwebfoundation.org/tools/grid-aware-websi...

peterldowns··on European Commission fines Google €2.95B over abusive ad tech practices
Can someone elaborate on the first accusation — "DFP favours AdX over rival Ad exchanges by e.g. informing it in advance of the best bid from competitors"? I'd be really curious to understand how it does this, like what information is actually shared that isn't also shared with other ad exchanges.
peterldowns··on I ditched Spotify and set up my own music stack
Just to pile on the terrible Apple Music UI — it's so unnatural and baffling to me. One example that really takes the cake is that there is no ability to set a sleep timer in the app. After having to google it, the only way I've found is to set a timer in the Clock app and change its ringtone to be an "action" of stopping all playing audio. WHY???
peterldowns··on Almost anything you give sustained attention to will begin to loop on itself
Given your interest in BCH, you may enjoy Non-places: An Anthropology of Supermodernity by Marc Augé. BCH draws on a lot of Augé's ideas from this book in Psychopolitics. It is obtuse and either poorly-translated or badly-written but the ideas are excellent.
peterldowns··on An illustrated guide to OAuth
Ancient, but potentially also helpful due to documentation and tests, is my old django implementation: https://github.com/peterldowns/djoauth2 . I’m sure it doesn’t run out of the box anymore due to Django changes but maybe another good reference server.
peterldowns··on The Rise and Fall of Music Ringtones: A Statistical Analysis
Yup, pain in the ass but quite possible. Check out this 100gecs ringtone I made as an example (warning — autoplay ringtone audio):

https://freezine.xyz/2/my-boys-got-his-own-ring-tone/index.h...

peterldowns··on AI is predominantly replacing outsourced, offshore workers
“AI reshoring” is what I call it. Makes perfect sense.
peterldowns··on Intermittent fasting strategies and their effects on body weight
"Try running 50+ miles a week in order to eat more" is an insane suggestion.
peterldowns··on Show HN: The current sky at your approximate location, as a CSS gradient
That's a cool thing to know, thanks for sharing. Great job on the sky site!
peterldowns··on Ozempic shows anti-aging effects in trial
That's like 4000 calories. How much do you weigh / what's your exercise like?
peterldowns··on 303Gen – 303 acid loops generator
Doesn't work in firefox, console tells me

Uncaught TypeError: a.frequency.cancelAndHoldAtTime is not a function

Pretty fun in Chrome!

peterldowns··on Show HN: I built a text-based birthday reminder app
Hey, cool looking product! Why do I want this instead of just adding birthdays to my existing calendar and setting reminders there?
peterldowns··on What is gVisor?
In the past I'd heard people recommend against gVisor, and recommend looking at firecracker instead, because of I/O overhead. Is that something you've noticed at Modal? Obviously you're happy with gVisor, not suggesting you switch, just curious about your experience.
peterldowns··on Use Your Type System
Strongly Typed Identifier

https://en.wikipedia.org/wiki/Strongly_typed_identifier

> The strongly typed identifier commonly wraps the data type used as the primary key in the database, such as a string, an integer or universally unique identifier (UUID).

peterldowns··on Use Your Type System
My friend Lukas has written about this before in more detail, and describes the general technique as "Safety Through Incompatibility". I use this approach in all of my golang codebases now and find it invaluable — it makes it really easy to do the right thing and really hard to accidentally pass the wrong kinds of IDs around.

https://lukasschwab.me/blog/gen/deriving-safe-id-types-in-go...

https://lukasschwab.me/blog/gen/safe-incompatibility.html

peterldowns··on Trying Guix: A Nixer's impressions
Very interesting writeup, as a long-time Nix user I've always been interested in trying guix but never gotten around to it. Great post overall.

> The thing is, I'm not actually sure if Guix's better documentation helps smooth the onboarding in any way because you have to already know Scheme, which is a more complex language than Nix.

LMAO absolutely not. Nix-the-language is the worst programming language I've ever had the misfortune to interact with. I picked up Scheme in about 1 day during a class in college. It's night-and-day different.

peterldowns··on An average human breathes out roughly 1kg of carbon dioxide a day
Sorry, my phrasing was not clear. Your metabolic rate is generally lower during sleep than during the day; you definitely lose more weight overall during the day than while asleep. But, while you're sleeping, you don't eat anything. And quality sleep is necessary to maintain overall metabolic function. I'm not a scientist and didn't mean to make any strong claims!

Two short articles I was basing this off of:

- "When somebody loses weight, where does the fat go?" https://www.bmj.com/content/349/bmj.g7257

- "Sleep and Metabolism: An Overview" https://pmc.ncbi.nlm.nih.gov/articles/PMC2929498/

peterldowns··on An average human breathes out roughly 1kg of carbon dioxide a day
A related fun fact is that you generally lose weight by exhaling, generally while you sleep. Sweating, defecating, etc. is all temporary. If you're trying to lose weight, make sure you're sleeping enough!

edit: see my followup comment, didn't mean to mislead here. I'm not a scientist and sleep and food science is both pretty hard to trust.

peterldowns··on Overtourism in Japan, and how it hurts small businesses
I walked the Kumano Kodo after reading Craig's essay about it. I like to think I was one of the 15% he talks about here. One of these days I'll go back to Japan and I'll make sure to go to Morioka.

My favorite line in this article:

> I’ve come to see overtourism as a kind of natural disaster. How can you get angry at the earth for having an earthquake?

peterldowns··on Writing Code Was Never the Bottleneck
Hey Tomas, been a while! I like the approach that graphite is taking to AI code review — focus on automating the “lint” or “hey this is clearly wrong” or “you probably wanted to not introduce a security flaw here” type stuff, so that humans can focus on the more important details in a changeset. As your AI reviewers take on more tasks, have your answers to your question (“why do we do code review”) changed at all?
← PreviousPage 4 of 13Next →