An unofficial, read-only Hacker News reader.

Lions' Commentary on Unix: Why It Was Secretly Copied for 20 Years (opens external site)

293 points by joonehur 3 days ago | fosscomics.com | 81 comments on HN

View full thread · View on Hacker News

Comment thread (4)

  1. Why is Unix so great? I have worked with Linux for many-many years, and I feel like I understand most of the programming model of how to write applications as K&R intended, yet I am unimpressed.

    Just what is so good about Unix/Linux that has allowed people to be so incorrigibly smug bout themselves?

    Multiuser? The PC has deprecated the Terminal-Server model by the 90s.

    Piping together C programs? I think this model has kinda sorta failed as well. Most people would agree shells are better implemented as a fast scripting-language, rather than a chain of C programs passing text around.

    I was taught that the Unix philosophy is writing a shell script and gluing these small programs together, orchestrated via a shell script. But this model has failed to scale up in complexity, even inside the Unix world. There are no more web servers that handle requests like this. Instead of lex/bison grammars, GCC people have made their compiler into a monolith. The Linux kernel is a huge monolith.

    It's the typical sanctimonious religious mentality - people preaching things they do not themselves follow, repeated at every level of the clergy

    Unix design lends itself to scheduling programs interacting via pipes/files written in a synchronous, blocking manner, but tying IO to threads has been accepted as a performance mistake for various reasons, and nowadays io_uring is what the cool kids use.

    But if you don't code like this, and nobody really does nowadays, what does that make fork(), other than a cool novelty?

    I don't wanna shill Windows, but at no point in my life did anyone doing things on Windows, but people still built stuff on it, and other people used said stuff without major complaints. Yet Linux/Unix has been always presented as this morally and technically superior environment and shilled hard.

    But when I asked the question of 'Why is Linux better?', the few people who have offered me something other than smug condescension, said things like 'fork() is cool', 'every config is a textfile', 'you can tunnel everything through SSH'

    Yes these things are cool, but computers can do a lot of stuff other than this, and there are no magical Linux specific answers to be found for those.

    Replies (2)
    1. > Piping together C programs? I think this model has kinda sorta failed as well. Most people would agree shells are better implemented as a fast scripting-language, rather than a chain of C programs passing text around.

      I think you missed the point, which wasn't the C part, but the piping together part. it doesn't matter the language, the point is to be able to pipe programs at each other.

      Replies (1)
      1. I don't think so. Piping together stuff is neat, but it's not something to base an entire OS around. Also, if you were to pipe stuff together, C is one of the best languages, thanks to its lax memory model, you can memcpy stuff between stdin and stdout, and many programs like cat don't even need a heap.

        It's one of the reasons why Rust's coreutils has trouble matching the old C ones in performance.

        But as I said, piping programs together, which was sold as 'the Unix way', doesn't scale to complex apps, as not even the most hardcore FOSS people, like Stallman write code like that.

        Btw something similar exists for Windows, where it used to be that every button and textbox sent and received messages, and had OS level identity, but nowdays even MS's own toolkits dont work like that anymore.

    2. > But if you don't code like this, and nobody really does nowadays, what does that make fork(), other than a cool novelty?

      Long long ago I used to think that fork()+exec() was brilliant, and spawn() terrible. Eventually I learned the error of my ways. 'Twas vfork() that was brilliant, though it get undeserved hard. So I wrote https://gist.github.com/nicowilliams/a8a07b0fc75df05f684c23c... which was the one viral HN post of something I wrote (https://news.ycombinator.com/item?id=30502392). spawn() an posix_spawn() are pretty good too (posix_spawn() is very good, actually).

      > I don't wanna shill Windows, but at no point in my life did anyone doing things on Windows, but people still built stuff on it, and other people used said stuff without major complaints. Yet Linux/Unix has been always presented as this morally and technically superior environment and shilled hard.

      Windows did get a few things much better than Unix:

        - access tokens over piecemeal [gs]et*[ug]id()
        - security descriptors over piecemeal stat()/chown()/chgrp()/chmod()/[gs]etfacl()
        - object handles over file descriptors
           - process object handles
      
      > But when I asked the question of 'Why is Linux better?', the few people who have offered me something other than smug condescension, said things like 'fork() is cool', 'every config is a textfile', 'you can tunnel everything through SSH'

      They are very very right about the latter two things, but 'fork() is cool' is wrong. 'Tis vfork() that is cool.

      Specifically the thing that sucked about Windows for a very long time was the difficulty in automating administration due to lack of scripting interfaces. GUIs were first, APIs second, CLIs dead last as a priorities at Microsoft. Unix developed before GUIs, so the CLI was the UI, and there were not really many APIs at all. Unix was API-poor, GUI-poor, CLI-rich, but CLI-rich meant that it was easy to do sysadmin, and when you're building large data centers, that's a big big plus.