It's amazing how early design mistakes of successful software end up getting after-the-fact justifications that are ardently defended by its fans.
Example: /usr was the disk for users data in the original Unix (old docs use /usr/ken in examples after K. Thompson). When the root disk got full they started storing programs there and /usr/bin was born.
People now give backronyms for "USR" and justify the /usr though the rigid "partitions" model is flawed (and was even abandoned in Plan 9).
@borko @hisham_hm I keep trying to politely hint that Unix people should look at Microsoft PowerShell to see a piping environment and system shell done *right*, but nobody seems to understand or care.
Hint: It involves being able to pipe *objects*.
Second hint: It involves objects whose fields can be added and removed at runtime.
Third hint: No, neither Perl nor Python come *anywhere close* to touching what you can do with such a facility.
@natecull @hisham_hm @borko PowerShell's problem is integration with non-MS stuff. Cmdlets have to be .NET so there isn't a vibrant ecosystem of cmdlets. Which leaves you often parsing strings in PowerShell anyway, only PS/Windows doesn't have all the string tools you get with coreutils so the experience isn't very nice.
I think the idea is great and IMO PS is very pleasant to use if you just stick to MS tools, but it's never going to integrate nicely with the rest of the world
@cbowdon @borko @hisham_hm Yeah. What I wish for is something *like* Powershell, or rather something like its PSObject/PSCustomObject, that can roam around my Linux desktop objectscape.
Ie can instantiate Java, Mono, CORBA, XPCOM, GObject, UNC, KParts, and let them talk to each other.
@natecull @hisham_hm @borko Yeah that would be great. People always say "if only the tools all output JSON" but I'm not sure it's as simple as that.
I think to get off the ground there needs to be some clever parsing of popular tools' output into objects so it's not a big mission to rewrite all the things.
@cbowdon @borko @hisham_hm I gripe about JSON but JSON plus a class field plus a universal object-activation server *might* capture a useful sweet spot.
@natecull @hisham_hm @cbowdon there is a lot of room for improvement here : we can have a shell which works with "stingly-typed" objects, one where each program publishes the schemas that it outputs. Heck, even a shell that works with tables (Arrays of JSON objects) would be 10 times more useful than just strings.
@cbowdon @hisham_hm @natecull The nicest thing about all this is having some general purpose conversion tools, which basically map over the output and change its format into a format which is accepted from another tool.
@borko @cbowdon @hisham_hm Yeah, I reckon just JSONising some Unix userland tools might be a big win.
Is there a good fast JSON parser that could work in a shell pipeline?
@hisham_hm @cbowdon @borko or a Guile or Scheme shell would allow similar lightweight markup, eg preparsing output into named fields - I think there was a scsh, but maybe Guile's star is ascending again.
@natecull @cbowdon @hisham_hm I think one can easily can hack this together in node:
1) multi-platform.
2) json and unix - friendly.
@borko @hisham_hm @cbowdon Yeah, a 'node shell' might be the logical place to start playing.
While Javascript isn't wonderful, I guess it's not *terrible*, other than the syntax; it's somewhat Lispy, it's object-y... and more importantly, it's *there*.
@hisham_hm @natecull @borko Python2 would be preferable, since it is ubiquitous on *nix systems (can usually write it to be forward compatible with py3k). But ultimately would prefer a Lisp with s-exps as the interface format.
Emacs' Eshell is already somewhat close to this, but it has just re-implemented a few coreutils in Elisp rather than having a translation service.
@cbowdon @borko @hisham_hm Guile might be a thing, then, on Linux. I hope it becomes a thing again!
@borko @hisham_hm @natecull For programs that don't publish the schema they output, it would be best to have an easy system for users to write their own schemas (a la TypeScript and definition files).
@borko @natecull the bizarre thing, however, is that whenever I see cross-platform build instructions or tutorials, the Linux and Mac sections always go through shell commands and I *never* see PowerShell instructions. At most I see people giving a PS.EXE incantation to be called from CMD using PowerShell essentially as wget.