Please correct me if I'm wrong, but doesn't nushell suffer from the same problem as powershell that all the nice fancy stuff works only for in-process commands and external programs are bit of a second-class citizens?
To me interesting question is that is it even possible to build rich strucure-aware shell-like cli environment that would allow seamless integration of external polyglot programs in the same vein as unix shells where only minimal amount of stuff is required to be builtins (/bin/[ is cute example).
It is a difficult problem, at minimum probably requires all compatible software to be explicitly made so. But for best experience even the basic unix fundamental of stdin/stdout/stderr+argv/env might need re-evaluation.
I don't know how to do a similar thing in powershell.
> To me interesting question is that is it even possible to build rich strucure-aware shell-like cli environment that would allow seamless integration of external polyglot programs...
Problem is that most of the classic Unix programs output in some messy format. It would be nice if we could agree that each command has --json flag (for example) which will make the output trivial to parse programmatically in any other advanced shell.
> It would be nice if we could agree that each command has --json flag (for example) which will make the output trivial to parse programmatically in any other advanced shell.
That's part of the solution, but I think a signaling layer of sorts is needed too so that the reading side knows that the data is structured instead of just bytes. So basically instead of needing explicit
> foo --json | from json | ...
You could have
> foo --json | ...
From there it would then be easy to have env var or something instead of explicit cmdline flag to eventually end up with (almost) seamless
> nushell seems to have better way of parsing the string-only outputs of other commands.
Yup. In addition to that `parse` command, Nu also has a suite of `from` commands that trivially convert other data formats to Nu tables. CSV, JSON, TOML, XML, YAML, and many more.
So if you're working with a program that can emit, say, JSON, you just do `some_external_command | from json` and boom, you've got a Nu table.
Parsing JSON in powershell is not that bad either, `ConvertFrom-Json` pretty much does what you need. AFAIK there is nothing as convenient as nu's `parse`
To me interesting question is that is it even possible to build rich strucure-aware shell-like cli environment that would allow seamless integration of external polyglot programs in the same vein as unix shells where only minimal amount of stuff is required to be builtins (/bin/[ is cute example).
It is a difficult problem, at minimum probably requires all compatible software to be explicitly made so. But for best experience even the basic unix fundamental of stdin/stdout/stderr+argv/env might need re-evaluation.