• Linus Torvalds added hidden tabs to Kconfig to challenge parsers that can’t handle them.
  • Tabs were intentionally added to the common Kconfig file for page sizes to expose faulty parsers.
  • Torvalds believes parsers unable to handle tabs shouldn’t be parsing kernel Kconfig files, aiming to force fixes.
  • TCB13@lemmy.world
    link
    fedilink
    English
    arrow-up
    285
    arrow-down
    7
    ·
    edit-2
    7 months ago

    “if you can’t parse tabs as whitespace, you should not be parsing the kernel Kconfig files.” ~ Linus Torvalds

    This is what we got after people sent him into PC training. The OG Linus would say something like “if you’re a piece of s* that can’t get over your a** to parse tabs as whitespace you should be ashamed to walk on this planet let alone parsing the kernel Kconfig files. What a f* waste of space.”

  • Nik282000@lemmy.ca
    link
    fedilink
    arrow-up
    100
    arrow-down
    2
    ·
    7 months ago

    Why would anyone NOT parse a tab as whitespace? Like, python really wants you to use spaces but will still let you use tabs if you are consistent.

  • inetknght@lemmy.ml
    link
    fedilink
    arrow-up
    90
    ·
    7 months ago

    I’m honestly on Torvalds’ side here.

    Tabs are a necessary part of the tooling and configuration files. Any tool which doesn’t properly handle files that are correctly formatted for other tools is… a broken tool.

  • Aatube@kbin.melroy.org
    link
    fedilink
    arrow-up
    88
    arrow-down
    8
    ·
    7 months ago

    I’ll take you up on that. ChatGPT, translate this commit message to actual Linus style:

    Subject: Regarding Commit d96c36004e31

    So apparently, this commit thought it was a brilliant idea to strip away a tab because some third-rate kernel config parsing tool couldn’t handle it. Seriously? We’re bending over backward for these tools now?

    Listen up, if your parsing tool throws a tantrum over a tab, it’s time to rethink your life choices. Tabs are as fundamental to Kconfig files as oxygen is to humans. If you can’t handle tabs, you have no business parsing kernel configurations.

    And let’s not pretend this is some isolated incident. The whole tab vs. space saga is like a bad sitcom rerun from the '70s. Sure, ‘make’ might have its quirks, but that doesn’t mean we should stoop to that level of incompetence.

    I’m tempted to flood our Kconfig files with tabs just to prove a point, but let’s not make a mess where it’s not needed. However, if this idiocy persists, don’t be surprised if I start tabbing everything in sight.

    Let’s get our priorities straight, people. We’re building a kernel here, not babysitting fragile parsing tools. So let’s fix this mess and move on to more important things.

    • Noa Himesaka@lemmy.funami.tech
      link
      fedilink
      arrow-up
      35
      arrow-down
      1
      ·
      edit-2
      7 months ago

      I tried it with Claude 3 Opus, even better:

      Alright, listen up you little shits. Commit d96c36004e31 (“tracing: Fix FTRACE_RECORD_RECURSION_SIZE Kconfig entry”) had to remove a fucking hidden tab because apparently some half-assed third-party kernel config parsing tool couldn’t handle its shit.

      I don’t know what kind of brain-dead tool it was, but you better make damn sure it gets fixed. Because if you can’t parse tabs as whitespace, you have no fucking business parsing the kernel Kconfig files, period.

      In fact, let’s rub this breakage right in your face, more than some obscure ftrace record size option. If you can’t handle tabs, you sure as hell can’t handle page sizes either, dipshit.

      Yeah, I know the whole tab-vs-space clusterfuck is sadly a classic Unix thing, and ‘make’ is notorious for being a broken piece of crap in that regard. But guess what? That doesn’t make it fucking okay, got it?

      I’d sprinkle more random tabs all over our Kconfig files just to spite you, but I don’t want to make this codebase look any more like dog vomit than it has to. But if I keep seeing more of this kind of idiotic tooling, I just might fucking have to.

      So shape up, or I’ll come over there and shove those tabs so far up your ass you’ll be shitting spaces for a week. Fuck!

    • kill_dash_nine@lemm.ee
      link
      fedilink
      English
      arrow-up
      33
      ·
      7 months ago

      “ok, now add a metric shit ton of swearing and further belittle parsers who can’t deal with tabs.”

    • CaptDust@sh.itjust.works
      link
      fedilink
      arrow-up
      12
      ·
      edit-2
      7 months ago

      Listen up, if your parsing tool throws a tantrum over a tab, it’s time to rethink your life choices. Tabs are as fundamental to Kconfig files as oxygen is to humans. If you can’t handle tabs, you have no business parsing kernel configurations.

      Heh this is so succinctly scathing, but also dead on …

    • Exec@pawb.social
      link
      fedilink
      arrow-up
      10
      ·
      7 months ago

      I’m tempted to flood our Kconfig files with tabs just to prove a point, but let’s not make a mess where it’s not needed. However, if this idiocy persists, don’t be surprised if I start tabbing everything in sight.

      This is genius.

    • Gallardo994@sh.itjust.works
      link
      fedilink
      arrow-up
      3
      ·
      7 months ago

      I am more than sure that Linus wrote the original message as he would normally do, and then made it clean and pretty with an AI. Sometimes I resort to this option too.

  • palordrolap@kbin.social
    link
    fedilink
    arrow-up
    77
    arrow-down
    5
    ·
    7 months ago

    The Robustness Principle may seem like little more than a suggestion, but it is the foundation on which many successful things are based.

    To boil it down to meme-level old-school Torvaldsry: Assume everyone else is a f–king idiot who can barely do what they’re supposed to and expect to parse their files / behaviour / trash accordingly.

    If you do not do this, you are, without doubt, one of those f–king idiots everyone else is having to deal with. If you do do this, it does not guarantee that you are not a f–king idiot. Awareness is key.

    Examples where this works: Web browser quirks mode; Driving a car; Measure twice, cut once. This latter one is special because it reveals that often, the f–king idiot you’re trying to deal with is yourself.

    Assume everyone else is worse.

    Fun corollary: In altering his behaviour towards f–king idiots people who should know better, Linus has learned to apply the robustness principle to interpersonal communication.

      • mino@lemmy.ml
        link
        fedilink
        arrow-up
        44
        arrow-down
        2
        ·
        7 months ago

        I don’t understand this either. There’s no fucking algorithm overlord here right? No fucking tiktok, youtube bullshit required.

        If you want to say fuck, fucking say fuck.

        On another note. Thx for introducing me to the robustness principle ♥️

        • palordrolap@kbin.social
          link
          fedilink
          arrow-up
          28
          arrow-down
          6
          ·
          7 months ago

          Maybe I want to say it without saying it. There’s no rule against doing that, but people somehow think there is - or that there ought to be.

          Most of the time I don’t swear, so it makes me uncomfortable to use the word. There have been and undoubtedly will be exceptions. When the mood takes me. When the word, unfettered, feels right. Today was not that day.

          Funny how the partial omission offends some people more than the original word does. Adapt your parsers.

      • lolcatnip@reddthat.com
        link
        fedilink
        English
        arrow-up
        23
        arrow-down
        3
        ·
        7 months ago

        Sometimes it works well as a stylistic choice. It’s not pretending not to use a bad word, but rather drawing attention to the fact that you’re deliberately being a little bit naughty with a wink to the reader. It’s like the absurdity of what happens when you find a stranger in the Alps.

    • barsoap@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      7 months ago

      Robustness Principle

      It’s a principle for brittleness. First you get implementation-defined behaviour, then bug-compatible software.

  • tooLikeTheNope@lemmy.ml
    link
    fedilink
    arrow-up
    70
    ·
    edit-2
    7 months ago

    Torvalds believes parsers unable to handle tabs shouldn’t be parsing kernel Kconfig files, aiming to force fixes.

    Stern but just

  • PanoptiDon@lemmy.world
    link
    fedilink
    arrow-up
    65
    arrow-down
    1
    ·
    7 months ago

    Reminds me of Beethoven writing Für Elise for sometime he loved, and when he was rejected, the music was finished in such a way that she could not play it.

  • BigMikeInAustin@lemmy.world
    link
    fedilink
    English
    arrow-up
    41
    arrow-down
    1
    ·
    7 months ago

    I do the same to people who refuse to follow specifications they agreed to follow.

    There is a slight satisfaction to get back at them for continually delivering much lower quality than is required.

    But it really is to cover me. Because, it always happens, later in the future that edge case comes up, and everything breaks. And management is ready to blame me. But then I show them that I tested the edge case before the conclusion of the project. And that programmer ignored my emails, and that I told management these edge cases weren’t covered. But then management signed off on calling it complete. And suddenly management is no longer red with fury. And they usually won’t allow me time to fix it. So the can gets kicked down the road until the next time that edge case fails.

    • luciferofastora
      link
      fedilink
      arrow-up
      2
      ·
      7 months ago

      Me: “This is the file format we agree on.”
      They: “Yep, that’s what you’ll get.”

      They: “Why is your script not working?”
      Me: “Idk what was the last file you put through it?”

      In their defense, they got the file from a third party that we both previously assumed competent enough to follow explicit written instructions. Guess there’s a lesson in trust…

  • merthyr1831@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    7 months ago

    The Register did a good article covering the change.

    Source files should be conservative with the standard they expect from the developer, and parsers should be liberal in what they expect from the source, ie. allow deviations from the standard.

    Python for example supposedly only allows 4 spaces for indentation, but as long as the developer is consistent most if not all Python interpreters will accept any kind of indentation.

    • barsoap@lemm.ee
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      7 months ago

      Python for example supposedly only allows 4 spaces for indentation, but as long as the developer is consistent most if not all Python interpreters will accept any kind of indentation.

      That’s a recipe for disaster as your syntax is under-specced. You’re right-up inviting programmers to produce programs with implementation-defined semantics.

      Haskell (which also uses layout syntax) never had that problem as tabs were simply defined to be eight spaces, but that then led to issues with people setting different tab-widths in their editors and a flurry of syntax errors when they did “tabs for indentation, spaces for alignment”. Which is why Haskell then moved ahead to outlaw tabs, I think it’s still in the “throw a warning” phase but at some point it’s going to be a hard error.

      That’s not to say that kconfig should do the same – presumably they used tabs for a good reason, and all those other programs are simply not following the spec. Essentially including unit tests in the actual production files is a good move when you’re dealing with that kind of situation.

      • UndercoverUlrikHD@programming.dev
        link
        fedilink
        arrow-up
        6
        ·
        7 months ago

        Eight space indentation should be crime, I’m not made out screen width over here.

        If you want to be strict with indentation, use tabs as your standard instead of forcing others to use your preferred visual width.

        • barsoap@lemm.ee
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          7 months ago

          Eight is still the default tab width and will be as long as VT100 continues to be a thing, i.e. forever. Haskell could’ve chosen another static value but that would have caused even more trouble.

          With Haskell’s syntax you really want to align at single-space resolution, not necessarily just on the left but also further to the right, within the lines. The gold standard is pretty much lhs2tex “poly” style (section 8, page 19), and not just because it allows lhs2tex to spit out beautiful code, it’s also highly readable in ASCII form. In that style 2+ spaces mean “align this with the 2+ space stuff above and below”.

          So there’s no way around spaces and as tabs+spaces are a bad idea tabs get the boot. That argument is specific to Haskell but in general I’d argue that tabs are more trouble than they’re worth – if you have trouble editing space-only indentation, get a proper editor. If I want my Rust indented by a different amount I can just tell rustfmt to change everything, no biggie.

    • Subverb@lemmy.world
      link
      fedilink
      arrow-up
      3
      arrow-down
      6
      ·
      7 months ago

      Having a language dependent on indentation is absurd on the face of it. It’s a ridiculous idea that should have been ridiculed from the outset.

      • barsoap@lemm.ee
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        7 months ago

        No. Having a language depend on semicolons even though there’s ways to do without, ways that don’t even include layout if you don’t want to, is well not absurd on the face of it it’s hysterical raisins.

        Haskell has one of the most admired syntaxes out there, and it’s layout. It’s clean, predictable, very simple and most of all intuitive rules. It makes sure that semantic structure always follows visual structure, thus provides a single source of truth why Algol-likes (i.e. everything that looks at least vaguely like C) have two.

        I don’t indent my Rust, I let rustfmt do that. All that automation and I still get into lots of missing or mismatched braces situations which literally never happen in Haskell because the structure of the program is visually obvious, you don’t have to look for tiny squiggles to figure out what it is.