#LeftPad
unix philosophy includes leftpad
June 3, 2024 at 12:19 AM
leftpad was 10 years ago 😳
March 20, 2026 at 8:27 PM
LEFTPAD AT SCALE
1. LLM-generated code tries to run code from online software packages. Which is normal but
2. The packages don’t exist. Which would normally cause an error but
3. Nefarious people have made malware under the package names that LLMs make up most often. So
4. Now the LLM code points to malware.
LLMs hallucinating nonexistent software packages with plausible names leads to a new malware vulnerability: "slopsquatting."
April 13, 2025 at 12:34 AM
>> leftpad
>> lefterpad
>> leftestpad
June 11, 2026 at 4:03 PM
10 years ago

module.exports = leftpad;

function leftpad (str, len, ch) {
str = String(str);

var i = -1;

ch || (ch = ' ');
len = len - str.length;

while (++i < len) {
str = ch + str;
}

return str;
}
March 20, 2026 at 4:51 PM
my husband just informed me over breakfast that leftpad is 10 YEARS OLD NOW and i died, facedown in my eggs
10 years ago

module.exports = leftpad;

function leftpad (str, len, ch) {
str = String(str);

var i = -1;

ch || (ch = ' ');
len = len - str.length;

while (++i < len) {
str = ch + str;
}

return str;
}
March 20, 2026 at 5:19 PM
Genius! Do we label them things like libxz, leftpad, etc?
January 2, 2025 at 6:23 PM
that was leftpad for me
September 5, 2025 at 12:40 AM
leftpad but for C
March 29, 2024 at 7:24 PM
i take back everything negative i've ever said about AI, this is the future of programming
August 8, 2025 at 1:17 AM
waiter! waiter! another 300 copies of leftpad please!
November 4, 2025 at 9:08 AM
Last Sunday was the 10th anniversary of LeftPad.

I hope you celebrated.
March 24, 2026 at 9:22 PM
Nobody gets why Lets Prove Leftpad is funny anymore
June 24, 2025 at 12:37 AM
on the one hand the democratisation of software dev via agentic AI might lead to a hilarious pile of regrettable techdebt in 15 years

on the other hand, Claude in Her infinite wisdom and grace would simply have written a throwaway function to leftpad strings and tucked it away in a file somewhere
April 2, 2026 at 7:48 PM
Because github makes it trivial for your dependency author to take down their leftpad, whereas pypi kinda wants to keep deptrees actually working
April 20, 2026 at 4:05 PM
hell, look at the leftpad incident
April 13, 2025 at 7:58 AM
this is leftPad all over again

we’ve lived in this world for a while, but it’s shit like this that serves as a landmark, “this is how it works now”
isolyth.dev Eris @isolyth.dev · May 14
Haha, this whole bun rewrite thing is- what the fuck do you mean *merged*?
May 14, 2026 at 5:32 PM
Jev-Leftpad

#HackerNews

<a href="https://github.com/f/jev-leftpad" class="hover:underline text-blue-600 dark:text-sky-400 no-card-link" target="_blank" rel="noopener" data-link="bsky">https://github.com/f/jev-leftpad
September 21, 2026 at 10:13 AM
September 21, 2026 at 3:17 PM
September 21, 2026 at 10:35 AM
September 21, 2026 at 10:00 AM
September 21, 2026 at 8:35 PM
September 21, 2026 at 3:53 PM
it does feel i'm invoking leftpad a little bit when i quickloaded the common lisp library "parse-float"
July 30, 2026 at 5:57 AM