PowerShell: Bringing it all Together?
Is Microsoft’s PowerShell the a missing link between the command line and GUIs? In many ways, yes.
What I find most striking about demonstrations such as these (check out the invoke-sql cmdlet and dir Command videos) is not so much the idea of a more powerful shell as it is the integration of GUI elements with scripting. I can not comment too much on PowerShell itself — I have installed it on a few computers, it’s rather slow to start up, but it makes the noble gesture of accepting UNIX-style commands — but, watching those videos, I couldn’t help but feel a twang of jealousy.
So often while working in languages like Ruby, one runs into walls when the goal of graphical interface comes up. Sure, it can be done, but the incantations needed to bring up and populate windows always strike me as ill-favored when viewed in comparison with the concepts more readily expressed in such languages. However the chart output piping demonstrated in those PowerGadgets videos is just the sort of thing I’d love to be able to do from any language. No bothering with windows, title bars, etc. Instead, it’s just a matter of passing in some structured data and getting reasonable output. And hey, we already can do this pretty well on the web!
A huge barrier is, of course, platform differentiation. Miguel de Icaza recently defended some of Microsoft’s past actions as being necessary concessions to the goal of platform integration. He made the point that while Java may be cross-platform, any application that uses Cocoa bindings runs the risk of being tied to Apple’s platform. Yet, this is a sensible action for a couple reasons: you don’t want to reinvent the GUi wheel on every platform, and you do want to provide users with a consistent, intuitive experience. These goals lead towards platform integration, and there’s nothing wrong with that.
But where does this leave your favorite language of the month? Languages with small communities can’t really afford to be single-platform as that would further diminish their potential audience. Instead, they, for the most part, aim to be as cross-platform as possible at the expense of extensive support for the features unique to any particular platform. Which leads me back to PowerShell. PowerShell seems to be doing a few things such as component inter-operation via typed object interchange, and easy integration with existing class libraries (including GUI components), that are quite forward looking. So I wonder, are the platform-makers the only ones capable of elegantly bridging the gap between scripting and graphical interfaces? Both Apple and Microsoft have demonstrated some ability to provide such capabilities, and I look to Adobe introducing Apollo to see if the platform continues to be the key.
PS: Of course, the web is the platform many of us worry about today. I recently built what would have been a standard GUI application using Ruby and OpenLaszlo as an exercise. The outcome of that exercise was predictable: OpenLaszlo is a great library for building web applications, but it sure would have been a lot faster for me to use VS2005 to put together a Windows Form.