Ruby, Python, Perl, Tcl, JavaScript, Lisp, Smalltalk, PowerShell … which one do you pick? Jim Hugunin likes to describe why a programmer prefers one language over another one as a genetic trait – some are predisposed to liking Python syntax, and others aren’t.
One of the most interesting technologies to come out of Microsoft recently is PowerShell. The disruptive idea behind PowerShell is that cmdlets pipe objects around instead of text. Most of the PowerShell plumbing comes in the form of a set of static classes that ship in System.Management.Automation.dll, and they’re tied together with the PowerShell scripting language.
I’m pretty sure that I’m missing the gene that would make me like the PowerShell scripting language. It feels just too … foreign to me. This isn’t to take anything away from PowerShell itself – it’s fabulous. It’s just that I want to use Ruby (and Jim wants to use Python). One of the coolest demos at Lang .Net was Jim running PowerShell commands from an IronPython console. Here’s some PowerShell code expressed as a Python list comprehension:
[p.name for p in shell.get_process() if p.name.startswith("a")]
Here’s an example that shows piping cmdlets together using Python’s dot operator:
shell.get_service(name="a*").sort("status").convertto_html().out_file("t.html")
I could imagine the piping example expressed through Ruby as:
get_service(name="a*") | sort("status") | convertto_html() | out_file("t.html")
You can overload the | operator in both Ruby and Python, but Jim prefers to use the dot operator since it feels more natural to him.
A fashion-proof shell – let developers use the language of their choice. Kind of sounds like the CLR, right?

3 archived reader comments
Jeffrey Snover (2006-08-29)
I couldn’t agree more. 10,000 cheers for the CLR! It allows us to disagree and still help each other. How cool is that!
Jeffrey Snover [MSFT] Windows PowerShell/Aspen Architect Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
John Lam (2006-08-29)
Thanks for dropping, by Jeffrey!
Now, can we *please* get delegate support added to ScriptBlocks so that we can get those nice callbacks into Ruby/Python … pretty please? :)
Jeffrey Snover (2006-08-30)
Your wish is our command. I just wish that you had asked for this in time for V1. Unfortunately we’ll have to add this in a subsequent release.
Jeffrey Snover [MSFT] Windows PowerShell/Aspen Architect Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx