4 ms·
The criticism of Unix shell coming from the authors of PowerShell and those who like it says something to the effect: We want modern (and by that they mean C#-
by crabbone 2y ago
The criticism of Unix shell coming from the authors of PowerShell and those who like it says something to the effect:
We want modern (and by that they mean C#-like) programming language in shell. We want user types, type checking, structured, modular code.
And they forget that the reason Unix shell is easy in some respects is precisely because it has none of that. Since everything is text, serialization is trivial. But serialization is vital if you need to work remotely between different shells.
Structure will require a lot more operations for composing and decomposing it in order to transmit messages. Equality and identity become a problem.
Custom types are similar to structure, but on top of it present a problem with serialization (somehow both shells need to have same type definitions, and what happens if they inevitably don't).
The problems above not being addressed... what you get is another "scripting" language, of which there are already dozens, with no special benefits when it comes to it being used as shell, but with some problems. Just not worth it and illustrates lack of research and understanding of the problem space on the part of the authors.
- UltraSane 2y ago" Since everything is text, serialization is trivial. But serialization is vital if you need to work remotely between different shells." Serialization is trivial in PowerShell but also much more powerful because you can pipe the output of any command to ConvertTo-JSON or ConvertTo-CliXML which gives you very nice STRUCTURED serialization that is much easier to consume.
- crabbone 2y ago> Serialization is trivial in PowerShell There isn't really. For a lot of PowerShell objects, there's no way of converting them to JSON or XML. Imagine what happens if you convert a closure to JSON? It doesn't matter what language you use, it's always going to be a problem. You are simply too inexperienced with the subject to be able to have a judgement on how (well) it works. Trust me, it's anything but "trivial".