Wednesday, June 25, 2008

Pash Improvements

This is my first attempt at writing on a blog, so I don't know if I should have a kind of five paragraph introduction/conclusion thing going on or I should use some kind of special prose or whatever. I think I'll hit the ground running..

Pash Improvements

As some of you already know, I am part of the 2008 Google Summer of Code working on a very interesting project called Pash, the fine work of Igor Moochnick, a person I met - personally. Instead of me explaining what Pash is, you can read about it here and here.

I've been writing a number of improvements to Pash. I separate my work into two projects, one that I have been working on since the beginning of the Summer of Code, and one I just started recently (it's a bit of an "experimental" project).

CoreCmdlets

CoreCmdlets is an implementation of all the basic, core cmdlets typically included with an installation of Microsoft PowerShell. For the Unix people around here, you can think of CoreCmdlets as the "GNU Coreutils" of the overall shell project. These are tested against Microsoft PowerShell excessively. We wish to ensure the cmdlets maintain a near perfect compatibility with the originals. I have implemented quite a few cmdlets now, and the project coming along nicely. Here is a sample of some of the cmdlets you can expect to be fairly complete:

Management Cmdlets
Get-Process
Stop-Process
Get-Service
Stop-Service
Restart-Service
Suspend-Service
Resume-Service

Utility Cmdlets
Get-Date
New-Object
Start-Sleep
Write-Host
Get-Random

Provider Cmdlets
Copy-Item
Move-Item
Rename-Item
Remove-Item
Get-ChildItem (based off of existing cmdlet)
New-Item
Get-Location (based off of existing cmdlet)

Other (Non-Standard) Cmdlets
Say-Cow
Get-Device

Large, but incomplete & in-progress cmdlets worth noting
Format-Table
Format-List

I feel as of most of the cmdlets I've written of are high quality, but some still need some work, and many are still missing. Most of the missing ones I can't do so much with, because many depend on the state of the runtime and other esoteric things inside of PowerShell, stuff which ISN'T public API, so I can't really write a cmdlet that I can test against Microsoft PowerShell. So it's a problem.

Pash Shell

You can't really have Pash without the shell. So this project is the one to write the actual engine which takes in a script file or command line input and does something meaningful with it. Pash SVN at Sourceforge already has a command line shell, but it at it's early stages. I am trying to improve this shell and add advanced features to it. This is a relatively new project. I've been planning it for a month or so, but I only began work on it two days ago. And I have quite a lot to show already. Here is the (blurry, taken from VNC) screenshot:



Okay, so it's not perfect PowerShell grammar. But come on, control statements and function calls! That must have been a lot of work. I must be lying and I really spent like three years or something on this. Or I am some kind of compiler genius, right? No!!!

This is DLR!!!!!!!!!

What you say? DLR? What the hell is that? Well you know, I am not even so sure. I can't give you a one sentence answer and perfectly describe what it does or how it helps. This is typically true for any innovative product, and DLR is quite an innovative product. So the best I can describe it is it is some kind of CLR but for dynamic languages, that also removes the ton of scaffolding you typically have to do when you implement a programming language. (Yes, Pash is a technically a programming language.) And you can get all these additional benefits like improved performance and a shared type system with other languages!

Yes, you may very well soon have a Python script manipulate a Pash object along a pipeline! Or have a Ruby script call functions in a Pash script with great ease! I hope the PowerShell team doesn't get mad if Pash becomes a cooler shell then PowerShell itself! =) I hope you can tell I am excited about this potential. PowerShell predates the DLR, so it's a given it doesn't use it, but PowerShell and the DLR can make a good team, and Pash will hopefully have super DLR powers.

That's all I have to say for now. But do not fear my tens and tens of visitors, I shall post again!

Sunday, June 22, 2008

First post!

In the Slashdot tradition, this is the FIRST POST. If you expected any interesting or insightful information, you shouldn't be reading the first post. :)