Hacker News new | ask | show | jobs
by agumonkey 1547 days ago
From a semi shallow position, what annoys me with linux is the lack of genericity above the "file" abstraction (which is not even real enough).

I remember seeing GNU ls code, 30% argparse, 30% formatting.., all of this seems brittle and redundant.

Bazaar is fine to allow freeform innovative evolution but it's also too messy.

2 comments

Linux has a lot going on above the file level, it's just not in the kernel.

Most people using Linux also have DBus and Pulse/Pipewire going, and a ton of other stuff.

Network devices are technically files, but in practice they are names. I have no idea what them being a file even means at the byte level. They're just names that you deal with through NetworkManager's DBus API, if you're not targeting any of the minimal or embedded distros.

This feels like an odd critique. I would expect that more programs should devote more code to the parts that interact with a user. That is, the size alone isn't much of a signal. Is it?
In the sense of the PowerShell engine doing the argument parsing and display formatting for all cmdlets, which is something I think the designers took from VMS shell. That makes for "Don't Repeat Yourself" (one place for all the argument parsing code) and from the user experience side all commands which subscribe to this take parameters in the same way, arguments handled in the same way, with the same common parameters, and support parameter introspection and tab completion, etc. so it can be a more uniform experience.

(Not always great though; I don't know VMS shell but PowerShell cmdlets can still have similar tools taking different parameter names for the same concept, or not working implementing what to do with common parameters, or taking DSLs in strings like WMI Query Language, or taking rather opaque and unique hashtable blobs).

I didn't mention it but powershell was in my mind. powershell format-table in particular. Also there's some guys who are patching linux user space to embed json as output (and the jc wrapper to be able to leverage jq later down the pipe)
The formatting is redundant and should be able externalized. The argparse also deals with the output formatting, hence redundant. Only file spec selection is core to LS.
Redundancy isn't, by itself, a problem. In the case of core utilities, it affords them a level of stability that is just not even attempted in many areas.