7 ms·
> Pipelines in Elvish can carry structured data, not just text. You can stream lists, maps and even functions through the pipeline. Sounds like Powershell.
by symlinkk 9y ago
> Pipelines in Elvish can carry structured data, not just text. You can stream lists, maps and even functions through the pipeline.
Sounds like Powershell.
- throwanem 9y agoLooks a bit like it, too, if only in that regard. No criticism, though. Powershell is brilliant, and I'm glad to see the Unix world starting to take cues from it.
- mwj 9y ago"Powershell is brilliant" Wot? Ugly syntax, cryptic error messages and random idiosyncrasies like misplaced semicolons turning variables into lists... The language is a nightmare.
- ianai 9y agoBuuuut there's definite room for improvement in unix pipes.
- flukus 9y agoI see the point and to a certain extent agree in theory. But every improvement feels like it's improved on something that just didn't need to be improved, some things become easier, but others become worse. Along the way the simplicity of text streams becomes lost. I can see a case where passing around structured data could make sense, but Powershell definitely takes things to far by passing around full .net classes that have functionality.
- Gaelan 9y ago“Simplicity of text streams” This is a common complaint about PS/elvish/etc, but I’m not sure it makes sense. Is that “simple text stream” tab delimited data? CSV? JSON? XML? At the end of the day, what you have isn’t just a “simple” text stream; you have a more complex data structure serialized into text, which will need to be parsed by each command in the pipeline for any non-trivial processing.
- flukus 9y agoQuite often, yes it's just text. 90% of the time you're only a string split away from having the structure you need. Most of the more complicated systems are chasing that 10% but complicating the 90%.
- yjftsjthsd-h 9y ago> Is that “simple text stream” tab delimited data? CSV? JSON? XML? Sure. Or all 4 at different points, because we didn't tie ourselves to one format. That's kinda the point.
- coldtea 9y ago>Ugly syntax, cryptic error messages and random idiosyncrasies Yeah, nothing like the elegance, straightforward messages, and "no surprises" of POSIX shells...
- Kurtz79 9y agoIt might be me succumbing to stereotypes, but POSIX shell syntax feels something that grew organically, out of use and necessity, with basic guiding principles but no set guidelines or rules. Powershell feels like something designed by committee, it has an internal consistency and logic, but feels bloated and overcomplicated.
- x0 9y ago>POSIX shell syntax feels something that grew organically, out of use and necessity Isn't that what everyone hates about PHP?
- bluesign 9y agoConsistency and logic comes with a price. But i guess both approches have cons and pros.
- coldtea 9y agoThe best way I think is: start with either, and prune what has been shown not to work in a version n+1 every few years iteratively. Provide a good migration path (e.g. for a language that could be a n to n+1 transpiler), and you're set.
- sljd 9y agoThe Elvish example is a lot neater in Powershell: `(irm https://api.github.com/repos/elves/elvish/issues)|select https://api.github.com/repos/elves/elvish/issues)|select number, title -first 11` Can you elaborate on the semicolons? Lists are declared by a comma, not semicolon: `$a = 1,2`, or `$a = @(1)` to enforce it
- Gaelan 9y agoPowerShell runs on Unix now.
- mathw 9y agoI think Powershell is pretty much conceptually brilliant, but the syntax and choice of names for various common cmdlets are... umm... not.
- alexsays 9y agoIf you're on Unix you may be interested in an object shell a guy I used to work with has been developing. It gives more objecty-ness imo: http://mash-shell.org/ http://mash-shell.org/
- sljd 9y agoPowershell 6 is open and runs on Unix.
- zokier 9y agoOne thing I'd want to see is support for standalone polyglot utilities, i.e. that you can write utilities in any language and they compose seamlessly into the system because they are all launched as independent processes. That is one thing I would like to retain from classic unix-style shells. The problem of designing the shell becomes both much harder and simpler at the same time. Harder because you need to figure a way to really pass objects from one process to another, which implies some sort of serialization protocol. On the other hand the shell becomes simpler again, because the processes will (most likely) do most of the heavy lifting of managing objects etc.
- xiaq 9y agoIt is fair to say that Elvish is inspired by PowerShell. It is much more lightweight and much closer to traditional Unix shells, though.