Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you cache compiled code to execute against different Session/hostObject?

Tags:

c#

roslyn

We currently use IronPython as a scripting language to allow our business users to configure large portions of our application and we are evaluating the possibility of adding in C# as a scripting language once Roslyn is released. For IronPython, we use Microsoft.Scripting.Hosting.CompiledCode to cache the compiled code and execute it against different ScriptScope object.

Looking around the latest Rosyln CTP I don't see an obvious way to compile code and then execute it against different Sessions or hostObjects. Is this functionality available at this time, and if not, is it going to be available at release?

like image 331
Ed T Avatar asked Mar 14 '26 12:03

Ed T


1 Answers

We currently are looking at supporting the same scenario with the Roslyn Scripting APIs, that is, to compile the code so that you can execute it independently against different scopes. It will likely be a bit different than the DLR Hosting APIs, and by the time we ship, plans could completely change. I should post my updated scripting spec. I haven't done so already since we did not do much work on the Interactive/scripting area for CTP2, focusing ore on the compiler APIs. We have sketched out the direction we're thinking in regards to your question. I'll try to do that today, so on the Roslyn forum, see the pinned post at the top of the forum, which I'll update with a link to the updated spec.

Thanks, Bill

like image 162
Bill Avatar answered Mar 17 '26 02:03

Bill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!