Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending C# .NET application - build a custom scripting language or not?

I need to build a scripting interface for my C# program that does system level testing of embedded firmware.

My application contains libraries to fully interact with the devices. There are separate libraries for initiating actions, getting output and tracking success/failure. My application also has a GUI for managing multiple devices and assigning many scripts to be run.

For the testers (non-programmers, but technical), I need to provide a scripting interface that will allow them to come up with different scenarios for testing and run them. They are just going to call my APIs and then return a result to my program (pass/fail and message).

A very basic example of what I want:

TURN_POWER_ON
TUNE_FREQUENCY frequency
WAIT 5
IF GET_FREQUENCY == frequency
  REPORT_PASS "Successfully tuned to " + frequency
ELSE
  REPORT_FAIL "Failed to tune to " + frequency
ENDIF
TURN_POWER_OFF

Where the reporting, power and frequency functions are provided by my C# libraries.

Will something like IronRuby or IronPython be good for this, or should I just build my own very basic language?

Does the Ruby/Python code get messy when trying to include a bunch of .NET compiled assemblies? I want it to be easy to learn and code for non-programmers and programmers alike.

EDIT:

Thanks for all the great responses. I chose IronPython as the answer since it had the most support, but I'll spend a bit of time with each of IronPython, Boo and IronRuby to see what the testers would prefer to write scripts in.

like image 587
cgyDeveloper Avatar asked Aug 24 '09 21:08

cgyDeveloper


People also ask

Can you extend the C drive?

To expand system partition (C: driver) size Before expanding C drive size, need to confirm there is unallocated space next to C drive. Right click on C drive then select “Extend volume”, then follow the onscreen instruction to finish the process.

How can I increase C drive space without losing data?

Begin -> Right click Computer -> Manage. Locate Disk Management under Store on the left, and click to select Disk Management. Right click the partition you want to cut, and choose Shrink Volume. Tune a size on the right of Enter the amount of space to shrink.


1 Answers

I've heard very good things about IronPython for exactly this type of scenario. I'd certainly risk spending a few hours on a quick proof-of-concept, to see how it pans out.

Michael Foord will happily wax lyrical about the success of IronPython in similar cases (most specifically for him, for spreadsheet savvy users), and his book covers (IIRC) a few pointers about hosting it from .NET.

like image 177
Marc Gravell Avatar answered Oct 21 '22 16:10

Marc Gravell