views:

97

answers:

2
  • I need to be able to expose "commands" that make calls to the host.
  • I need to have simple easy to read syntax.
  • It needs to be easy to pick up by non-programmers.

An example would be as follows:

Host Application:

ScriptHost.AddCommandBinding("MyCommand", delegateToMyHandler, parameterDefinitionsStruct);

Script

 returnval = MyCommand(param1, param2);

anybody know of anything like this?

+2  A: 

IronPython would be perfect for this.

The book description for IronPython in Action says "You'll learn how IronPython can be embedded as a ready-made scripting language into C# and VB.NET programs".

RichieHindle
having looked at the documentation I can't see how to add functions to iron python that map to .net object methods.
Firoso
@firoso: Sorry, I don't know the details, I only know it's possible to do, and that Python would be a good language choice for your requirements.
RichieHindle
A: 

I'd consider using PowerShell, if any of your non-programmers are system administrators. It's being used as the built-in scripting language for Exchange Server and SQL Server, and ships with Windows 7 and Windows Server 2008 R2.

John Saunders
yeah, try electronic test technicians.
Firoso
Sounds like a good match for PowerShell.
John Saunders
sounds like a bad match for me.
Firoso
Do you mind saying why you feel it's a bad match?
John Saunders
Certainly, the syntax is more messy than I'd like, and honestly powershell is designed more for IT professionals, not hardware engineers.
Firoso
ok, thanks. I would have thought an object pipeline would be just what they'd like: get-service | where {$_.DisplayName -like 'sql*' -and $_.Status -eq 'Running'} | stop-service -force -verbose
John Saunders