Announcement

Collapse
No announcement yet.

Linus Torvalds Injects Tabs To Thwart Kconfig Parsers Not Correctly Handling Them

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Originally posted by ATLief View Post

    curfew It also makes parsing text much easier. Lots of strings include spaces (filenames, semantic names, dates, times, etc) but very few strings include tabs. If you're trying to parse text with columns, then by relying on tabs you can completely ignore (and preserve) spaces. Since tabs automatically grow, it also makes aligning columns much easier.
    You are defining a custom, non-generic syntax. Essentially just CSV with tab as the separator, nothing new here. However, tabs don't grow automatically, unless you are using some weird tool that does that for you. Maybe you meant adjusting tab width? That's a different thing, and that's actually why majority of programmers hate tabs when used as generic indentation.

    Comment


    • #32
      Originally posted by Old Grouch View Post
      I guess you've never used a manual typewriter. Setting up left aligned columns of text without tabs is not a fun exercise. The intention was never to save storage space on devices that hadn't been invented yet. If you set the tab stops too wide, the momentum of the platen hitting the tab stop would physically move the entire typewriter to the left. They were not a 'gimmick'.
      Sure, I haven't. Because they're not computers. They have nothing to do with digital text processing and even less with text parsing.

      Originally posted by Old Grouch View Post
      It's worth understanding why the concept of tab stops was retained in the transition from typewriters to word processors, and why the 'word processors' that programmers use to write their code continue to include tab stop functionality.
      Sounds like you mean that there's a very specific way to use them in the "correct" way and that most people don't know it. So it doesn't exist, because nobody knows it. The problem here is just one idiot using tabs can mess the experience for everyone else. The majority has to agree on how to use them or pretty much nobody can use them.

      Comment


      • #33
        Where would we be without this man!?

        We would all be sad little BSD people, that's where!

        Comment


        • #34
          Originally posted by Old Grouch View Post
          I guess you've never used a manual typewriter. Setting up left aligned columns of text without tabs is not a fun exercise. The intention was never to save storage space on devices that hadn't been invented yet. If you set the tab stops too wide, the momentum of the platen hitting the tab stop would physically move the entire typewriter to the left. They were not a 'gimmick'.‚Äč
          Originally posted by curfew View Post
          Sure, I haven't. Because they're not computers. They have nothing to do with digital text processing and even less with text parsing.



          Originally posted by Old Grouch View Post
          It's worth understanding why the concept of tab stops was retained in the transition from typewriters to word processors, and why the 'word processors' that programmers use to write their code continue to include tab stop functionality.
          Originally posted by curfew View Post
          Sounds like you mean that there's a very specific way to use them in the "correct" way and that most people don't know it. So it doesn't exist, because nobody knows it. The problem here is just one idiot using tabs can mess the experience for everyone else. The majority has to agree on how to use them or pretty much nobody can use them.


          Your answer shows that you have great potential to dispel ignorance in your future, and I am honoured to have set you on the path. I regret that I am not in a position to accompany you in your endeavours, but I wish you bon voyage.
          Last edited by Old Grouch; 16 April 2024, 04:10 AM. Reason: Add some horizontal lines to break up text into meaninful sections

          Comment


          • #35
            Originally posted by toves View Post
            Good to see the chief penguin molester giving the turkeys a hard time.
            Funny I haven't really thought of tabs (tab chars, HT, '\t') as space compression or substitute but rather as a field separator with new lines the record separator. (Very old school.)
            I suspect Linus' point is more if you cannot write a parser that handles white space what does that say about the rest of your code.
            Tabs obvious from tabulate (table) have a long history going back to very early typewriters for typing tables such as itemised bills etc. Hardware terminals supported user setable tab stops as do terminal emulators like Xterm.
            ASCII has a 'Unit Separator' character*. It ain't 'Horizontal Tab'.

            That said, a lot of people do use Horizontal Tab as a unit separator, which causes display problems when the units being separated are longer than the number of characters between tab stops, and problems of interpretation when tabs are used as multi-character 'spacers' so there are circumstances where there is no character between two horizontal tab characters, which can either be ignored, or interpreted as a null depending on the parsing rules. Misuse of/overloading tabs has a very long history.


            *Also termed 'INFORMATION SEPARATOR ONE' - see this stackoverflow question and answers: https://stackoverflow.com/questions/...nd-their-usage

            and this Wikipedia article: https://en.wikipedia.org/wiki/C0_and_C1_control_codes

            and this page: https://www.ascii-code.com/character/%E2%90%9F

            While many systems use CR/LF and TAB for structuring data, it is possible to encounter the separator control characters in data that needs to be structured. The separator control characters are not overloaded; there is no general use of them except to separate data into structured groupings. Their numeric values are contiguous with the space character, which can be considered a member of the group, as a word separator.
            Of course, the ship has sailed, and people use HT for purposes which were not intended. Perhaps Linus should enforce the use of 'UNIT SEPARATOR' and 'RECORD SEPARATOR' in config files. (<- this is a joke )

            Comment


            • #36
              Originally posted by Vermilion View Post

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



              Yeah.. that's more like it.
              Absolute gem.

              Comment


              • #37
                Originally posted by ddriver View Post
                I don't really see the technical necessity to drag notions that were useful in the days of mechanical typewriter machines all the way into an os kernel section. Honestly, it is bad enough they are still parsing text. Bring your own stone table chisels and punch-cards.

                What's with software and legacy fetish... it's like walking around with the combined umbilical cords of your past 10 generations...

                This is a source of massive overhead, bloat, bugs and maintenance cost. It's like... everything has to be done in the most tedious, needlessly laborious way.

                And to top all of that, this means that only big companies can actually afford to do stuff, squeezing out independent software creatives, forcing them to commit themselves to service the big tech blob, at least till they train their own replacement and code themselves into obsolescence.

                YEY FOSS, for facilitating that. The "solution" to "evil proprietary" turned out to be its complimentary part, which big tech needed to feed its malignant growth.
                Spaces a notion from even before typewriters. Other languages have gotten rid of or never used spaces to begin with. Are you saying we should get rid of them just because they're old? No, because they're useful. Tab (as a character) is useful. Nobody is out here pressing space 4 times when programming or formatting text, they just press tab. Because that's what they SHOULD be doing, and yet somehow they then think themselves into a circle to believe that tab is the enemy and everything should be spaces.

                The tab character has a variety of uses that make it superior to spaces, and the ONLY thing that a space can "do better" is that it's fixed width, so the author of the original file can force their visual style on your editor. And the only reason to do that is because you spent more time making your code + comments "look pretty" than making them work in the first place.

                Comment


                • #38
                  Tabs have benefits, but have fallen out of favor, often because there is no good visual indication of a tab.
                  Still if you are ever between 2, 3 or 4 spaces indentation tabs allow the viewer to choose the representation, To me that seems like a great benefit already in code.
                  Still wherever you land, the fact that kconfig as a language supports both, means both have to actually work, it's really that simple.
                  If you ever want to depricate tabs, that should be a process, not a oh btw we won't supports tabs anymore.

                  Comment


                  • #39
                    The Linux code style doc explicitly mentions using tabs in Konfig files.

                    So this just moves the failure point for any tools that can't handle what is documented correct input. Instead of at some new innocent option, it will fail at one of the main well known options, and the responsible kernel engineer(s) will know what is happening when the bug occurs.

                    Comment


                    • #40
                      Originally posted by Daktyl198 View Post

                      Spaces a notion from even before typewriters. Other languages have gotten rid of or never used spaces to begin with. Are you saying we should get rid of them just because they're old? No, because they're useful. Tab (as a character) is useful. Nobody is out here pressing space 4 times when programming or formatting text, they just press tab. Because that's what they SHOULD be doing, and yet somehow they then think themselves into a circle to believe that tab is the enemy and everything should be spaces.

                      The tab character has a variety of uses that make it superior to spaces, and the ONLY thing that a space can "do better" is that it's fixed width, so the author of the original file can force their visual style on your editor. And the only reason to do that is because you spent more time making your code + comments "look pretty" than making them work in the first place.
                      You misunderstand, I am nether team space nor team tab.

                      I am more of a team "still parsing text for everything and anything???".

                      Far be it from be to criticize the aesthetic of coding as if it is still the 80s, or how insanely unreadable that is on modern day display area.

                      My configuration API is model driven and binary, it gives you introspection, type safety and real time verification to define the configuration. And yes, for legacy fetish dinosaurs, it does support parsing and generating text from the model as a fallback.

                      But get with the times already, and I don't mean you, I mean "contemporary software". Relying on text for critical stuff - that's stone age technology at this point...

                      Comment

                      Working...
                      X