26 points ariebovenberg 1 day ago 6 comments

ariebovenberg 1 day ago | parent

Author here. I ran into this while comparing Pendulum with `whenever`, the datetime library I maintain. I sent a patch that removes the hack, but the post is about why the underlying design can't be patched the same way. Happy to answer questions.

LoganDark 41 minutes ago | parent

Did you use LLM to write parts of the article?

> The trouble with guessing who’s calling is that you can’t anticipate every caller. Pendulum’s hard-coded check is fragile: it covers only one name, and relies on an exact call stack that Pendulum doesn’t control.

Edit: it looks like the later parts of the article show a lot of LLM tells, but not the beginning. I've been seeing this pop up more and more lately...

throwaway89201 10 minutes ago | parent

> but not the beginning

You didn't stop reading after "The hack itself is on its way out, but the design behind it still matters for your code"? I did.

jonathaneunice 38 minutes ago | parent

OMGeeeee!

I too have plumbed the call stack for hidden-maybe-forbidden knowledge from the caller, and it is always fraught. No matter how good one's intentions. Forget dynamic type testing. Forget Perl's `wantarray` dynamic introspection of "what does the caller want?" Those are small potatoes. This is full on "who's calling me and what do I want to send back as a result?" The people who will never forgive you for type testing are going to straight-up excommunicate whoever wrote this! And yet...it makes complete sense. Based on the promises made, you have to do something... and you're already in "what is the least of the evils?" territory, because you're going to have to do something that someone—maybe a lot of someones—will call evil.

My admiration for Pendulum just increased. This is sin-eating.

leni536 30 minutes ago | parent

It's the promises that don't make sense, although that might be obvious in hindsight.

david2ndaccount 26 minutes ago | parent

"In the face of ambiguity, refuse the temptation to guess."