Live data from Hacker News

The Collapse of the Unix Philosophy

kukuruku.co

441–450 of 616 posts

Re: The Collapse of the Unix Philosophy

#441

Earlier quoted context omitted.

Piping isn't the culprit. It's what you pipe that is, and Unix Philosophy says "pipe whatever the hell you want, and let the users upstream sort it out". It's not about encoding everything in exactly the same way. It's about providing the basic, shared protocol for representing structure. With typical Unix tools, you don't have "simpler encodings", you have no encoding at all . Each tool outputs whatever its particul…

There exists a shared protocol. It's called "explain it". But that's typically not even needed, the user can just look at the data and figure it out. > With typical Unix tools, you don't have "simpler encodings", you have no encoding at all. You don't even believe this yourself, do you? That's so obviously wrong. Name a well-thought out text file format that can't correctly be parsed e.g. by a Python one-liner with b…

I call "No True Scotsman"

Re: The Collapse of the Unix Philosophy

#442
post #364

Earlier quoted context omitted.

Powershell did one thing wrong, in that its tools emit objects , not data . In other words, they emit data with behavior (methods). This, in turn, imposes the CLR object and memory model on the whole thing, and makes the pipeline impossible to use between distinct processes. The right way to do this is to pick some reasonable text-based structured interchange format - s-exprs, JSON, whatever. Actually, it wouldn't be…

The problem here is that most unix tools (ls being the exception) do double duty, they both emit output for other programs and output for the user. Which one you get and how the user output is presented being controlled by flags. If you want them to only emit data in a standardized format you are implicitly cutting out the user. Since direct use by a human is arguably the main use case, output formatting needs to be…

> most unix tools (ls being the exception) do double duty, they both emit output for other programs and output for the user. Which one you get and how the user output is presented being controlled by flags.

Which is where they fundamentally break the principle of "doing one thing, and doing it well". Formatting output for user should be a separate step (even if implicitly handled by your shell).

Re: The Collapse of the Unix Philosophy

#443
post #154

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

> I think it's very telling that the author consistently refers to directories as "folders".

You do understand that the article was written in different language (russian), right? I kinda think this makes your whole argument broken.

Re: The Collapse of the Unix Philosophy

#444

Earlier quoted context omitted.

> 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 True enough, but as a younger programmer, I find it pretty reasonable to look back at computer systems of the 70s and wonder if we can do better today . I feel a little bit gross every time I have to write a bash sh…

JSON doesn't have comments so it's a bad choice for human-editable config. YAML doesn't have an end marker so you can never be sure if you've got the entire file. XML is a huge pain to edit by hand if the schema is complicated, and overly verbose if it isn't. None of them are even close to being safe (for example https://arp242.net/weblog/yaml_probably_not_so_great_after_a... ). All of those choices fail your "elegan…

The issue with all of these, of course, is that in order to get a system running you have to configure multiple "independent" tools, processes and daemons. Think setting up a web application - you have to configure the web application to listen on a certain port/UNIX socket, then configure your web server to go find it. You then need to scale this up across logical servers separated by a network - your web servers need to communicate with your database, they need some sort of authentication key/password, etc etc. You're never just configuring one thing.

The modern solution would be that there needs to be a network configuration tool which generates specific configurations for each component, is capable of encoding arbitrary invariants, and works consistently. Configuration also needs to be "push" based on events - when a DNS server dies, it should be able to figure out "we need at least 2 DNS servers, we have 1, fire up a new one - then update all systems to know about the new one".

Configuration management systems for Linux, by and large, suck. They're very good at starting from an Ubuntu Server install and building on that, and then get more and more fragile as the system lives on. Some of them (Saltstack, for example) do have some degree of event management - you can run certain commands on certain things happening, but it's not declarative or reactive in the way you'd hope - e.g. you can't just say "this system knows about all DNS servers" and expect it to work. The Docker/Kubernetes ecosystems claim to solve the network configuration problem (in a really awkward roundabout way), but not really intra-system configuration, and it still takes a lot of manual work.

