0
  • 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?

Firoso
  • 6,647
  • 10
  • 45
  • 91
  • I think you're dreaming if you think you're going to find "easy to pick up by non-programmers". "Easy to abuse", maybe, but once you get far beyond sequential execution, scripts are programs, and are written by programmers. Written well, or written badly. – John Saunders Jun 24 '09 at 00:09
  • yeah sequential execution and limited api sounds about right :-P – Firoso Jun 24 '09 at 02:44
  • @John: The business world is full of people who are happy to script Excel but wouldn't call themselves programmers. – RichieHindle Jun 24 '09 at 08:13

2 Answers2

2

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
  • 272,464
  • 47
  • 358
  • 399
  • having looked at the documentation I can't see how to add functions to iron python that map to .net object methods. – Firoso Jun 23 '09 at 22:36
  • @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 Jun 24 '09 at 08:14
0

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
  • 160,644
  • 26
  • 247
  • 397
  • yeah, try electronic test technicians. – Firoso Jun 24 '09 at 00:29
  • sounds like a bad match for me. – Firoso Jun 24 '09 at 02:43
  • Certainly, the syntax is more messy than I'd like, and honestly powershell is designed more for IT professionals, not hardware engineers. – Firoso Jun 24 '09 at 15:35
  • 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 Jun 24 '09 at 15:53