45 ms·
The Collapse of the Unix Philosophy
- Philipp__ 10y ago"Have you ever kissed a girl?"
- randcraw 10y agoExactly. Waayyy TMII (irrelevant). If the bottom-up compositional model for computing that largely originated with Unix is fading, this article doesn't go there, or suggest cause. Now, that's an article I'd like to read...
- nanodano 10y agoI wonder why the original comment you responded to got flagged. I read it and it was one of the best comments?
- digi_owl 10y agoBecause either people didn't get the reference, or fanboys all over the originator...
- Philipp__ 10y agoWow, now I see it is flagged. Lol, I really do not know why, probably people do not know what I was talking about, and I even put the quote marks. Maybe I had to sign who said that? lol But I found it was perfect for these kinds of posts.
- mwpmaybe 10y agoFor those of you who might be fooled into thinking this is about things like SystemD and Docker—it's not!
- __jal 10y agoMore a reprise of the _Unix Hater's Handbook_ with a slightly different gloss, for those who remember that.
- swolchok 10y agoSounds like the author needs to read Worse Is Better (https://www.jwz.org/doc/worse-is-better.html https://www.jwz.org/doc/worse-is-better.html).
- cypherpunks01 10y agoYou might want to check that link again with a HN referer! Interesting results :)
- bad_user 10y agoThe author is in fact quoting from "Worse is Better". RTFA.
- mundo 10y ago^^^ Open incognito if you don't want to see jwz's NSFW salutations to HN readers...
- haylem 10y agoFunny that the parent was flagged, even though the link is valid, and the parent's author is not at fault. Oh! The beauty of censorship by the masses. Now I can see why jwz would choose to take a stab at HN. He may be right, and even too kind. That flag is just sad...
- grzm 10y agoAs a sibling comment points out, the submission actually quotes from Richard Gabriel's Worse is Better. That, and the snarky tone of the comment may have been what caused people to downvote and/or flag the comment. 'swolchok could also have linked to the original, thus avoiding jwz's HN-referrer redirect.
- haylem 10y agoI know all that, but if reposts or not reading articles was deserving of censorship, there'd be quite a lot of [flagged] placeholders around here.
- jondubois 10y agoI think the problem is that Linux developers started abusing the Unix Philosophy to the point that you had to know about a lot of different programs in order to be productive - Sometimes, it's much more convenient if one program can do everything that you want it to do out of the box (it requires less understanding of the system). The Unix philosophy is essentially the opposite of the Apple philosophy. It gives you flexibility and composability at the cost of simplicity and the overall experience. The optimal solution tends to be somewhere in-between. If you look at Linux, it's actually a monolithic system (which goes against the Unix philosophy); the popularity of Linux is in itself proof that people do want a single cohesive product - If the Unix philosophy was the best approach, we'd all be using Minix by now.
- pmoriarty 10y agoI didn't find MacOS to be any simpler than newbie-oriented Linux distros like Mint and Ubuntu. It was just filled with a ton of proprietary, bastardized, closed-source garbage and limits that made it more difficult for power users to understand and effectively manage the system.
- jondubois 10y agoTo be fair Linux distros have improved a LOT in the past 5 years. When I first used Ubuntu many years ago, you couldn't do anything without the command line. Installing software was a pain (I had tons of problem with Ubuntu Software Center and it never seemed to work). I use Ubuntu (Gnome) these days. The only thing I miss from Windows is Windows Explorer. Nautilus just doesn't cut it in my opinion; I always end up browsing the file system with the command line. That said, I still prefer Nautilus over OSX's Finder.
- SwellJoe 10y ago"Installing software was a mess." Of all the things to complain about in Linux, you choose the one thing that Mac OS and Windows still don't have right, and Linux had pretty good even back then?
- Analemma_ 10y agoEveryone should, at some point, read The Unix-Haters Handbook. A great deal of it is outdated or simply wrong, but it does have a running theme of a prediction that has largely been borne out: people assuming that all Unix's flaws are actually virtues and that if you don't think so, then you Just Don't Get It. It's not hard to see how this happened: since pretty much all computers that people normally interact with are either running Windows or a Unix-like system, it has set up a dichotomy in people's minds. When the Unix-Haters Handbook was released, there were still other operating systems which could have a plausible claim to being better, but they have all faded away, leaving only these two. And since the "Real Hackers" prefer Unix, Unix and all its decisions must be the right ones. Unix is great, but people need to be more realistic about its shortcomings instead of mindlessly repeating mantras about "The Unix Way" without critical examination.
- jff 10y agoHaving configured and used VMS, I feel I can conclusively say that the people in TUHH who preferred it to Unix were out of their goddamn minds.
- Isamu 10y agoOh my god yes. That and various other operating systems I can think of that I had the misfortune to develop on. Thankfully they died out long ago.
- protomyth 10y agoTo defend VMS, if you have to have an always up with hot backup and multi-machine cluster that you can upgrade without affecting the cluster, OpenVMS is quite nice. As a developer, it was a bit painful, but the whole file versioning was handy sometimes.
- CalChris 10y agoI did not know about this! http://web.mit.edu/~simsong/www/ugh.pdf http://web.mit.edu/~simsong/www/ugh.pdf It even has an anti-foreword by Dennis Ritchie which kinda reminds me of the Metropolitan Police spokesman's blurb on the back of Banksy's book. BTW, it starts off with an anonymous quote that I've never heard, Two of the most famous products of Berkeley are LSD and Unix. Unix is of course from Bell Labs. And anyone who knew anything would have said instead, Two of the most famous products of Berkeley are LSD and BSD which at least would have been funny if still inaccurate. Anyways, it seems like a fun rant of a book which I'd never heard of. The above point about not getting it can be applied to Linux as well. Lessons learned elsewhere are stupid until Linus finally understands them and then they're obvious.
- drivingmenuts 10y agoIMHO, a lot of the Unix philosophy boils down to: we do it this way because the neckbeard of my father and the neckbeard of his father and all the neckbeards before him unto the beginning of Unix on January 1, 1970 did it that way and if you want to do it differently, well, you better have a stronger neckbeard, because then we'll have two problems instead of just one.
- technofiend 10y agohttp://dilbert.com/strip/1995-06-24 http://dilbert.com/strip/1995-06-24
- prodmerc 10y agoHeh, are you religious and/or believe in left/right/conservative/liberal/Dem/Rep? Cause that would make your comment hilarious.
- fixermark 10y ago... i.e. a combination of "It's working, so let's not change it" coupled with a lack of the sort of market pressure having your OS compete in a money-changes-hands we-have-customers marketplace brings to the table to have a holistic, easy-to-convey user experience.
- crpatino 10y agopretty much, yes. i'm still to see any complainer grown an adecuate amount of facial hair, though. (incompetently) reinventing some bad idea from before you were born does not cut it, you know?
- pklausler 10y ago> I guess there wasn’t even Microsoft DOS at the time (I guess and I don’t bother to check, so check it yourself) 1969 < 1981.
- kps 10y agoHeck, in 1969 there wasn't even CP/M that MS-DOS was modelled after. Heck, in 1969 there wasn't even RT-11 that CP/M was modelled after. There was a brand new OS/8 that RT-11 was modelled after.
- pjmlp 10y agoWhere everything is a file handle, except when it is not (sockets, IPC, ...).
- teddyh 10y agoNote: A “file handle” is a FILE *, i.e. a stream as used by a lot of the higher-level functions of the C library. The term you were looking for is probably “file descriptor”. (Or possibly “inode”, “directory entry”, or “file name”? It’s not entirely clear what you mean.)
- wyclif 10y agoThis article was written hastily, and I don’t want to further improve it. You’re lucky I wrote it. I feel so privileged to read this random guy's blog, and it's terrific that he eschews inflating his ego so well.
- smudgymcscmudge 10y agoI want to add this as a comment in all my source files.
- maxaf 10y agoI'm notorious for leaving behind gems such as this. For example: https://twitter.com/noahlz/status/767851284930199557 https://twitter.com/noahlz/status/767851284930199557
- ChristianBundy 10y ago> notorious
- deleted 10y ago[deleted]
- kwoff 10y agoyep, that's where I closed the tab
- malcolmgreaves 10y agoThere's such a problem with immaturity in tech. It's frustrating because it creates barriers to learning from others. No self-respecting person is going to want to learn from someone who has a "holier than thou" or "I'm a rockstar" mindset.
- forgotpwtomain 10y ago> There's such a problem with immaturity in tech. It's frustrating because it creates barriers to learning from others. No self-respecting person is going to want to learn from someone who has a "holier than thou" or "I'm a rockstar" mindset. You wouldn't consider it to be immature to not do the right thing just because it was communicated in an unpleasant way that a 'self-respecting person' should have disdain for? I'm not talking about this particular article or defending immaturity, - I just don't see how your position is any better; more so it's just as unhumble as the 'rockstar position' since you would apparently be willing to write worse code just to avoid learning from someone that's an asshole.
- jff 10y agoAlthough I agree that Unix is a big collection of hacks and well past its prime, the author displays several fundamental misconceptions of what he's talking about. Here's a few examples: - Dirty hacks in UNIX started to arise when UNIX was released, and it was long before Windows came to the scene, I guess there wasn’t even Microsoft DOS at the time (I guess and I don’t bother to check, so check it yourself). At least he acknowledges that he's being incredibly lazy, and he shows the glimmer of an understanding as to why some of the things mentioned later happened: because Unix is from the early 70s, which were a very different time in computing & culture. - Almost at the very beginning, there was no /usr folder in UNIX. All binaries were located in /bin and /sbin. /usr was the place for user home directories (there was no /home). Putting /home on a separate partition remains a pretty common thing to this day because users will tend to have greater storage requirements than just the root. /usr/bin and the like are the result of people realizing that this secondary larger disk is an acceptable place to put binaries and other files that aren't needed at bootup. - In other words, if you’ve captured Ctrl+C from the user’s input, then the operating system, instead of just calling your handler, will interrupt the syscall that was running before and return EINTR error code from the kernel. That's not the kind of interrupt they're talking about. - I’ve read somewhere that the cp command is called cp not because of copy but because UNIX was developed with the use of terminals that output characters very slowly. Yep, terminals that print on paper are pretty slow, as are 300 baud modems. I'm absolutely crushed I had to learn that 'cp' means 'copy'--it took hours to beat that into my head, and the thousands of keystrokes I've saved over the years are a small comfort (except to my rsi-crippled hands) - The names of UNIX utilities is another story. For example, grep comes from command g/re/p in the ed text editor. Well, cat comes from concatenation. I hope you already knew it. To top it all up, vmlinuz — gZipped LINUx with Virtual Memory support. 'cat' comes from 'catenate', in fact. What would you name 'grep' instead? "searchregexandprint"? - at least the main website of C that would be the main entry point for all beginners and would contain not only documentation but also a brief manual on installing C tools on any platform, as well as a manual on creating a simple project in C, and would also contain a user-friendly list of C packages This is one of the most ridiculous ones. You're talking about a programming language defined in the 70s, for Christ's sake. Lot of websites created in the 70s? There is a document with a good introduction to C, project examples, etc. and it's call The C Programming Language, a book by K&R. When Kernighan made another language a few years ago, yeah, he made a website for it--golang.org, it's one of the best project sites I've seen. The article points out some legit problems in Unix, but even leaving aside the author's ESL challenges it's poorly-written, poorly thought-out, and poorly-defended.
- Aloha 10y agoUnix as we know it is almost 50 years of accretion - sh/bash is a great example of this. I think the Unix philosophy is still sound and alive, but the movement of technology means not everything that was universal before, is now.
- nine_k 10y agoThere's a recurring theme (e.g. [1] among many examples) of comparing the Unix Way to the way of functional programming. Both prefer small things that do one thing and compose well. What is missing in many cases is a concepts guide, explaining the key ideas, how to combine things, and what's possible in various subject areas. For GUI programs, menus / toolbars used to be the concept guide: what they show is what's possible, and they offer context help. This is why a GUI feels friendly. It sucks at composability, though. Current mobile interfaces, unfortunately, tend to lack this. If tiny GUI-oriented programs were easy to compose, had an easy way to save the composed state, and a number of daily-use programs bundled with an OS came in this form, providing example and reference, many people would consider following the suit, I suppose. [1]: http://softwareengineering.stackexchange.com/questions/61814/is-programming-in-the-unix-philosophy-the-same-as-functional-programming http://softwareengineering.stackexchange.com/questions/61814...
- rocqua 10y ago> For GUI programs, menus / toolbars used to be the concept guide This simple fact seems like the key to getting the masses into computing. For something like 6 years (say 12-18) GUIs were the way I interacted with computers. Need to do something and learn about it? Go and explore the UI until you find the option. If the option has a shortcut printed, you will remember it eventually. Sadly, GUI design is a quite separate discipline from software design. This means much open source software is missing GUIs. Those who write the software aren't always GUI designers. This also creates the mismatch between composing software and composing GUIs. As they are different disciplines, what it means to combine them means different things. A decent stopgap is massive frameworking and standardization on GUI to make it easier for devs to get a GUI. To get the really good stuff, commercial entities have the best position. They need their stuff to be usable by everyone, and this finances the hiring of GUI people. There is the rare gen of a developer that can also do GUI right, but that only has value in the case of small projects. When projects grow, unless all devs have the GUI knack, you're gonna need some dedicated GUI people. It would be great if we could get more GUI-oriented people into open-source stuff but it seems like they aren't as attracted to open-source as devs are. It might be because devs can be at the ground floor of a project, and GUI, almost by neccesity, comes later.
- drivingmenuts 10y agoI'd like to posit that at least part of the problem is we're using a multi-user operating system on machines that are universally single-user. While it may be nice to have that option, is it realistic to think that many people are going to hand over their laptop/desktop machine to another person? We're trying to use a server OS on a single-user machine, complete with all the management cruft that comes along with a server-based OS. Consequently, we don't bother re-thinking what the user needs vs. a sysop.
- strictfp 10y agoYeah, we need to abandon this complicated Multics and create a single-user OS! Let's call it something with "uni" in it - maybe "Unix"?
- beojan 10y agoWindows did that, and look at the mess that got them into. Eventually they had to introduce UAC, essentially a simplified Unix-style permissions system.
- Animats 10y agoThere are many early UNIX design decisions that have outlived their shelf life by decades. Probably the biggest one is that UNIX is, at bottom, a terminal-oriented multi-user time sharing system. This maps badly to desktop, mobile, and server systems. The protection model is a mismatch for all those purposes. (Programs have the authority of the user. Not so good today as in the 1970s.) The administration model also matches badly. Vast amounts of superstructure have been built to get around that mismatch. (Hello, containers, virtualization, etc.) Interprocess communication came late to UNIX/Linux, and it's still not a core component. (The one-way pipe mindset is too deeply ingrained in the UNIX world.)
- pjmlp 10y agoHence why UNIX on mobile is a Pyrrhic victory, as iOS, Android, ChromeOS rely on Objective-C, Java and JavaScript runtimes and their respective frameworks, just with good enough support from POSIX, that could be replaced by what is expected from any ANSI C implementation.
- favorited 10y agoIsn't that the whole point of POSIX though?
- pjmlp 10y agoANSI C and POSIX aren't the same thing. POSIX is more like the extended runtime that C needs to be portable outside UNIX walls, which isn't being fully implemented on iOS and Android. http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine.pdf http://www.cs.columbia.edu/~vatlidak/resources/POSIXmagazine...
- umanwizard 10y agoThere is no Objective-C "runtime". (Well, there sort of is, but it's just a library, not a heavy-handed thing like you're thinking of). Unlike Android, iOS apps are just normal compiled ARM machine language binaries executing natively. Yes, you have to use their APIs in order to write graphical programs, but the same is true on any OS with a GUI system. It's possible to write iOS apps in pure C if you want to. Sure, that'd be a pain, but it's possible. Less painful and actually decently reasonable would be to write all the GUI-specific stuff in Objective-C and any other logic in pure POSIX-conforming C or C++, since you can mix all those languages freely in a project.
- bch 10y ago> Some people think that UNIX is great and perfect "...great and perfect" is a strawman. Whether "some people" think that is irrelevant. Some of this article is interesting, but the fact of the matter is 40-year-old systems have signs of being 40 years old. If "fixing" everything were easy, it'd be done. Tabs in Makefiles throw off the uninitiated for 10 minutes, then they learn, shrug and move on. These scars and stories are part of the package. Reading further, some of this is just incorrect... >That’s not to mention the fact that critical UNIX files (such as /etc/passwd) that are read upon every (!) call, say, ls -l, are plain text files. The system reads and parses these files again and again, after every single call! Not on my system. > It would be much better to use a binary format. Or a database. On my system, it is ( running "ls -ld ."): kamloops$ uname -a NetBSD kamloops 7.99.64 NetBSD 7.99.64 (GENERIC) #26: Thu Mar 2 07:15:26 PST 2017 root@kamloops:/usr/src/sys/arch/amd64/compile/obj/GENERIC amd64 kamloops# dtrace -x nolibs -n ':syscall::open:entry /execname == "ls" / { printf("%s -%s", execname, copyinstr(arg0));}' dtrace: description ':syscall::open:entry ' matched 1 probe CPU ID FUNCTION:NAME 0 14 open:entry ls -/etc/ld.so.conf 0 14 open:entry ls -/lib/libutil.so.7 0 14 open:entry ls -/lib/libc.so.12 0 14 open:entry ls -. 0 14 open:entry ls -/etc/nsswitch.conf 0 14 open:entry ls -/lib/nss_compat.so.0 0 14 open:entry ls -/usr/lib/nss_compat.so.0 0 14 open:entry ls -/lib/nss_nis.so.0 0 14 open:entry ls -/usr/lib/nss_nis.so.0 0 14 open:entry ls -/lib/nss_files.so.0 0 14 open:entry ls -/usr/lib/nss_files.so.0 0 14 open:entry ls -/lib/nss_dns.so.0 0 14 open:entry ls -/usr/lib/nss_dns.so.0 0 14 open:entry ls -/etc/pwd.db 0 14 open:entry ls -/etc/group 0 14 open:entry ls -/etc/localtime 0 14 open:entry ls -/usr/share/zoneinfo/posixrules kamloops# file /etc/pwd.db /etc/pwd.db: Berkeley DB 1.85 (Hash, version 2, native byte-order) Now, I see that /etc/group -is- a plain file. This could get the same treatment as /etc/passwd if it becomes a burden. In the meantime, if it's a performance bottleneck, make a memoizing function to lookup groups and use a '-n' switch to ls. Article is probably mostly important as the author thinking deeply about Unix, and part of the developmental process of the user. ...All the bluster (some of which is interesting), then at the end walks it back: > So, I do not want to say that UNIX – is a bad system. I’m just drawing your attention to the fact that it has tons of drawbacks, just like other systems do. I also do not cancel the “UNIX philosophy”, just trying to say that it’s not an absolute. Shame about the title... But maybe that's what landed it here on HN (?) Edit: explain the "ls" command actually run.
- nanodano 10y ago"This article was written hastily, and I don’t want to further improve it. You’re lucky I wrote it. Therefore, I may provide some facts without source links." I guess I am lucky he wrote this for a pleb like me.
- sehr 10y agoIt's a joke though?
- fredoliveira 10y agoDoesn't read like one.
- sehr 10y agoWould be commonplace in any banter with friends imo, normal affected brashness.
- deleted 10y ago[deleted]
- blechinger 10y agoThat was when I stopped reading.
- vzhang 10y agoEvolution is never clean.
- TeMPOraL 10y agoEvolution does what evolution does. The problem is that selection pressure is too weak, and things that should die off survive and flourish.
- thehardsphere 10y agoIsn't that contradictory? If you start with the assumption that it's evolutionary, how does it make sense to judge whether selection pressure is "too weak" and that things "should die off?" Selection pressure is what it is.
- TeMPOraL 10y agoSelection pressure may or may not be in a feedback loop with the evolutionary process, but you can still view it as a separate component. In case of computing, the (broadly understood) market is the selection pressure. As for the notion of what should happen, this comes from humans who are capable of thinking about the evolutionary process and who value some goals over others. In particular, those humans tend to notice that the selection pressures in software industry do not promote good, efficient, and well thought-out solutions.
- pjmlp 10y ago"We really are using a 1970s era operating system well past its sell-by date. We get a lot done, and we have fun, but let's face it, the fundamental design of Unix is older than many of the readers of Slashdot, while lots of different, great ideas about computing and networks have been developed in the last 30 years. Using Unix is the computing equivalent of listening only to music by David Cassidy." Rob Pike 2004, https://interviews.slashdot.org/story/04/10/18/1153211/rob-pike-responds https://interviews.slashdot.org/story/04/10/18/1153211/rob-p...
- Arizhel 10y ago>while lots of different, great ideas about computing and networks have been developed in the last 30 years. Using Unix is the computing equivalent of listening only to music by David Cassidy. The problem here is that there aren't a lot of alternatives. You could use Windows, which is like listening only to music by MC Hammer, or you could use a Mac, which is like listening only to music by Duran Duran. Because of software/backwards compatibility concerns, and how dependent everything is on the underlying OS, it's really hard to change anything in the OS, especially the fundamental design. It'd be nice to make a clean-sheet new OS, but good luck getting anyone to adopt it: look at how well Plan9 and BeOS fared.
- pjmlp 10y agoThe thing is UNIX, by definition, is never going to move beyond its original design, meaning POSIX + C. Whereas Mac OS, Windows, iOS, Android, ChromeOS have moved into more productive language runtimes, with rich frameworks, improving safety across OS layers, even if they have a few bumps along the way.
- michaelmrose 10y agoWhat do you mean by unix in this context? Everything save for windows bears a strong kinship with Unix and every OS is more than capable of running additional runtimes and frameworks beyond C.
- vacri 10y ago> [shell] It becomes especially bad when we try to develop in it, as it’s not a full-fledged programming language. Who the hell 'develops' in shell? It's a glue language, not a development language. I've never heard anyone say "We're a shell shop".
- gpawl 10y agoIt's a glue language, but it's still painful when you write a shell script.
- dllthomas 10y agoI spent a year working on ~80k lines of bash. It was an interesting experience.
- rwmj 10y agoYou must tell us more :-) For my anecdote, I know people who did 10k+ line final year university projects in AWK and Tcl respectively. The AWK one was a particular act of endurance.
- vacri 10y agoWas the primary product in bash? Or were you working on glue? You must have mastered the bizarreness of bash arrays by the end of that :)
- dllthomas 10y agoThe actual product was hosting, more or less, although with some additional constraints that meant more moving parts. The bash grew out of manual scripts to provide automation and a UI for support. > You must have mastered the bizarreness of bash arrays by the end of that :) I mastered a lot of the weird corners, though we mostly kept them out of the code. I've forgotten much since.
- JustSomeNobody 10y agoStory time. I'll go get the popcorn.
- prodmerc 10y agoYou're free to take it all and turn it into an OS of your vision. Next thing - bitch about how Earth works, with every region, country and even, gasp, city is different because a few people a long time ago decided "this is the way to go".
- int_handler 10y agoSimilarly, our appendices, which are useless to begin with, occasionally decides to become infected, swell, and possibly burst, threatening our lives, just because biology a long time ago decided "this is the way to go."
- Arizhel 10y agoThis is incorrect. People did indeed think appendices were just useless throwbacks for a long time, but more recently the medical community recognizes their usefulness. They're basically like a first-level bootloader for the GI system, used to store bacteria in case of a severe illness like cholera or dysentery. It also serves some other immune functions. See here: https://en.wikipedia.org/wiki/Appendix_%28anatomy%29#Functions https://en.wikipedia.org/wiki/Appendix_%28anatomy%29#Functio...
- nickpsecurity 10y agoI thought it was weird that the appendix-haters didn't see the connection between appendix removal and increased stomach issues (esp diarhhea). All kinds of people I met with the operation had issues after the "useless" organ was removed.
- duncan_bayne 10y agoThat common opinion is odd, in hindsight. Natural selection ought to quickly do away with an organ that served no purpose but to occasionally kill one of the luckless organisms that possessed it. It should have been obvious that it was doing something else, or more specifically, that the gene(s) for "having an appendix" were.
- deleted 10y ago[deleted]
- pmoriarty 10y agoThis reminds me of the Stroustrup quote: There are two types of languages, the ones everyone complains about, and the ones nobody uses.
- yellowapple 10y agoMost of the author's criticisms around the Unix Philosophy™ (aside from perhaps the performance aspect) would be solvable in two steps: 1) Standardize on some structured text serialization format (I like YAML for this) 2) Write a new shell Both of these things are compatible with the Unix Philosophy™, and thus said Philosophy is nowhere near collapse. Rusty around the edges, sure, and maybe with some asbestos in the ceiling tiles, but certainly renovatable. The philosophy is already prevalent in the world of "microservices"; an application is split into a whole bunch of independent (usually containerized) programs communicating via something like JSON over HTTP.
- jstimpfle 10y agoOne format for all use cases? Databases (passwd,group...), single-word files, key-value(-list?) files, rc files for a thousand programs? Great idea! We should use XML for that...
- yellowapple 10y agoI meant that more in terms of IPC (e.g. in pipes), but most of those use cases happen to be adequately handleable by YAML specifically, so yeah, why not?
- darkr 10y agoIdeally a simplified subset of YAML; the full specification suffers from feature creep and has actual bugs.
- yellowapple 10y agoStrictYAML ( https://github.com/crdoconnor/strictyaml https://github.com/crdoconnor/strictyaml ) looks promising to that effect.
- TeMPOraL 10y agoXML, YAML, JSON and s-expressions are all just flavours of representing trees. So yeah, any of that would be a much better idea than unstructured text, and yes, you can serialize all those use cases into trees. I'd steer away from XML for sake of efficiency and human-readability though.
- gabrielblack 10y agoAm I the only one's thinking that this article is full of errors ? Starting with "killing zombie process" (sic!) and so on ?
- radiowave 10y agoThis is just beautiful: "Standard utilities provide the output in the form of a plain text. For each utility, we actually need a parser of its own." (More people would probably have read the Unix Haters Handbook if it was as pithy as this.)
- rmusial 10y ago"Taking into account the numerous mistakes of UNIX. However, no one raises Plan 9 on a pedestal." Suckless and cat-v.org would disagree. I'd also disagree since I'm a huge fan of plan9port.
- redsummer 10y agoI've always wondered why a new open-source OS has not arisen to claim the mantle of UNIX / Linux. There are so many ancient design decisions, piled up upon each other, which spawn millions of man-hours of frustration. It continues perhaps because of its esoteric nature. People don't want to throw away all the weird stuff they've learnt.
- int_19h 10y agoAnd also, because backwards compatibility matters once something is deployed on as large scale as Unix was. (Windows also has a similar problem.)
- redsummer 10y agoMaybe a parallel system needs to be implemented, like how OS X originally had a Classic OS 9 system running alongside. Once everyone had come to OS X, the classic environment was dropped.
- nutate 10y agoyawn
- dang 10y agoPlease don't do this here.
- jstewartmobile 10y agoI wish Symbolics had a better run. The Windows registry/powershell approach has the niceness of passing pieces of data instead of one big blob of text that has to be re-parsed at every step, but with the drawback of verbosity and fussy static typing. Being able to directly pass s-expressions between between programs without the format/parse/typing hokey-pokey of Unix and Windows would be nice.
- teddyh 10y agoS-expressions are very nice, and have the unequalled property of being simple enough to serve as a syntax for an entire programming language, but as a data type it is at best on the level of JSON. If one were to design a new data format for pipes, I would hope one would aim a little higher than that. Going from plain text lines to JSON or sexps would simply not be worth the infrastructure retooling.
- rocqua 10y agoWhat lies above JSON or S-expressions, XML? Or some binary format? If I had to guess, I'd say the issue with JSON and the like is how to deduce types (and the limited types available) combined with the issue of special characters in names and strings. XML goes a long way towards fixing that, but at the cost of a lot of extra bloat. A binary format with a nicely defined header might work, but those formats tend to not be so good about inserting stuff. There is something to be said in favor of plain text. If all solutions suck, go for the simplest and most flexible solution.
- teddyh 10y agoThe ability to pass whole objects (which would have to be serializable) would certainly qualify as being "above" JSON and sexps, but I’m not convinced objects would be a good idea to use in this way, which is why I didn’t specifically suggest them as an alternative.
- jstewartmobile 10y agoBeing able to use the same syntax for code and data is no small thing. This aspect alone puts it above JSON. That, and for most LISPS, S-expressions have a broader vocabulary than JSON (symbols, complex numbers, etc.).
- em3rgent0rdr 10y agoThis whole article is a bunch of strawman arguments. It points out historical mistakes by unix developers, but those mistakes aren't inherent to or a result of the Unix Philosophy: (1) Write programs that do one thing and do it well. (2) Write programs to work together. (3) Write programs to handle text streams, because that is a universal interface.
- TeMPOraL 10y agoThe arguments in the article indeed don't have much to say about Unix Philosophy per se - they're just a list of various fuckups and idiocies Unix accumulated for some reasons or others. As for Unix Philosophy, the point (3) in your summary is something that's a) dumb, and b) back when it was created, they already had better solutions. Passing text streams around is a horrible idea because now each program has to have its own, half-assed shotgun parser and generator, and you have to glue programs together with your own, user-provided, half-assed shotgun parsers, i.e. calls to awk, sed, etc. Think of it this way: if, per Unix Philosophy (points (1) and (2) of your summary), programs are kind of like function calls, and your OS is kind of like the running image, then (3) makes you programming with a dynamic, completely untyped language which forces each function to accept and return a single parameter that's just a string blob. No other data structures allowed. I kind of understand how it is people got used to it and don't see a problem anymore (Stockholm syndrome). What shocked me was learning that back before UNIX they already knew how to do it better, but UNIX just ignored it.
- em3rgent0rdr 10y ago> "The arguments in the article indeed don't have much to say about Unix Philosophy per se - they're just a list of various fuckups and idiocies Unix accumulated for some reasons or others." Right. The title should have been reflective of that "Various idiocies Unix has accumulated to this day" but since the article mentions Unix Philosophy, my point is that the article should have criticised the philosophy and not the practice. > "Passing text streams around is a horrible idea because now each program has to have its own, half-assed shotgun parser and generator, and you have to glue programs together with your own, user-provided, half-assed shotgun parsers, i.e. calls to awk, sed, etc." But this has actually proved to be very useful as it provided a standard medium of communication between programs that is both human readable and computer understandable. And ahead of its time since it automatically takes advance of multiprocessor systems, without having to rewrite the individual components to be multi-threaded. > "(3) makes you programming with a dynamic, completely untyped language which forces each function to accept and return a single parameter that's just a string blob. No other data structures allowed." That may be a performance downside in some cases, but the benefit of having a standard universally-agreeable input and output format is the time it saves Unix operators who can quickly pipe programs together. That saves more total human time than gained from potential performance benefits.
- w8rbt 10y agoI read once that the dd command (which stands for convert and copy) was not named cc because the compiler was already called that so they used the next letters in the alphabet. NAME dd - convert and copy a file
- tmccrmck 10y agoNo, it came from data definition on OS/360 JCL which is the reason why it has a different syntax than the other utils.
- asldkfjasfd7 10y agoThe beef over everything is text creating performance issues, use a binary format instead! seems bonkers. Every time there's a post like this it's all about performance!, performance! I like UNIX not because of any technical reason, but because it's easy for a human to use. Linux and UNIX are not meant to be "perfect" from a CS standpoint. They're meant to be easy for people consumption. I can't read a binary format. I can read text. That is the real point of the UNIX philosophy, IMO. Do one thing, do it well. Trying to solve too many problems at once will bite you.
- rsync 10y agoI think it's very telling that the author consistently refers to directories as "folders". All of UNIX makes perfect sense if you are using UNIX for UNIX. If you're doing other things, like abstracting to "folders" and so on ... I am open minded and can see where it starts to fall apart a bit. But I use UNIX for the sake of UNIX ... I am interested specifically in doing UNIX things. It works great for that.
- rocqua 10y agoWhat then are "UNIX things". This could be either a no-true-Scotsman, or a tautology. To solve this, you'd need to specify what UNIX is good at.
- rsync 10y ago"This could be either a no-true-Scotsman, or a tautology." It's even worse! I am saying that working in terminals, with strings of text and non-binary-format config files ... and all of the tools built around that ... is an end in itself. Every single "broken" example in the OP is something that I find non-remarkable and, in fact, makes perfect sense to me.
- rocqua 10y agoTo argue for the OP, consider the case of passwd being parsed on every system call. That is simply sub-optimal. (It also seems exaggerated to me, and feels like a prime candidate for caching). Further, there is an immense value in GUI based systems: discoverability. On a GUI, you can learn how to use a program without ever consulting a manual just by inspecting your screen. This addition is what brought the computer to the masses. Finally, the terminal model of UNIX is just horrible. The hacks-on-top-of-hacks that are needed to turn the equivalent of a line-printer into something like nCurses or tMux are horrible. The current terminal is like this purely because of legacy. If you'd design a system for "working in terminals, with strings of text and non-binary-format config files" from the bottom up, it would look totally different. Sadly, getting it to work with existing software would be a total nightmare. All that being said, UNIX still has the better terminal (though I hear good things about powershell). Certainly, it is the best system for "working in terminals, with strings of text and non-binary-format config files". Though competition is sparse (windows, and maybe mac, depending on whether you consider it to still be unix or not).
- ChuckMcM 10y agoThat was a sad thing to read, the author is so clueless they don't even know when the reasons they imagine something might have been broken are wrong. Back when UNIX was born the <tab> character was a first class citizen in every computer on the planet, and many languages used it as part of their syntax. Static binaries were invented when Sun and Berkeley co-developed shared libraries and there needed to be binaries that you knew would work before shared libraries were available (during boot before things were all mounted, during recovery, etc) It always amazed me when someone looks at computer systems of the 70's through the lens of "today's" technology and then projects a failure of imagination on the part of those engineers back in the 70's. I pointed out to such a person that the font file for Courier (60 - 75K depending) was more than the entire system memory (32KW or 64KB) that you could boot 2.1BSD in. Such sillyness.
- scribu 10y agoIMO, the main takeaway from the article isn't that "those 70's developers lacked imagination", but that UNIX is far from perfect. The author even states that UNIX was amazing when it came out, but that doesn't mean all its ideas make sense today.
- Const-me 10y agoMy favorite one “everything is a file”. My GPU has 4 times as many transistors as my CPU, and for parallel tasks, it computes stuff 50 times faster. Just too much complexity for a file, even with ioctl. I think that ideology is the main reason for the current state of 3D graphics in nix and bsd based platforms.
- rwallace 10y agoI didn't downvote you, but I'm not seeing the problem here. It's great that we have these fantastically powerful GPUs, which of course don't use text files as their internal representation, but then we have to tell them what to render or otherwise compute, and very often some form of text file is the most effective way to do that.
- Const-me 10y agoVery often, the majority of GPU IO traffic is textures. No form of text file is the most effective representation for them. However, in my comment I didn’t meant text files. I meant that in *nix, a GPU itself is a single file, /dev/dri/cardN. All that GPU’s complexity is squeezed into a single ioctl system call for that special file. The approach is IMO one of the reason why Linux still doesn’t have reliable 3D acceleration support. Here’s a long article why Linux ain’t ready for desktops, note the author listed 3D acceleration on the top: https://itvision.altervista.org/why.linux.is.not.ready.for.the.desktop.current.html https://itvision.altervista.org/why.linux.is.not.ready.for.t...
- czep 10y agoA lot of the author's criticisms are about UNIX utilities not gracefully handling filenames containing special characters. But seriously, who puts a newline in a filename? Instead of wasting time writing scripts that meticulously handle all possible edge cases, I'd much rather fix whatever broken process is putting control characters into file names.
- TeMPOraL 10y ago"Doctor, it hurts when I do this." "So don't do it." The problem with filenames is just a symptom of the biggest problem of UNIX conventions - passing around unstructured text. Filenames should have one well-defined format (AFAIR kernel allows pretty much anything but the NULL character). That's it. For most applications, filenames should be opaque data blobs compared for binary equality. But because we're passing around unstructured text, each program has to parse, reparse, and concatenate strings via ad-hoc, half-assed shotgun parsers. Each program does it slightly differently, hence the mess.
- fnj 10y agoWhen the design was made, no one was considering pathology. We were all too invested in the wonder of making it all work to worry about people screwing around in crazy ways, let alone purposeful attacks. As long as everyone recognized that putting certain characters in pathnames was counter-productive, things worked fine. Nobody ever dreamed of putting a space character in a filename when they all came from a CLI background. When barbarians came from Mac/Windows to UNIX, they lacked this background, and there went the neighborhood. I remember being stunned when I first encountered two periods in one filename! But it only took me a few seconds to grasp the fact that period was just another character, "suffixes" were just conventions, and it all made perfect sense. OTOH, the first time somebody showed me a file named "-fr\ \*" and suggested I delete it, I got one of my first disillusionments. P.S. - "/" is a character which is also "special" in pathnames. Actually, the particular FS may make other exceptions which are not globally enforced by the kernel. ZFS has several (such as "@").
- TeMPOraL 10y ago
- webaholic 10y ago"You’re lucky I wrote it." No Mr. Askar Safin. YOU are lucky that I am reading it.
- white-flame 10y agoSome of my primary beefs with Unix, stated more concisely than the rambling article: 1) Text is for humans, and is generally incomprehensible to machines. Encodings, arbitrary config file formats, terminals, etc, are all piles of thoughtless one-off hacks. It's a horrible substrate for compositing software functionality, through either pipes or files. 2) Hierarchical directory structures quickly become insufficient. 3) The filesystem permission model is way too coarse grained. 4) C is a systems/driver/low-level language, not a reasonable user-level application or utility language.
- unethical_ban 10y agoTo 1: Computers are for humans. I like my configurations to be accessible to me, as well as my logs.
- white-flame 10y agoWho gets to decide what "accessible" means? Too many unix programs have their own completely ad-hoc printer and parser for config files, which have different assumptions. Some allow comma-separated entries in values. Some space or tabs are significant. Varying comment characters. Varying support for multi-line entries. Varying support for quoted strings. Varying support for unicode. Some are key/value, some are section based. Arbitrary special punctuation abounds. It's a fundamental, unstandardized mess. From the perspective of just a single program, then fine, it does what it needs to and its individual text formats are human-understandable, and its code is quickly banged together to do what it needs with it. From an ecosystem perspective, it's a complete failure of usability and _interoperability_, which is the entire point of Unix philosophy in the first place! Humans aren't the only ones reading & writing config files: Software needs to do it, too, be it applications or automation scripts. Again, text is a horrible substrate for compositing software functionality.
- nickpsecurity 10y agoEasy: a tool comes with it yo do that or it's a standard, data format you view with existing tool. You even get closer to UNIX philosophy of one app per task that way given the mess ad-hoc text leads to.
- harel 10y agoHe lost me right at the beginning, with "I guess there wasn’t even Microsoft DOS at the time (I guess and I don’t bother to check, so check it yourself).". This is the OS equivalent of a Call of Duty teenage online player on XBox live.
- rwallace 10y agoWell it's a true statement, even if made in an irascible way. If you're going to insult the guy, at least wait until he makes a false statement.
- harel 10y agoWasn't intended as an insult. Just a statement as to where he lost me and why. The tone of the post was so arrogant it might have carried over to my comment.
- pdkl95 10y ago> Unix Philosophy Note that this philosophy covers many concepts. These discussions often mention the modularity and composition rules, but the other parts of the philosophy are also important. See "The Art Of Unix Programming" for a full explanation of the philosophy. http://www.catb.org/esr/writings/taoup/html/ch01s06.html http://www.catb.org/esr/writings/taoup/html/ch01s06.html
- powera 10y agoTLDR - things have names, isn't that terrible?
- vatotemking 10y agoI'll wait for the satirical summary of this HN thread. :-)
- SFJulie 10y agoPrefer an original older funnier version : http://harmful.cat-v.org/software/operating-systems/linux/ http://harmful.cat-v.org/software/operating-systems/linux/ I suspect the author of this site have contributed to the linux haters handbook. Some quotes: “Linux printing was designed and implemented by people working to preserve the rainforest by making it utterly impossible to consume paper.” – Athas “ALSA is like the emperors new clothes. It never works, but people say it’s because you’re a noob.” “Object-oriented programming is an exceptionally bad idea which could only have originated in California.” – Edsger Dijkstra “[firefox] is always doing something, even if it’s just calculating the opportune moment to crash inexplicably” – kfx ....
- ebbv 10y agoThis is an absolute garbage tier article. What on earth is it doing on the HN front page? The author has no clue what he's talking about (and admits it several times) and makes many logical leaps (one time the author said Gnome should have used a registry, so UNIX configs are bad?) all over the place.
- deleted 10y ago[deleted]
- OceanPowers 10y agofrom my cold dead(maxTimeToLive < 50y) hands!
- bigger_cheese 10y agoFor a interesting critique of Unix the "Ghosts of Unix Past" series of articles on LWN is pretty interesting. https://lwn.net/Articles/411845/ https://lwn.net/Articles/411845/ The whole series is worth a read, especially part 3 'unfixable desgins' which talks about Signals and the Unix permission model.
- dorianm 10y agoI do think we lost of the "do one thing and do it well" https://en.m.wikipedia.org/wiki/Unix_philosophy https://en.m.wikipedia.org/wiki/Unix_philosophy Part of it is that it's way more annoying to maintain a little tool than to make it part of a bigger project with a much bigger community, it's also far harder to discover than just being in the docs a bigger project
- curiousGambler 10y ago> You’re lucky I wrote it. I read this, and was like "screw that, I'm not going to read it," and then was like, well let's see, and after reading, wish I had stuck with my initial gut instinct to close that tab. smh.
- nrdwavexe 10y agoThe links between ideology, communism, negative thinking, and UNIX run deep. It has been said that UNIX is the only operating system that grows on you. The ability of UNIX to tolerate negative thinking and poorly-behaved programs is its strength. Please note that the Google result for "UNIX philosophy" names a GOOGLE EMPLOYEE as the "originator of unix philosophy" without disclosing the conflict of interest. This not only evil but very stupid. When multibillion dollar companies get involved in altering history, watch out.
- howfun 10y agoArticle is badly formated on mobile.
- gkya 10y agoWell it's not decent on desktop either.
- jdblair 10y agoThe most interesting thing I learned from this article is the sprintf() pre-compiler (http://blog.kazuhooku.com/2014/10/announcing-qrintf-and-qrintf-gcc.html http://blog.kazuhooku.com/2014/10/announcing-qrintf-and-qrin...). That's awesome. The rest, well, its a helpful check on over enthusiasm to be familiar with the shortcomings of UNIX. By dint of its popularity, diversity and long lineage, UNIX and its derivatives are particularly rich in warts. Yet, I think it must be true of all real-world operating systems with a long life that cruft, workarounds and ossified bad ideas accumulate.
- sedatk 10y agoThe Collapse of The Blog Philosophy.
- gwu78 10y ago"How can we recursively find all files with \ name in folder foo?" Whenever someone tries to critique UNIX they always make up these nonsensical problems. No UNIX user would intentionally name a file with a forward slash, a space, a semicolon, etc. But I will play along. To find these files, a number of ideas come to mind. Maybe the easiest would be to use mtree to make a file specification and then search the specification. Something like mtree -cp /foo |exec mtree -C Any forward slashes, spaces, or other nonsense in filenames would appear as octal values. If there are so many files that these specifications become large enough to cause problems with UNIX utilities, I import them into a database like kdb. Is there a way to hide files from mtree? Maybe. But at least with the UNIX concept for a system, the user can look at the source and see how it works. The truth is, UNIX is not so impressive. It is only the fact that the alternative systems for doing the types of things one does with UNIX have always been inferior/rubbish in the opinion of a certain set of informed users. It is this contrast that makes UNIX seem impressive. As usual, the author makes no suggestion or detailed comparison of any other alternative that can be used for doing the tasks one does with UNIX.
- deathanatos 10y agoHe didn't even get the find command that he has such a distaste for correct: > How can we recursively find all the files with \ name in a folder foo? The correct answer is: find foo -name '\\\\' No, the correct answer: % find foo -name '\\' foo/\ > We need to write four backslashes here as UNIX shell performs backslash expanding, and find does it too. The single quotes prevent the shell from performing escaping. Find does need escaping, and that's the only layer that does, so the correct answer has two backslashes.
- xkxx 10y ago> Let’s say we need to delete a file on host a@a. The name of the file is in a variable A. How can we do it? > [...] > Anyway, the correct answer is: `ssh a@a "rm -- $(printf '%q\n' "$A")"` In zsh it's just `ssh a@a "rm -- ${(q)A}"`.
- T3RMINATED 10y agoUNIX is a waste of human energy. Windows is the future.
- daemonk 10y agoI am not a power user. But I found this to be a great read. It's interesting to see the historical and sometimes vestigial traces in unix. However, for all the flaws that were pointed out, I still can't imagine doing my work on windows vs linux. Even if I do have to sometimes spend effort battling linux's idiosynchracies. At least when something goes wrong in unix, I can probably go and find/fix what went wrong because the underlying system is mostly plaintext and transparent. Versus when something goes wrong in windows, it's more of a blackbox to me. But that could just be me not understanding windows enough.
- falsedan 10y agoI would prefer more constructive criticism: this reads like a synopsis of The UNIX-HATERS's Handbook[0], and (while quoting from Worse is Better[1]) glosses over how UNIX is terrible because it out-competed its peers by being 'better' (compromising its design and consistency to improve its delivery and practicality). It's valuable to challenge assumptions held in a community (to avoid the Normalization of deviance in software: how broken practices become standard[2]). It's more valuable to suggest improvements, and most valuable to improve it. [0]: http://web.mit.edu/~simsong/www/ugh.pdf http://web.mit.edu/~simsong/www/ugh.pdf [1]: https://www.dreamsongs.com/WorseIsBetter.html https://www.dreamsongs.com/WorseIsBetter.html [2]: http://danluu.com/wat/ http://danluu.com/wat/
- vermaden 10y agoThe author writes 'Unix' but backs his thoughts only from Linux systems ... and Linux is not Unix ... I will stop right here ;)
- markhahn 10y agoNewbie discovers historical and technical debt, interprets as collapse.
- rnhmjoj 10y agoI'm surprised it doesn't mention the X Window System.
- Girlang 10y agoEven though we target Linux and BSD, we do all our development in Windows 10 with PowerShell (which also runs on Linux). Windows programming API + Powershell is truly much better than Linux. I wish everyone used Powershell. It would solve a lot of these shell programming issues.
- smcdow 10y agoCan't wait to read the n-gate webshit weekly entry on this one.
- gluggymug 10y agoThe comments on this thread have been more interesting than the article. I think the common theme is a push to innovate and take the next step in computer systems. If we scan this thread we could come up with a list of issues/problems with UNIX. Human inclination is to instantly look for each solution as each problem presents itself. Eg. "Text as an interface is unstructured" -> "Use other formats". The end result becomes a lot of feature creep, adding layers over the OS to hide the usability issues of the past. Then, a new user comes along and wonders, "How did it all get so messy?" The ideation-style approach to innovation is NOT to leap straight to solutions. Avoid analyzing the problems immediately. Don't criticize other people's existing thoughts. Instead we use our creativity to add to the list of problems. We build it up even more. Add tangential issues that may be not just UNIX related problems. Add future issues. Add past issues. You keep adding until you exhaust all the avenues. You don't want to block your thoughts or anyone else's. If anything, the previous problem someone raises should inspire your next one. Once you have drained out all the issues and you can't squeeze out any more complaints, then you can take a step back and look at all the problems as a whole. You group them into categories that have common themes. You try to generalize and re-express them in vaguer terms. After you have your themes, you can think about making a list of solutions. Again you don't want to be critical about the feasibility of a solution. You just want to build a list of different solutions. Each solution should inspire a new different solution. There are mental exercises that you can do to inspire tangential thoughts - word games etc. When you have a giant list of solutions, then you categorize again. Those categories are the start point to building something innovative. The alternative is just another iteration of what already exists. My own thoughts on this are that I seem to need "power-user" abilities way too much. My field is actually Hardware. Something is wrong if I am jumping through a lot of hoops outside of my specialty just to get work done. It's not just UNIX either. My friends and family often call on me to handle their Windows or Mac issues because I am the closest thing to an expert they know. They shouldn't have to.
- gotthemwmds 10y agoI'm sorry but I am not reading an article that says, "You're lucky I wrote it," in the first paragraph. And from the comments, it sounds like I'm not missing much. Author, don't treat your readers like idiots. I can guarantee some of them are much smarter and more experienced than you.
- angry_octet 10y agoI spent many minutes reading this and at the end I wish I'd put it into the TL;DR category.