NixOS gets a lot closer - but it needs to be expanded with a constraints solver and an event processing system. It's Turing-complete, so you can encode pretty much whatever you want into it, while still being a reasonable configuration language (basic use of it looks a lot like JSON).

But the point is - the formats individual components use for configuration should be more-or-less irrelevant. They could be completely opaque, so long as it's possible to get from the network config to the individual component's config and it's possible to update that config on-the-fly. In fact, it'd be more useful to standardise on one library which can handle all that for you.

Re: The Collapse of the Unix Philosophy

#445

Earlier quoted context omitted.

There exists a shared protocol. It's called "explain it". But that's typically not even needed, the user can just look at the data and figure it out. > With typical Unix tools, you don't have "simpler encodings", you have no encoding at all. You don't even believe this yourself, do you? That's so obviously wrong. Name a well-thought out text file format that can't correctly be parsed e.g. by a Python one-liner with b…

I call "No True Scotsman"

I don't understand (sorry). Could you explain?

Re: The Collapse of the Unix Philosophy

#446

Earlier quoted context omitted.

I call "No True Scotsman"

I don't understand (sorry). Could you explain?

"All things like A are in category X. Except this long list I wrote, but they aren't really A, because I need my syllogism to work."

Re: The Collapse of the Unix Philosophy

#447

Earlier quoted context omitted.

I don't understand (sorry). Could you explain?

"All things like A are in category X. Except this long list I wrote, but they aren't really A, because I need my syllogism to work."

You missed my cynism. I was opposed to these formats in the first place.

Re: The Collapse of the Unix Philosophy

#448

Earlier quoted context omitted.

Piping isn't the culprit. It's what you pipe that is, and Unix Philosophy says "pipe whatever the hell you want, and let the users upstream sort it out". It's not about encoding everything in exactly the same way. It's about providing the basic, shared protocol for representing structure. With typical Unix tools, you don't have "simpler encodings", you have no encoding at all . Each tool outputs whatever its particul…

There exists a shared protocol. It's called "explain it". But that's typically not even needed, the user can just look at the data and figure it out. > With typical Unix tools, you don't have "simpler encodings", you have no encoding at all. You don't even believe this yourself, do you? That's so obviously wrong. Name a well-thought out text file format that can't correctly be parsed e.g. by a Python one-liner with b…

> Name a well-thought out text file format that can't correctly be parsed e.g. by a Python one-liner with basic string operations. And please don't include: JSON, XML, YAML, sexps, because it's not possible, at least not without a library.

Well, because this library should be a part of the OS API.

A set of conrete cases where existing practice is bad is Unix itself (and its descendants). Think of every time a script breaks, does something unexpected, or introduces a security vulnerability, because every program has to contain its own, half-assed parser for textual data.

Re: The Collapse of the Unix Philosophy

#449

Earlier quoted context omitted.

"All things like A are in category X. Except this long list I wrote, but they aren't really A, because I need my syllogism to work."

You missed my cynism. I was opposed to these formats in the first place.

Which seems at odds with the thesis, at least as far as I can figure it out.

Re: The Collapse of the Unix Philosophy

#450

Earlier quoted context omitted.

> 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 True enough, but as a younger programmer, I find it pretty reasonable to look back at computer systems of the 70s and wonder if we can do better today . I feel a little bit gross every time I have to write a bash sh…

JSON doesn't have comments so it's a bad choice for human-editable config. YAML doesn't have an end marker so you can never be sure if you've got the entire file. XML is a huge pain to edit by hand if the schema is complicated, and overly verbose if it isn't. None of them are even close to being safe (for example https://arp242.net/weblog/yaml_probably_not_so_great_after_a... ). All of those choices fail your "elegan…

>JSON doesn't have comments so it's a bad choice for human-editable config (...)

What about Lua tables?

Post reply on HN