Earlier quoted context omitted.
Well, I'm advocating for structured text , not binary . Mostly because I haven't seen a future-proof binary format yet, and editing binary formats indeed would require special tooling. I think - for a data exchange protocol meant to be used between many applications - going structured text instead of binary is a worthwhile tradeoff of little lower efficiency vs. much better accessibility. EDIT: Some comments here are…
Can you name me a single UNIX configuration file whose format is not "structured"?
The Rule of Silence (2006)
221–230 of 318 posts
Re: The Rule of Silence (2006)
#222Earlier quoted context omitted.
Here's mine: examples () { man $1 | less +/^EXAMPLES } Usage: $ examples su EXAMPLES su -m man -c catman Starts a shell as user man, and runs the command catman. You will be asked for man's password unless your real UID is 0. Note that the -m option is required since user “man” does not have a valid shell by default. In this example, -c is passed to the shell of the user “man”, and is not interpreted as an argument t…
You probably still want the MAN_KEEP_FORMATTING=1 part, to keep colorization and bolding etc. in the manual page. Also, your solution does not respect the user’s pager preference; the user might prefer to read man pages in “w3m”, for instance.
Underlining is the only formatting I care about and that works without MAN_KEEP_FORMATTING on FreeBSD.
I don't have colorization enabled in man pages on my laptop, and also I don't have bolding enabled either. I like it this way.
>your solution does not respect the user’s pager preference; the user might prefer to read man pages in “w3m”, for instance.
The pager preference of the user in this case is `less`. I know because the user happens to be myself :^)
Re: The Rule of Silence (2006)
#223Earlier quoted context omitted.
> ...So you're talking about having text-serialized key-value objects (or any other kind of object), with standard deserializers and tools for manipulation? Yes, basically. Someone in power should just pick any format - modified JSON (without the integers are really IEEE754 floats stupidity), s-expressions, whatever - and make standard deserializers part of the system library.
Heh heh, "someone in power." Who would that be? There's no authority to complain to about all this... Structured text formats come and go: S-expressions, SGML, XML, JSON, "modified JSON", etc etc etc... Fortunately the Unix tools work the same with any byte stream, pretty much, so they've survived gloriously since the 1970s. That's kind of the whole deal with "worse is better."
Whoever accepts patches to base UNIX system libraries would be a good start.
> Fortunately the Unix tools work the same with any byte stream, pretty much, so they've survived gloriously since the 1970s.
So would a structured text format, except you wouldn't be discarding and then recreating semantic information at every junction of a pipe.
Re: The Rule of Silence (2006)
#224Earlier quoted context omitted.
In 1993, someone made exactly your argument a in Redmond board room, and so many people agreed that what you describe could be adequately called "The Windows Philosophy". All settings in a database and not text files (the registry); a command-line that pipes data, not text (PowerShell). Tailored UIs to change settings, not magic invocations and obsure text file syntaxes. I guess most developers on HN are also aware o…
The windows registry is not too bad. You can easily store this stuff in a SQLite file though: https://www.sqlite.org/appfileformat.html PowerShell' object-oriented nature is great btw!
It actually is really good, but I do find it interesting that the first and last loser of the desktop wars got there a good long time ago.
[1] https://en.wikipedia.org/wiki/Workplace_Shell , https://en.wikipedia.org/wiki/Object_REXX
Re: The Rule of Silence (2006)
#225To play devil's advocate, part of the reason things like The Rule of Silence are talked about is because of the messy unix philosophy of treating everything like plain text. If structured data was embraced we would have developed appropriate tooling to interact with it in the way that we prefer. This runs very deep in unix and a lot of people are too "brainwashed" to think of other ways. Instead they develop other ex…
I was on Windows for about 20 years and moved to Linux about a year ago. One thing I happen to like the most in Linux is file-based configuration. If you add a settings-database to Linux you would end up with the same mess that you find in Windows. In Windows you have the Registry (a giant database for OS and app settings) AND you have the config files. Great... settings are spread over a gigantic db AND the file-sys…
Re: The Rule of Silence (2006)
#226It's often a stupid rule. If you have a process that is stuck, you type "kill " to kill it. But kill doesn't tell you if the process was killed or not, so you have to double-check with "ps " to see if it is still alive. If it is, you try again with "kill -9 ". I suspect the reason is that for most signals, kill can't determine if the signal was acted upon or not. But for KILL and TERM it could wait a few milliseconds…
> "those who are saying that I can write a wrapper script is missing the point" No, it is exactly the point. Unix gives you Lego pieces to build things from. A bunch of small Lego pieces you can join however you like is way more useful than a giant chunk of Lego that someone has glued together into whatever lump they happened to need that day. When you ask why your Lego bucket didn't ship with pieces preglued into ex…
That way, everybody wins. Both those who don't like Lego playing (me) and those who do (you).
> If that wasn't what you wanted, perhaps consider a different kind of toy?
I'd switch from GNU/Linux to something with a more sane design in a heartbeat! Unfortunately for me, the only free operating system began life as a Unix-clone. Thanks to an historical artifact more than a testament to the greatness of the "Unix philosophy".
Fortunately for me, there are a lot of people who have understood that thinking of an operating system as a jumbled bag of Lego bricks doesn't lead to good system design and are doing something about it (systemd and many more projects).
Re: The Rule of Silence (2006)
#227To play devil's advocate, part of the reason things like The Rule of Silence are talked about is because of the messy unix philosophy of treating everything like plain text. If structured data was embraced we would have developed appropriate tooling to interact with it in the way that we prefer. This runs very deep in unix and a lot of people are too "brainwashed" to think of other ways. Instead they develop other ex…
The thing about today's Unix Philosophy, epitomized by both the BSDs and Linux is that it's backward-looking. There's a Garden of Eden myth and everything. Look at the reaction to systemd. I remember getting fairly excited when Apple OSX first came out and quite a few of the configuration files were XML-based. Finally, a consistent format, but it wasn't pervasive enough. Even Apple couldn't see fit to break with the…
Re: The Rule of Silence (2006)
#228Earlier quoted context omitted.
In 1993, someone made exactly your argument a in Redmond board room, and so many people agreed that what you describe could be adequately called "The Windows Philosophy". All settings in a database and not text files (the registry); a command-line that pipes data, not text (PowerShell). Tailored UIs to change settings, not magic invocations and obsure text file syntaxes. I guess most developers on HN are also aware o…
The philosophy sounds great. Maybe the downsides are because of the execution?
Re: The Rule of Silence (2006)
#229It's often a stupid rule. If you have a process that is stuck, you type "kill " to kill it. But kill doesn't tell you if the process was killed or not, so you have to double-check with "ps " to see if it is still alive. If it is, you try again with "kill -9 ". I suspect the reason is that for most signals, kill can't determine if the signal was acted upon or not. But for KILL and TERM it could wait a few milliseconds…
> It's often a stupid rule. By the way, I haven't down-voted you, but I think I understand why others did. Before calling stupid a pillar of a (programming) philosophy with decades of useful outcomes, you should stop and ask yourself whether it's just a matter of taste on your side or, even more likely, of ignorance.
Re: The Rule of Silence (2006)
#230Earlier quoted context omitted.
Can you name me a single UNIX configuration file whose format is not "structured"?
Config files are less of a problem. The issue is with programs, which you want to use with pipes. Each has its own undocumented, arbitrary pseudo-structure with often inconsistent semantics, optimized for viewing by user.