An unofficial, read-only Hacker News reader. Join the beta →

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

293 points by joonehur 2 days ago | fosscomics.com | 79 comments on HN

View full thread · View on Hacker News

Comment thread (1)

  1. > 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.