Hacker News new | ask | show | jobs
by kmiroslav 3666 days ago
Personally, one of the reasons why I fell in love with Ruby 10+ years ago was because I realized I could use it instead of CMD or bash to write all my scripts from now on. Regardless of the platform. Obviously, this applies to Python as well if that's more your thing.

I've never gotten into PowerShell but I have absolute respect for the concept behind it, and how much more advanced it is than any shell you can find on UNIX. Think about it: instead of piping several commands through an unspecified string protocol that varies between each command (essentially what UNIX does), you are now piping real language objects in a uniform binary protocol defined by the shell itself.

2 comments

> you are now piping real language objects

Which is in fact a bad idea, because in order for stdin to accept objects and stdout to output objects, now those commands have to be powered by PowerShell and .NET. In other words you're in a very finite and closed environment that does not interoperate with the outside world.

You know, love or hate Unix, but the fact remains that this family of operating systems, including its command line, has survived the test of time. And it has done so because it has at its core a set of philosophical principles. And one of those is that programs that handle text streams are preferred, being highly interoperable, as text is a universal interface [1]. And you know it's funny how people loathe Unix, but at the same time rediscover its principles (and often implement them badly) again and again.

[1] http://www.faqs.org/docs/artu/ch01s06.html

It interoperates just fine. That's what's great about powershell, when you're working with objects on the pipeline you have a ton of power at your command, and you can write very expressive code that is compact. But at the same time, outside of that context it's just plain text. It's win/win.
Those who don't understand Unix are doomed to repeat it.
Those who haven't read the Monad (Powershell) Manifesto[1] are doomed to keep repeating Unix's failures.

[1] http://www.jsnover.com/blog/2011/10/01/monad-manifesto/

If we wanted an OO shell we'd be using one. It's not like Unix has a shortage of interpreted languages. The simple fact is that these languages are too high-level to be even remotely useful as a system shell.