Welcome to MSDN Blogs Sign in | Join | Help

DLR Hosting API : latest version of the spec is available online (includes changes to runtime initialization)

The latest version of the Hosting API spec is available here. The most recent source code drop to the IronPython codeplex site conforms to this spec (except for some open bugs).

The biggest change this spec introduces to the beta4 binaries is the way the hosting runtime is initialized.

Prior to this update, the hosting runtime is initialized by creating a new ScriptRuntime object. Now, a typical runtime initialization involves 2 things.

A quick 5 min how-to on the new initialization is as follows

1)      Setting up entries in the application’s config file. Here is a sample config file

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

  <configSections>

    <section name="microsoft.scripting" 

             type="Microsoft.Scripting.Hosting.Configuration.Section, Microsoft.Scripting, Version=1.0.0.5000, Culture=neutral, publicKeyToken=31bf3856ad364e35"     

             requirePermission="false" />

  </configSections>

 

  <microsoft.scripting>

    <languages>

      <language names="IronPython,Python,py"

                extensions=".py"

                displayName="IronPython 2.0 Beta"

                type="IronPython.Runtime.PythonContext,IronPython, Version=2.0.0.5000, Culture=neutral, publicKeyToken=31bf3856ad364e35" />

      <language names="IronRuby;Ruby,rb"

                extensions=".rb"

                displayName="IronRuby 1.0 Alpha"

                type="IronRuby.Runtime.RubyContext, IronRuby, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

    </languages>

  </microsoft.scripting>

</configuration>

 

2)      Calling the following methods

ScriptRuntimeSetup srs = ScriptRuntimeSetup.ReadConfiguration();

ScriptRuntime runtime = new ScriptRuntime(srs);

Published Sunday, September 07, 2008 2:32 PM by seshadripv

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# DLR Hosting API : latest version of the spec is available online (includes changes to runtime initialization) : EasyCoded

# re: DLR Hosting API : latest version of the spec is available online (includes changes to runtime initialization)

Hi,

A question: according to the spec, the names in these two lines should have been "semicolon-separated", right?

<language names="IronPython,Python,py"

<language names="IronRuby;Ruby,rb"

Greetings,

- RednaxelaFX

Monday, September 08, 2008 4:14 AM by RednaxelaFX

# re: DLR Hosting API : latest version of the spec is available online (includes changes to runtime initialization)

re : RednaxelaFX

Ah yes, I think you've caught a spec bug. The spec says its semi colon separated. But the code that parses these ids accepts a comma as well.

I will follow up with our PM and make the necessary changes to the spec.

thanks for the comment...

Monday, September 08, 2008 12:30 PM by seshadripv

# DLR Hosting Sample : Simple dlr host using the new App.Config based ScriptRuntime creation

Due to the recent changes to the DLR Hosting API , dlr hosts now have to use the App.Config file to configure

Thursday, September 11, 2008 2:42 PM by DLR Hosting and related stuff...

# Hosting IronPython made easier

With 2.0 Beta 5 coming out very soon, there is a new hosting helper class in there called IronPython.Hosting.Python

Tuesday, September 16, 2008 6:30 PM by Srivatsn's Blog

# DLR in Silverlight

DLR(Dynamic Language Runtime)是Silverlight中提供的一套非常强大的动态语言运行时。目前2.0 beta2中支持Python,Ruby和JSX。 利用DLR,你可以很方便的使用熟悉的动态语言编写Silverlight程序。

Thursday, September 18, 2008 12:30 AM by CLR & Silverlight上海研发团队的Blog

# Hosting IronPython made easier

With 2.0 Beta 5 coming out very soon, there is a new hosting helper class in there called IronPython.Hosting.Python

Tuesday, September 23, 2008 3:46 PM by Srivatsn's Blog

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker