Hacker News new | comments | show | ask | jobs | submit login
“this code very fast” pull request to remove whitespace from linux kernel (github.com)
83 points by namanyayg 10 months ago | hide | past | web | favorite | 55 comments

This is kinda awesome only because lots of people can't tell if it's a joke or not. I'm reasonably confident it is, but the fact that a lot of people can't tell makes it pretty funny. And, the account that posted it is seemingly new enough to programming to maybe have no idea that it's ridiculous. So, it may even be sincere, which is less funny, but still caused me to think about it for a minute.

Also, I admire the handful of people who commented with a sincere explanation about why it's wrong. I don't have that much patience, but I'm happy that people who do exist.

I can't tell whether or not it's a joke.

What I can clearly see is the whole reason I left working in tech: the field is stuffed full of deeply unpleasant and unkind people.

Yeah, I try to look past it, but we really are a bitter and angry community on average; anyone different, anyone less skilled, anyone who can be "othered", is treated with disdain by a lot of our peers.

It never stops being disappointing...though I also understand the feeling that leads to it. Some days I genuinely hate my projects users for being so utterly helpless and having bizarre mental models for how things work. As I've gotten older and, I think, kinder, I try to take a break when I feel like ranting or condescending at a person rather than helping. I don't always succeed, but I wish more people would try.

That's unfortunately true. I found people in research to be much more open-minded than in sw development (at the same time they were always a bit too outgoing for me :)). But not sure if it's much better in most other disciplines. Tech people seem to be pretty honest at least. Compared to the backstabbing and cutthroat cultures and hierarchies in business, law and medicine (there even literally). Elitism can also be found in basically every other field... So well. Perhaps it's just the people

Technical people, myself included, tend to be too arrogant, negative and black-white thinking. I don't associate with anyone whom dumps their emotional/work politics garbage or badmouths things/people/employers/etc.

Add some motherfucking positivity! :)

I see no comments on the PR that I'd describe as unpleasant or unkind.

Yeah, folks are mostly being kind or just continuing the joke in this thread. There's a couple of questionable ones, but nothing too awful. I've seen much worse, including in the Linux kernel community (which is kind of a mixed bag, but in my past experience reasonably nice to newbies).

It's quite funny, but I think (hope) that it's a satirical poke at JS minification...?

(... which, admittedly, would be quite strange now that I think about it. I didn't check, but I assume that there was no variable renaming in the "added line". Hmm... Regardless, I had a good laugh, so it's all good.)

The diff itself is pretty funny. But yeah I have no idea how serious this is meant to be.

Why don't we just compile the kernel to machine code, and distribute that instead?

This would completely eliminate waiting for kernel compilation.

Machine code varies depending on the platform, and Linux is meant to be distributed to a _ton_ of platforms.

That's the joke. The kernel is already distributed as compiled machine code.

Whoops haha didn't catch that :)

True, but we can just use the subset of machine code that works on all of them.

Us web developers figured this out with JS, when IE supported different methods than WebKit and Mozilla. If we can do it, I’m sure you can assemble something that’s universal as well.

> True, but we can just use the subset of machine code that works on all of them.

All you need to be Turing-complete is `add`, `jne`, and that's pretty much it - and every mainstream instruction set today supports at least those 2 operations: https://en.wikipedia.org/wiki/One_instruction_set_computer

Of course the computer would run terribly - so I hope you're joking there.

A a web-dev analogy, it's like saying we should abandon CSS and use <table>-for-layout because you don't want Internet Explorer 4.0 users to be left out.

There's a slightly crazy guy on osdev who wrote an entire graphical OS for a simulated SUBLEQ architecture:


Technically, x86(and probably others) are turing complete with just MOV: https://github.com/xoreaxeaxeax/movfuscator

> Of course the computer would run terribly - so I hope you're joking there.

I thought RISC was the future?

(Yes, I’m joking)

In all seriousness - I think you're on to something with a minimal-instruction-set program that only uses operations common to as many ISAs as possible - that way all that needs to be done is reassembly of the program in O(n) time by remapping opcodes to their correct binary representation for a given ISA. I wonder if it might have application for portable binary libraries in industries that love trade-secrets, or something like C--.

I do indent my code, but I very rarely insert syntactically irrelevant spaces. I don't mind if clang-format (etc.) puts them in for me, but I don't add them by pressing keys myself and I don't have a problem reading code that leaves them out (since that code looks just like the code I write myself before I run it through clang-format).

This has long been my habit, since I started out on a computer with 32K RAM, where putting in extra spaces just meant you'd need to use shorter variable names to balance things out.

(Here's a photo of some representative code I wrote for a reddit contest a couple of years ago: http://ffe3.com/pics/.beeb/IMG_1373.JPG - not much different from what I wrote in the early 1990s as a teenager. But I did typically use longer variable names back then, because unlike this case I wasn't concerned about fitting the whole listing on one 40x25 screen...)

Even today, doing this still means fewer L1 cache misses in the scanner.

Your code is still needlessly verbose.

Have you ever seen how the ancient Romans wrote Latin? Not only no white space, no interpunctuation either, and everything in uppercase. E.g: http://ratcliffe-college.co.uk/wp-content/uploads/2015/09/La...

So instead of..

.. you should just write:

Now that is concise code!

Yet that language died, go figure..


Surprisingly, I didn't have a hard time reading that. Maybe because I had a good idea of what the context would be before hand... Hmmmm, interesting thought of the day.

Y cn rmv th vwls frm nglsh nd ts stll knd rdbl.

You can aslo salmrbce the lteerts in wdros and as lnog as the frsit and lsat leretts are the same it is siltl raleabde.


OOoo! And of course there's "Ladle Rat Rotten Hut":

> Wants pawn term, dare worsted ladle gull hoe lift wetter murder inner ladle cordage, honor itch offer lodge, dock, florist. Disk ladle gull orphan worry putty ladle rat cluck wetter ladle rat hut, an fur disk raisin pimple colder Ladle Rat Rotten Hut.


That took me a bit

Me too. My brain reached for "semblance" at first.

> Where letters could be long, too? New, or do. Ran other!

I see what you mean...

It has a sort of Fortran-esque feel. Almost like the classic "DOI=[etc]" parsing puzzler.

Ha, that takes me back.

I got started on Commodore BASIC on an 8K PET.

Your program had to share memory with the source code, so you didn't waste bytes on spaces! (You also used single character variable names as much as possible and jammed as many statements on a line as possible since the overhead per line was a few bytes.)

As a result I can still read very dense code, but I'm reformed and write code that uses white space to avoid an overly busy screen, suggest coupling in the underlying logic, aligns comments, etc.

Have you done any APL? You might enjoy it.

So many people taking it seriously. I have never attempted to commit anything to the kernel, but it seems like a tough crowd in some areas.

I'm fairly sure that there's almost no serious kernel developer answering here. Kernel contributions don't go through github PRs but through mailing lists. The "tough crowd" you see here are trolls - not the actual community, which is inclusive and quite nice to work with.

> And actually most of the C and C++ bugs beside the bad logical implementation which would be a fault of a person who write the code is the problem with not dealocated memory or pointers that point to a wrong part of memory and make programs crashes. In other words buffer overflows and stack smashing which all lead to segfaulting or even worse if they are not properly handled by the operating system like in case of Micro$hit windblows.

Yes, I would hope no kernel contributor ever refers to Micro$hit windblows, or has such atrocious grammar and communication skills. It seems like this guy is trying to explain the C memory model, but doing a terrible job. I would have guessed that most of the commenters are children in high school, but worryingly many seem to be full-grown adults.

This excerpt (above) is from a comment made by a GitHub account that is six years old and who claims to be an 'Experienced Linux System Admin'...

I was going to ask about that, if these were in any way core contributors. I figured most of those serious enough to make helpful commits wouldn't take the bait.

It doesn't compile though -- I hope.

I'm pretty sure C keywords require a space on either side...

Missed opportunity to put in some zero-width unicode spaces just to add that extra bit of uncertainty for whether gcc would respect it...

Solving the tabs vs spaces debate and the cr/lf debate using the Gordian Knot approach.

Ah, someone must have mistaken this for the Gentoo repository. This sort of patch should be maintained by downstream distributions where concerns like speed are overriding concerns.

Me, personally? I found that compiling was a lot faster if I ran "rm -rf ." first.

While you're at it, minify all the symbols. That will make it much faster.

It's almost certainly a joke, but defaulting to treating things you think are a bad idea as if they were jokes is fairly hostile behavior which makes it impossible for controversial issues to be discussed because someone will treat the side they don't support as being so obviously stupid it must be a joke, which can be dismissed without consideration.

Best joke I've heard all day.

Seems like he made an irony. a.k.a. troll.

Details (in Turkish): https://palmiyria.blogspot.com.tr/2017/05/test-yazisi.html?m...

However, the dates are strange.

post about this troll: 24.05.2017 github pr: 17.07.2017 the SS on post: 25.07.2017

Wasn't there an embedded JS implementation where whitespace slowed down code execution?

v8 used the string length of a function, including comments, to determine whether to inline. HotSpot used (uses?) bytecode length of a method, so adding useless lines would affect performance.

I'm aware of V8, but what I'm thinking of was something worse: JS for embedded devices that apparently interpreted the code on-device without even compiling to bytecode.

There was also this: https://news.ycombinator.com/item?id=12119080 ("Tabs slower than spaces in Firefox")

A few years ago I was playing around with arduino, and adding comments increased the executable file size.

I do not think he's joking. JS thinks in logic. :D

Lots of people getting whooshed in the comments there.

this guy is hilarious, well i am in the same country where he is from. Turkey obviously.

You could always put it through a C formatter after..

I'm pretty sure that no C formatter can handle tokens that run together.

That's right! Linus needs to rewrite the kernel in Fortran so we can utilize this code compaction!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact