Powershell as Lisp

by Jack Hughes on August 12, 2008

One of the interesting things about Lisp is the ability to use macros to effectively create your own language. Instead of using Lisp to solve your problem, write a language in which your problem can be solved and then solve it using your own mini-language.

When I heard of the new features in Powershell v2, the one that stood out for me was the ease with which you can create cmdlets using the Powershell scripting language rather than being forced to use C# or VB.NET.

One side effect of easing the ability to create cmdlets is that building your own mini-language will become very easy because you’ll have the whole .NET library at your disposal and you’ll also be able to utilise all other cmdlets and providers as well.

Popularity: 18% [?]

Share and Enjoy:
  • del.icio.us
  • Twitter

Related posts:

  1. Resources for learning Windows Powershell
  2. PowerTime PowerShell walk through
  3. PowerShell Community Extensions well worth a look
  4. Heads up: Windows PowerShell

{ 4 comments… read them below or add one }

Jeffrey Snover February 10, 2009 at 4:38 AM

You got it. If you look at what we put into V2, there are a TON of features that help with meta-programming. The ability to write cmdlets in PowerShell is the foundation of it all. Check out SPLATTING and ProxyCmdlets. You’ll be shocked at the power.

Experiment! Enjoy! Engage!

Jeffrey Snover [MSFT]
Windows Management Partner 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

Jack Hughes February 10, 2009 at 9:37 AM

@Jeffrey – I am currently finishing off a time series database for PowerShell V1 so you may be confident that I’ll be looking into V2 real soon!

Dave Creelman February 11, 2009 at 12:16 AM

I must confess that I don’t know what a cmdlet is, but how does the addition of a feature such as this warrant calling powershell a lisp ?

Does it use the paradigm of code is data is code ?
Does it have macros that use this paradigm?

This seems to happen a lot with the latest hot language on the scene. Quite often one comes across articles with titles like “Ruby is an acceptable Lisp” or “Javascript is the new lisp”. These articles seem to miss the point that Lisp is a bit different. Lisp doesn’t really have a syntax. It looks like powershell has a syntax, so I’d say it’s not lisp.

If it doesn’t then I think a more apt title might be “Powershell Useful” or even “Powershel Domain specific languages”, but not “Powershell as Lisp”.

Just my 2c worth.

Hope you do get lots out of PowerShell v2.0 and you can develop some useful DSLs, but I don’t know if it’s the same “as lisp”.

Kaveh Shahbazian February 11, 2009 at 3:25 PM

I do not quite understand when somebody says ‘Lisp has no syntax’. For sure you have to be fluent at ‘watching s-expressions’ all day and that will do a big part for you (I have heard there are some masters that actually have touched the ‘brightness’ and do not see the parentheses anymore ;) , I do not know lisp fluently; I have just played around some of them long time ago (and a bit of Clojure recently).

What about all that operators (!) that influence scope of an expression, for example in a macro (like , or ‘ which I do not remember their exact meanings (Oops! There are some syntax to forget here!))? I am not speaking of Clojure since it has a bit more syntax than other Lisps (At least to me).

‘Lisp has no syntax’ is not a very precise sentence to me. At best I can say ‘Lisp has the most assumptions about developer’ – if there is no syntax!

Leave a Comment

Previous post:

Next post: