I already have a working implementation that adds scripting to an application. The application currently generates and compiles scripts from C# snippets (taken from different user provides configuration files) into assemblies using the CodeDOM. As it sounded like a good idea at first I ran into following issues:
- difficult AppDomain handling and need for Serialization
- performance issue => frequent script changes trigger a recompilation
- changes cannot be made in-place in the scripts while running
- difficult to provide a GUI for debugging (breakpoints), the script writer actually needs a debugger...
I "hacked" a solution against 1 by loading everything in the main AppDomain. The problem is that nothing can be unloaded... After some time the memory use is huge.
For this reason I eventually would consider to switch to an interpreted solution but want to remain near to a C# language because of the existing code-base. There is a bunch of libs around Vsa, S#, Script.NET, ... I need to access objects in my application from the scripts and also run methods in the scripts from my application. Do you also think that switching to an interpreted language the right strategy or should I try to add a debug mode to the existing concept by injecting code like calling a method between each line of the script to allow a step by step execution.... However the AppDomain handling remains a nightmare to handle.
It is certainly not the first time someone runs in such a situation. I could not find any FOSS wrapper/helper library to make the CodeDOM handling easier nor GUI elements to provide building blocks for a minimal debugger. Currently I built ma own GUI and step over calls in the scripts and show changes in the application objects (before/after calls) inside the GUI.
Please only refer to FOSS source/libs.