5 ms·
LKML: New syscall: leftpad()
- wolf550e 11y agofor anyone unaware: look at the date.
- jimmeyotoole 11y agoThis is actually amazing :D
- pmalynin 11y agoLet's see how far we can ride this joke. I see next step as being an ASIC for leftpad. Hardware accelerated leftpad anyone?
- microcolonel 11y agoPADL AL, 1h
- tux3 11y agoYou could make PADL an alias for SHR I suppose!
- 0xcde4c3db 11y agoPeople who have never looked at golfed x86 assembly language probably don't realize how close this is to reality. https://reverseengineering.stackexchange.com/questions/2774/what-does-the-assembly-instruction-repne-scas-byte-ptr-esedi/2775 https://reverseengineering.stackexchange.com/questions/2774/...
- leemailll 11y agoSomeone in acedemic pickup and publish a paper on realization of the algorithm with quantum computer
- 0xcde4c3db 11y ago> As everyone knows, within the kernel everything is faster and better. > Leftpad has millions of users, so it has to be as fast as possible. Flawless logic.
- zem 11y agoseldom have I seen april fools day won this early!
- jacques_chester 11y agoIt's been going for quite a few hours at this point.
- kbenson 11y agoIs it too much to hope for Linus to either wholeheartedly endorse this patch, or (preferably) eviscerate it for not being implemented well in some way? That would really be the icing on the cake.
- Bytes 11y agoSince this is such an important system call, I am sure we will see it in the kernel in the next release.
- polemic 11y agoIf this had a buffer overflow vulnerability it'd be perfect ;0
- barsonme 11y agoLeft-pads your entire hard drive* * Or until the kernel revokes your programming license.
- shruubi 11y agohttps://lkml.org/lkml/2016/3/31/1125 https://lkml.org/lkml/2016/3/31/1125 Somehow, this just makes it better...
- tptacek 11y agoPlease don't start this. April 1 is extremely tedious.
- gnoway 11y agoupvoted for solidarity.
- sergiotapia 11y agoStay offline. It's fun for us.
- waynecochran 11y agoWe need an orthogonal `rightPad()` as well to be complete.
- 13of40 11y agoNo, silly, you just reverse the string, leftPad, and reverse the string again.
- arquinox 11y ago1 APRIL 2016 00:33.... 'nuff said people.
- fotcorn 11y agoAnd so it begins :)
- jordanb 11y agoWow, this blows left-pad.io's whole business model. Wonder what they're going to use their VC millions on now? EDIT: Here's an idea: Monetize your padding by putting ads in it.
- Russell91 11y agoPivot to right-pad.io
- Philadelphia 11y agoI propose center padding. Why does the padding need to be at the end of the word? That's just an artificial limitation imposed by the rent-seeking incumbents in the padding industry.
- spbaar 11y agoMiddle out padding. It just might work
- Intermernet 11y agoDeterministic Random Padding is the way of the future: http://play.golang.org/p/m4he0blGL5 http://play.golang.org/p/m4he0blGL5 Need to make it a package so other code can depend on it though.
- wrong_variable 11y agoI hate to spoil the fun for everyone. But there is actual value in doing things the npm/unix way. Just yesterday I used a module to turn numbers to comma separated strings 10000 -> 10,000 Could I have written a function to do it ? Sure But every less line of code I need to write saves me time. Programming is fundamentally a creative field ( which means there is no absolute truths ) - and each individual developer should be given the freedom judge when to write code and when to use other's people modules. I would say that this whole fiasco just proves how awesome programming has become - remember the days when adding a dependency was hell ? Now we live in a world where adding dependency has so little cost that we rather not even spend 10 minutes writing a function. To me its an improvement over the state of affairs from the past. Its also cheaper to switch dependencies - imagine if the leftpad disaster was somewhere in the window's kernel ? or in std:: ? There is always trade-offs in every decision you make in software - I think we are moving in the right direction. Just need to make package creation immutable.
- DannyBee 11y ago"But there is actual value in doing things the npm/unix way." This is where the node community falls down. They think because there is value in sometimes doing it this way, there is always value in doing it this way. Rarely is the right answer for architecture/programming/etc at one of the extremes.
- hugozap 11y agoComposing from small modules has worked great so far. Yeah, npm had a flaw, but people are mixing modularity with a package distribution issue.
- DannyBee 11y agoWhat about the last 16 javascript software engineering fads? What happened to those?
- pcwalton 11y agoThe left-pad debacle is not an indictment of small dependencies. The problem would have still happened even if left-pad were a 10,000-line dependency, if that 10,000-line left-pad was as popular as the 10-line left-pad was. The issue was that authors in the npm ecosystem could pull their packages and cause havoc. Copying code is a partial workaround for this problem for small dependencies only, but the problem should be solved at the npm level--and once it's solved there, the virtues of copying code go away.
- swang 11y agoDays since a stupid leftpad joke 0
- sergiotapia 11y agoAnd just like that left-pad.io is cut out of the market. Man, startups are cutthroat these days, but that's business for you.
- circuit_breaker 11y agoIt was only natural. I propose a POSIX extension with a new signal type: SIGLPAD. You know, for on demand left-padding by the user. Because user choice is important
- rdtsc 11y agoAnother unicorn dying. It must be a bubble. Let's wait for HN resident economists to tell us about it.
- Intermernet 11y agoThe consensus estimates on left-pad.io’s [LPAD, -0.57%] fiscal 2016 earnings per share and revenue have come down sharply compared to estimates, with ongoing softness within the padding family of functions pushing many analysts to the low end of their guidance.
- qopp 11y agoActually this is an opportunity for left-pad.io. Previously they had to maintain custom code, but now they can interface through to the kernel which is much faster and allows them to scale. Many people are on older kernels and might not be able to upgrade, or for convenience or other reasons simply prefer to use an api for their critical business logic.
- JetSpiegel 11y agoThey can compile a unikernel with this single function, even.
- mchahn 11y agoThis is the second april fool's post. I dread the next 24 hours.
- whitenoice 11y agoI hope tesla's model 3 is not april fool's!
- dang 11y agoWe're way past the second at this point. Let's just hope we make it through.
- bazfoo 11y agoWhile the joke is relatively amusing, it would be better to seem more useful solutions contributed to the ecosystem like depscheck [1] for Go. [1]: https://github.com/divan/depscheck https://github.com/divan/depscheck
- mayank 11y agoleft-pad.io was shortsighted from the start, everybody knew that, but nobody in the echo chamber wanted to admit it. Now that left-pad.io's unicorn chances are all but smashed, perhaps we can look forward to SF rents finally coming down!
- Bytes 11y agoThis really makes node a first class citizen of linux. I am sure moving node modules to the kernel will greatly increase their speed. :)
- ndesaulniers 11y agoFor context ioctl is considered this ridiculous grab bag of a syscall that people overload (abuse) rather than add new syscalls. Used a lot for a lot of things, but the literature doesn't speak highly of it.
- cbd1984 11y agoFor more context: ioctl means "We made this object's API file-like, but there's something we need to do with this object which we can't express in terms of the normal file operations." Setting terminal options is a classic use of ioctls: You have a file descriptor which connects to a terminal or, more likely, a pseudo-terminal, and now you need to ask the user on that terminal for a password. By default, the low-level code will echo every character back to the user, so they can see what they just typed, but that's insecure for passwords, so you need an ioctl to tell the low-level terminal handling code to not echo. Plan 9 removed some of these warts, but it's hard to see a fully, truly elegant way to handle something which is mostly-file-like but has some un-file-like attributes programs need to frob.
- shiftoutbox 11y agoWhat was that random comment about how Linux dosn't break userland Abi . Was this a early April l fools joke ?
- marcosdumay 11y agoThe message is dated as Apr 1st. At several places it's past midnight already.
- whoosher 11y agoWhoosh!
- shiftoutbox 11y agoSwish
- Syrup-tan 11y agohttps://xkcd.com/1627/ https://xkcd.com/1627/ I think you added an "H"
- cbd1984 11y agoThe "whoosh" spelling is older than xkcd.
- rev_null 11y agoThis is doesn't help all of the JavaScript developers on OS X.
- cant_kant 11y agoI propose that facebook() be put into the public kernel For the secret* kernel that is known only to us, facebook () should be replaced by hn().
- DblPlusUngood 11y agoAs a longtime OpenBSD misc reader, it took me a few minutes before I became convinced that the OP was joking.