<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>sdlsdk Wiki &amp; Documentation Rss Feed</title><link>http://www.codeplex.com/sdlsdk/Wiki/View.aspx?title=Home</link><description>sdlsdk Wiki Rss Description</description><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/wikipage?version=31</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;These site is obsolete and just here for archival purposes. Go to IronRuby and IronPython&amp;#39;s CodePlex sites for all Silverlight-related content.&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight &amp;quot;out of the box&amp;quot;; this project was merged directly into the languages releases.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/browser/" class="externalLink"&gt;IronRuby in Silverlight&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.net/browser/" class="externalLink"&gt;IronPython in Silverlight&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby&amp;#39;s latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site&amp;#39;s discussions and issue tracker is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language&amp;#39;s mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 30 Apr 2010 05:17:39 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100430051739A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/wikipage?version=30</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;These site is obsolete and just here for archival purposes. Go to IronRuby and IronPython&amp;#39;s CodePlex sites for all Silverlight-related content.&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight &amp;quot;out of the box&amp;quot;; this project was merged directly into the languages releases.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/download/" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.net/download/" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby&amp;#39;s latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site&amp;#39;s discussions and issue tracker is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language&amp;#39;s mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 30 Apr 2010 05:17:04 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20100430051704A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/wikipage?version=29</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;These site is obsolete and just here for archival purposes. Go to IronRuby and IronPython's CodePlex sites for all Silverlight-related content.&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight &amp;quot;out of the box&amp;quot;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby's latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site's discussions and issue tracker is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language's mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Nov 2009 09:46:24 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20091110094624A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/wikipage?version=28</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;These site is obsolete and just here for archival purposes. Go to IronRuby and IronPython's CodePlex sites for all Silverlight-related content.&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight out of the box.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby's latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site's discussions and issue tracker is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language's mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Nov 2009 09:46:02 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20091110094602A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/wikipage?version=27</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;These site is obsolete and just here for archival puroses. Go to IronRuby and IronPython's CodePlex sites for all Silverlight-related content.&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight out of the box.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby's latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site's discussions and issue tracker is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language's mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Nov 2009 03:32:45 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20091110033245A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=26</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;IronPython and IronRuby in Silverlight are no longer hosted here!&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight out of the box.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note: IronRuby also contains IronPython binaries for using them together. Unless you need a specific version of IronPython, just download IronRuby's latest release to get both.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This site is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language's mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 17 Jul 2009 01:54:09 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090717015409A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=25</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;IronPython and IronRuby in Silverlight are no longer hosted here!&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight out of the box.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This site is no longer moderated. If you have any questions on using IronRuby and IronPython in Silverlight, please post them on the language's mailing list:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://rubyforge.org/mailman/listinfo/ironruby-core" class="externalLink"&gt;Join the IronRuby Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" class="externalLink"&gt;Join the IronPython Mailing List&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 17 Jul 2009 01:52:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090717015244A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=24</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;IronPython and IronRuby in Silverlight are no longer hosted here!&lt;/h1&gt;
Please visit the respective pages for IronRuby and IronPython releases, which work in Silverlight out of the box.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://ironruby.net/Download" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 17 Jul 2009 01:36:26 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090717013626A</guid></item><item><title>Updated Wiki: Hosting</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;version=10</link><description>&lt;div class="wikidoc"&gt;&lt;h1&gt;Hosting the DLR in Silverlight&lt;/h1&gt;
Hosting a dynamic language in Silverlight gives any Silverlight application (in any Silverlight language: C#/VB/Ruby/Python/JScript/others) the ability to run code in either Python, Ruby, JScript, or any other DLR-based language, from inside itself. For more information on the DLR and hosting, see &lt;a href="http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome" class="externalLink"&gt;http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Differences between desktop and Silverlight&lt;/h2&gt;
The code necessary to host the DLR inside of Silverlight is different than on the desktop. Also, the code different between static and dynamic languages. In both cases, they only differ in how you construct the ScriptRuntimeSetup object.
&lt;h3&gt;Discovering languages&lt;/h3&gt;
The first difference is how ScriptRuntimeSetup finds out the available languages. This information can either be loaded from a configuration file inside the XAP (language.config), or from the already-loaded assemblies themselves. The desktop does not allow loading from the assemblies, since it doesn't want to encourage loading all the language assemblies when they are not needed. However, Silverlight pre-loads all assemblies anyway, so both options are given in Silverlight.&lt;br /&gt;&lt;br /&gt;Microsoft.Scripting.Silverlight.Configuration has helper methods to load the configuration from either a language.config from the XAP file, or, to avoid having the config file, the language assemblies themselves. 
&lt;h3&gt;Platform Adaptation Layer&lt;/h3&gt;
The desktop and Silverlight differ in a big way when it comes to the File system; Silverlight does not have access to the machine's file system. Instead, it can only access files inside the XAP file, or in Isolated Storage. The DLR abstracts platform functionality into a PlatformAdaptationLayer (PAL), which can be changed by supplying a custom ScriptHost, which knows about a custom PAL. &lt;br /&gt;&lt;br /&gt;The DLR's default PAL doesn't define any behavior for Silverlight; it just throws &amp;quot;NotImplementedException&amp;quot; if any platform functionality is used. Microsoft.Scripting.Silverlight.BrowserScriptHost is a custom ScriptHost which knows about an internal BrowserPAL class, which directs any read-only file system access to the XAP.&lt;br /&gt;
&lt;h2&gt;Hosting the DLR from C# or VB&lt;/h2&gt;
The following tells the ScriptRuntimeSetup about the avaliable languages from the loaded assemblies, and sets the HostType to BrowserScriptHost, which will make read-only platform-specific features work. It also pre-references platform assemblies so AddReference/LoadAssembly doesn't need to be called from script code.
&lt;h3&gt;C#&lt;/h3&gt;
&lt;pre&gt;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Silverlight;

ScriptRuntimeSetup setup = Configuration.LoadFromAssemblies(Package.GetManifestAssemblies());
setup.HostType = typeof(BrowserScriptHost);
ScriptRuntime runtime = new ScriptRuntime(setup);
// load platform assemblies so you don't need to call LoadAssembly in script code.
foreach (string name in new string[] { &amp;quot;mscorlib&amp;quot;, &amp;quot;System&amp;quot;, &amp;quot;System.Windows&amp;quot;, &amp;quot;System.Windows.Browser&amp;quot;, &amp;quot;System.Net&amp;quot; })
{
    runtime.LoadAssembly(runtime.Host.PlatformAdaptationLayer.LoadAssembly(name));
}

// now the desktop and Silverlight are the same ...
ScriptEngine engine = runtime.GetEngine(&amp;quot;Python&amp;quot;)
ScriptSource source = engine.CreateScriptSourceFromString(&amp;quot;System.Windows.Browser.HtmlPage.Document.Message.innerHTML = 'Hello, World'&amp;quot;)
source.Compile().Execute();
&lt;/pre&gt;&lt;br /&gt;
&lt;h2&gt;Hosting the DLR from Python, Ruby, or JScript&lt;/h2&gt;
Since the DLR/Silverlight integration is a C# application and hosts the DLR itself, the above work is already done for a dynamic language. Therefore, dynamic languages only need access to the ScriptRuntime or ScriptRuntimeSetup objects.&lt;br /&gt;
&lt;h3&gt;Ruby&lt;/h3&gt;
&lt;pre&gt;
require 'Microsoft.Scripting'
include Microsoft.Scripting.Silverlight
include Microsoft.Scripting.Hosting
runtime = ScriptRuntime.new(DynamicApplication.current.runtime.setup)

# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.current.runtime
&lt;/pre&gt;&lt;br /&gt;
&lt;h3&gt;Python&lt;/h3&gt;
&lt;pre&gt;
import clr
clr.AddReference(&amp;quot;Microsoft.Scripting&amp;quot;)
from Microsoft.Scripting.Hosting import ScriptRuntime, ScriptRuntimeSetup
from Microsoft.Scripting.Silverlight import DynamicApplication
runtime = ScriptRuntime(DynamicApplication.Current.Runtime.Setup

# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.Current.Runtime
&lt;/pre&gt;&lt;/div&gt;</description><author>jimmysch</author><pubDate>Fri, 15 May 2009 18:06:22 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hosting 20090515060622P</guid></item><item><title>Updated Wiki: Extensions</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Extensions&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
&lt;i&gt;This is a Silverlight 3 feature only. For similar behavior in Silverlight 2, see Chiron.exe.confg&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;Silverlight 3 supports &lt;b&gt;caching of transparent platform extensions&lt;/b&gt;, which in English means extensions of Silverlight (Controls, DLR, etc) can be downloaded on-demand and cached by the browser the first time the Silverlight application is visited, rather than packaging everything inside the XAP. While Silverlight 2 supported loading assemblies from outside the XAP, some domains (Microsoft.com, for example) do not allow the transmission of DLLs, so a Silverlight &amp;quot;extension&amp;quot; (.slvx file) is the unit of transport. A SLVX file is simply a deflate-compressed archive (identical to the compression used on a XAP file), which contains one or more DLLs to load when the application is run. &lt;br /&gt; &lt;br /&gt;Silverlight extensions is only for platform assemblies, not user code. This is enforced by the extension's location; it can only be hosted on a Microsoft.com domain. However, it can be redirected to any domain from there (see below).&lt;br /&gt; &lt;br /&gt;AgDLR uses Silverlight extensions to deliver DLR+Language assemblies from Codeplex.com when a IronRuby or IronPython application is visited, rather than needing the assemblies in the XAP, or even deployed on your webserver.&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:58:30 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Extensions 20090325095830P</guid></item><item><title>Updated Wiki: Extensions</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Extensions&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;i&gt;This is a Silverlight 3 feature only. For similar behavior in Silverlight 2, see Chiron.exe.confg&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;Silverlight 3 supports &lt;b&gt;caching of transparent platform extensions&lt;/b&gt;, which in English means extensions of Silverlight (Controls, DLR, etc) can be downloaded on-demand and cached by the browser the first time the Silverlight application is visited, rather than packaging everything inside the XAP. While Silverlight 2 supported loading assemblies from outside the XAP, some domains (Microsoft.com, for example) do not allow the transmission of DLLs, so a Silverlight &amp;quot;extension&amp;quot; (.slvx file) is the unit of transport. A SLVX file is simply a deflate-compressed archive (identical to the compression used on a XAP file), which contains one or more DLLs to load when the application is run. &lt;br /&gt; &lt;br /&gt;Silverlight extensions is only for platform assemblies, not user code. This is enforced by the extension's location; it can only be hosted on a Microsoft.com domain. However, it can be redirected to any domain from there (see below).&lt;br /&gt; &lt;br /&gt;AgDLR uses Silverlight extensions to deliver DLR+Language assemblies from Codeplex.com when a IronRuby or IronPython application is visited, rather than needing the assemblies in the XAP, or even deployed on your webserver.&lt;br /&gt; &lt;br /&gt;&lt;a href="javascript:window.location.href='http://sdlsdk.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=63160';"&gt;IronRuby-0.5.0.slvx&lt;/a&gt;&lt;br /&gt;&lt;a href="javascript:window.location.href='http://sdlsdk.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=63159';"&gt;IronPython-0.5.0.slvx&lt;/a&gt;&lt;br /&gt;&lt;a href="javascript:window.location.href='http://sdlsdk.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=63161';"&gt;Microsoft.Scripting-0.5.0.slvx&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:52:32 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Extensions 20090325095232P</guid></item><item><title>Updated Wiki: Extensions</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Extensions&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;i&gt;This is a Silverlight 3 feature only. For similar behavior in Silverlight 2, see Chiron.exe.confg&lt;/i&gt;&lt;br /&gt; &lt;br /&gt;Silverlight 3 supports &lt;b&gt;caching of transparent platform extensions&lt;/b&gt;, which in English means extensions of Silverlight (Controls, DLR, etc) can be downloaded on-demand and cached by the browser the first time the Silverlight application is visited, rather than packaging everything inside the XAP. While Silverlight 2 supported loading assemblies from outside the XAP, some domains (Microsoft.com, for example) do not allow the transmission of DLLs, so a Silverlight &amp;quot;extension&amp;quot; (.slvx file) is the unit of transport. A SLVX file is simply a deflate-compressed archive (identical to the compression used on a XAP file), which contains one or more DLLs to load when the application is run. &lt;br /&gt; &lt;br /&gt;Silverlight extensions is only for platform assemblies, not user code. This is enforced by the extension's location; it can only be hosted on a Microsoft.com domain. However, it can be redirected to any domain from there (see below).&lt;br /&gt; &lt;br /&gt;AgDLR uses Silverlight extensions to deliver DLR+Language assemblies from Codeplex.com when a IronRuby or IronPython application is visited, rather than needing the assemblies in the XAP, or even deployed on your webserver.&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:37:57 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Extensions 20090325093757P</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=23</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
IronPython and IronRuby in Silverlight
&lt;/h1&gt;This is the project site for the &lt;b&gt;&lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Silverlight Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;, which lets you write browser applications with dynamic languages, like &lt;a href="http://ruby-lang.org" class="externalLink"&gt;Ruby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://python.org" class="externalLink"&gt;Python&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. The project is released under the &lt;a href="http://www.opensource.org/licenses/ms-pl.html" class="externalLink"&gt;Microsoft Public License&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;The &lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; contains support for writing Ruby and Python applications in the browser. However, since this project provides a bridge between Silverlight™ and the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;Dynamic Language Runtime (DLR)&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, any language running on the DLR will be enabled to build Silverlight™ applications.&lt;br /&gt; &lt;br /&gt;This project also enables hosting Ruby or Python inside VB and C# Silverlight™ applications, to add scripting support for you or your application's users. Lastly, it includes instructions on how write tests for a VB and C# applications with Ruby or Python.&lt;br /&gt;&lt;h2&gt;
Documentation
&lt;/h2&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Getting%20Started&amp;amp;referringTitle=Home"&gt;Getting Started&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hello%2c%20World&amp;amp;referringTitle=Home"&gt;Hello, World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;amp;referringTitle=Home"&gt;Hosting&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Extensions&amp;amp;referringTitle=Home"&gt;Extensions&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Daily Builds
&lt;/h2&gt;&lt;a href="http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr" class="externalLink"&gt;DLR Daily Builds&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes builds for the DLR in Silverlight™; simply replace the files in the /bin directory of sdlsdk with a daily builds. This is possible because the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;DLR CodePlex project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes a copy of this SDK in it's binary releases, and in it's source code repository.&lt;br /&gt;&lt;h2&gt;
Contributing
&lt;/h2&gt;The source code for this project is available on the &lt;a href="http://github.com/jschementi/agdlr" class="externalLink"&gt; AgDLR GitHub site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You can track daily progress there, as well as use bleeding edge features.&lt;br /&gt; &lt;br /&gt;This project is open to the community for submitting samples for Silverlight™ that are written in dynamic languages implemented on the DLR. Please post your submissions in the Discussions tab.&lt;br /&gt;&lt;h2&gt;
Language Websites
&lt;/h2&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ironruby.net" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:05:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090325090546P</guid></item><item><title>Updated Wiki: Hello, World</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hello, World&amp;version=4</link><description>&lt;div class="wikidoc"&gt;
&lt;a href="javascript:window.location.href='http://sdlsdk.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=63153';"&gt;agdlr-400.png&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:02:15 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hello, World 20090325090215P</guid></item><item><title>Updated Wiki: Hello, World</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hello, World&amp;version=3</link><description>&lt;div class="wikidoc"&gt;
Testing attachments&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Wed, 25 Mar 2009 21:01:53 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hello, World 20090325090153P</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=22</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
IronPython and IronRuby in Silverlight
&lt;/h1&gt;This is the project site for the &lt;b&gt;&lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Silverlight Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;, which lets you write browser applications with dynamic languages, like &lt;a href="http://ruby-lang.org" class="externalLink"&gt;Ruby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://python.org" class="externalLink"&gt;Python&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. The project is released under the &lt;a href="http://www.opensource.org/licenses/ms-pl.html" class="externalLink"&gt;Microsoft Public License&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;The &lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; contains support for writing Ruby and Python applications in the browser. However, since this project provides a bridge between Silverlight™ and the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;Dynamic Language Runtime (DLR)&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, any language running on the DLR will be enabled to build Silverlight™ applications.&lt;br /&gt; &lt;br /&gt;This project also enables hosting Ruby or Python inside VB and C# Silverlight™ applications, to add scripting support for you or your application's users. Lastly, it includes instructions on how write tests for a VB and C# applications with Ruby or Python.&lt;br /&gt;&lt;h2&gt;
Documentation
&lt;/h2&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Getting%20Started&amp;amp;referringTitle=Home"&gt;Getting Started&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hello%2c%20World&amp;amp;referringTitle=Home"&gt;Hello, World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;amp;referringTitle=Home"&gt;Hosting&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Daily Builds
&lt;/h2&gt;&lt;a href="http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr" class="externalLink"&gt;DLR Daily Builds&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes builds for the DLR in Silverlight™; simply replace the files in the /bin directory of sdlsdk with a daily builds. This is possible because the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;DLR CodePlex project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes a copy of this SDK in it's binary releases, and in it's source code repository.&lt;br /&gt;&lt;h2&gt;
Contributing
&lt;/h2&gt;The source code for this project is available on the &lt;a href="http://github.com/jschementi/agdlr" class="externalLink"&gt; AgDLR GitHub site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You can track daily progress there, as well as use bleeding edge features.&lt;br /&gt; &lt;br /&gt;This project is open to the community for submitting samples for Silverlight™ that are written in dynamic languages implemented on the DLR. Please post your submissions in the Discussions tab.&lt;br /&gt;&lt;h2&gt;
Language Websites
&lt;/h2&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ironruby.net" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 24 Mar 2009 05:13:28 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090324051328A</guid></item><item><title>Updated Wiki: Home</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Home&amp;version=21</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
IronPython and IronRuby in Silverlight
&lt;/h1&gt;This is the project site for the &lt;b&gt;&lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Silverlight Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;, which lets you write browser applications with dynamic languages, like &lt;a href="http://ruby-lang.org" class="externalLink"&gt;Ruby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; and &lt;a href="http://python.org" class="externalLink"&gt;Python&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. The project is released under the &lt;a href="http://www.opensource.org/licenses/ms-pl.html" class="externalLink"&gt;Microsoft Public License&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt; &lt;br /&gt;The &lt;a href="http://silverlight.net/learn/dynamiclanguages.aspx" class="externalLink"&gt;Dynamic Languages SDK&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; contains support for writing Ruby and Python applications in the browser. However, since this project provides a bridge between Silverlight™ and the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;Dynamic Language Runtime (DLR)&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;, any language running on the DLR will be enabled to build Silverlight™ applications.&lt;br /&gt; &lt;br /&gt;This project also enables hosting Ruby or Python inside VB and C# Silverlight™ applications, to add scripting support for you or your application's users. Lastly, it includes instructions on how write tests for a VB and C# applications with Ruby or Python.&lt;br /&gt;&lt;h2&gt;
Documentation
&lt;/h2&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Getting%20Started&amp;amp;referringTitle=Home"&gt;Getting Started&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hello%2c%20World&amp;amp;referringTitle=Home"&gt;Hello, World&lt;/a&gt;&lt;br /&gt;&lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;amp;referringTitle=Home"&gt;Hosting&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;
Daily Builds
&lt;/h2&gt;&lt;a href="http://nightlybuilds.cloudapp.net/Project.aspx?project=dlr" class="externalLink"&gt;DLR Daily Builds&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes builds for the DLR in Silverlight™; simply replace the files in the /bin directory of sdlsdk with a daily builds. This is possible because the &lt;a href="http://dlr.codeplex.com" class="externalLink"&gt;DLR CodePlex project&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt; includes a copy of this SDK in it's binary releases, and in it's source code repository.&lt;br /&gt;&lt;h2&gt;
Contributing
&lt;/h2&gt;The source code for this project is available on the &lt;a href="http://github.com/jschementi/agdlr" class="externalLink"&gt; AgDLR GitHub site&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. You can track daily progress there, as well as use bleeding edge features.&lt;br /&gt; &lt;br /&gt;This project is open to the community for submitting samples for Silverlight™ that are written in dynamic languages implemented on the DLR. Please post your submissions in the Discussions tab.&lt;br /&gt;&lt;h2&gt;
Language Websites
&lt;/h2&gt;&lt;a href="http://ironpython.codeplex.com" class="externalLink"&gt;IronPython&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ironruby.net" class="externalLink"&gt;IronRuby&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 24 Mar 2009 05:10:28 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20090324051028A</guid></item><item><title>Updated Wiki: Hosting</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Hosting the DLR in Silverlight
&lt;/h1&gt;Hosting a dynamic language in Silverlight gives any Silverlight application (in any Silverlight language: C#/VB/Ruby/Python/JScript/others) the ability to run code in either Python, Ruby, JScript, or any other DLR-based language, from inside itself. For more information on the DLR and hosting, see &lt;a href="http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome" class="externalLink"&gt;http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Differences between desktop and Silverlight
&lt;/h2&gt;The code necessary to host the DLR inside of Silverlight is different than on the desktop. Also, the code different between static and dynamic languages. In both cases, they only differ in how you construct the ScriptRuntimeSetup object.&lt;br /&gt;&lt;h3&gt;
Discovering languages
&lt;/h3&gt;The first difference is how ScriptRuntimeSetup finds out the available languages. This information can either be loaded from a configuration file inside the XAP (language.config), or from the already-loaded assemblies themselves. The desktop does not allow loading from the assemblies, since it doesn't want to encourage loading all the language assemblies when they are not needed. However, Silverlight pre-loads all assemblies anyway, so both options are given in Silverlight.&lt;br /&gt; &lt;br /&gt;Microsoft.Scripting.Silverlight.Configuration has helper methods to load the configuration from either a language.config from the XAP file, or, to avoid having the config file, the language assemblies themselves. &lt;br /&gt;&lt;h3&gt;
Platform Adaptation Layer
&lt;/h3&gt;The desktop and Silverlight differ in a big way when it comes to the File system; Silverlight does not have access to the machine's file system. Instead, it can only access files inside the XAP file, or in Isolated Storage. The DLR abstracts platform functionality into a PlatformAdaptationLayer (PAL), which can be changed by supplying a custom ScriptHost, which knows about a custom PAL. &lt;br /&gt; &lt;br /&gt;The DLR's default PAL doesn't define any behavior for Silverlight; it just throws &amp;quot;NotImplementedException&amp;quot; if any platform functionality is used. Microsoft.Scripting.Silverlight.BrowserScriptHost is a custom ScriptHost which knows about an internal BrowserPAL class, which directs any read-only file system access to the XAP.&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from C# or VB
&lt;/h2&gt;The following tells the ScriptRuntimeSetup about the avaliable languages from the loaded assemblies, and sets the HostType to BrowserScriptHost, which will make read-only platform-specific features work. It also pre-references platform assemblies so AddReference/LoadAssembly doesn't need to be called from script code.&lt;br /&gt;&lt;h3&gt;
C#
&lt;/h3&gt;&lt;pre&gt;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Silverlight;
 
ScriptRuntimeSetup setup = Configuration.LoadFromAssemblies(Package.GetManifestAssemblies());
setup.HostType = typeof(BrowserScriptHost);
ScriptRuntime runtime = new ScriptRuntime(setup);
// load platform assemblies so you don't need to call LoadAssembly in script code.
foreach (string name in new string[] { &amp;quot;mscorlib&amp;quot;, &amp;quot;System&amp;quot;, &amp;quot;System.Windows&amp;quot;, &amp;quot;System.Windows.Browser&amp;quot;, &amp;quot;System.Net&amp;quot; })
{
    runtime.Host.PlatformAdaptationLayer.LoadAssembly(name);
}
 
// now the desktop and Silverlight are the same ...
ScriptEngine engine = runtime.GetEngine(&amp;quot;Python&amp;quot;)
ScriptSource source = engine.CreateScriptSourceFromString(&amp;quot;System.Windows.Browser.HtmlPage.Document.Message.innerHTML = 'Hello, World'&amp;quot;)
source.Compile().Execute();
&lt;/pre&gt; &lt;br /&gt;&lt;h3&gt;
VB 
&lt;/h3&gt;&lt;pre&gt;
coming soon
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from Python, Ruby, or JScript
&lt;/h2&gt;Since the DLR/Silverlight integration is a C# application and hosts the DLR itself, the above work is already done for a dynamic language. Therefore, dynamic languages only need access to the ScriptRuntime or ScriptRuntimeSetup objects.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Ruby
&lt;/h3&gt;&lt;pre&gt;
require 'Microsoft.Scripting'
include Microsoft.Scripting.Silverlight
include Microsoft.Scripting.Hosting
runtime = ScriptRuntime.new(DynamicApplication.current.runtime.setup)
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.current.runtime
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Python
&lt;/h3&gt;&lt;pre&gt;
import clr
clr.AddReference(&amp;quot;Microsoft.Scripting&amp;quot;)
from Microsoft.Scripting.Hosting import ScriptRuntime, ScriptRuntimeSetup
from Microsoft.Scripting.Silverlight import DynamicApplication
runtime = ScriptRuntime(DynamicApplication.Current.Runtime.Setup
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.Current.Runtime
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Mar 2009 20:24:44 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hosting 20090310082444P</guid></item><item><title>Updated Wiki: Hosting</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Hosting the DLR in Silverlight
&lt;/h1&gt;Hosting a dynamic language in Silverlight gives any Silverlight application (in any Silverlight language: C#/VB/Ruby/Python/JScript/others) the ability to run code in either Python, Ruby, JScript, or any other DLR-based language, from inside itself. For more information on the DLR and hosting, see &lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=DLR%20docs%3a%20http%3a%2f%2fdlr.codeplex.com%2fWiki%2fView.aspx%3ftitleDocs%2520and%2520specs%26referringTitleHome&amp;amp;referringTitle=Hosting"&gt;DLR docs: http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Differences between desktop and Silverlight
&lt;/h2&gt;The code necessary to host the DLR inside of Silverlight is different than on the desktop. Also, the code different between static and dynamic languages. In both cases, they only differ in how you construct the ScriptRuntimeSetup object.&lt;br /&gt;&lt;h3&gt;
Discovering languages
&lt;/h3&gt;The first difference is how ScriptRuntimeSetup finds out the available languages. This information can either be loaded from a configuration file inside the XAP (language.config), or from the already-loaded assemblies themselves. The desktop does not allow loading from the assemblies, since it doesn't want to encourage loading all the language assemblies when they are not needed. However, Silverlight pre-loads all assemblies anyway, so both options are given in Silverlight.&lt;br /&gt; &lt;br /&gt;Microsoft.Scripting.Silverlight.Configuration has helper methods to load the configuration from either a language.config from the XAP file, or, to avoid having the config file, the language assemblies themselves. &lt;br /&gt;&lt;h3&gt;
Platform Adaptation Layer
&lt;/h3&gt;The desktop and Silverlight differ in a big way when it comes to the File system; Silverlight does not have access to the machine's file system. Instead, it can only access files inside the XAP file, or in Isolated Storage. The DLR abstracts platform functionality into a PlatformAdaptationLayer (PAL), which can be changed by supplying a custom ScriptHost, which knows about a custom PAL. &lt;br /&gt; &lt;br /&gt;The DLR's default PAL doesn't define any behavior for Silverlight; it just throws &amp;quot;NotImplementedException&amp;quot; if any platform functionality is used. Microsoft.Scripting.Silverlight.BrowserScriptHost is a custom ScriptHost which knows about an internal BrowserPAL class, which directs any read-only file system access to the XAP.&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from C# or VB
&lt;/h2&gt;The following tells the ScriptRuntimeSetup about the avaliable languages from the loaded assemblies, and sets the HostType to BrowserScriptHost, which will make read-only platform-specific features work. It also pre-references platform assemblies so AddReference/LoadAssembly doesn't need to be called from script code.&lt;br /&gt;&lt;h3&gt;
C#
&lt;/h3&gt;&lt;pre&gt;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Silverlight;
 
ScriptRuntimeSetup setup = Configuration.LoadFromAssemblies(Package.GetManifestAssemblies());
setup.HostType = typeof(BrowserScriptHost);
ScriptRuntime runtime = new ScriptRuntime(setup);
// load platform assemblies so you don't need to call LoadAssembly in script code.
foreach (string name in new string[] { &amp;quot;mscorlib&amp;quot;, &amp;quot;System&amp;quot;, &amp;quot;System.Windows&amp;quot;, &amp;quot;System.Windows.Browser&amp;quot;, &amp;quot;System.Net&amp;quot; })
{
    runtime.Host.PlatformAdaptationLayer.LoadAssembly(name);
}
 
// now the desktop and Silverlight are the same ...
ScriptEngine engine = runtime.GetEngine(&amp;quot;Python&amp;quot;)
ScriptSource source = engine.CreateScriptSourceFromString(&amp;quot;System.Windows.Browser.HtmlPage.Document.Message.innerHTML = 'Hello, World'&amp;quot;)
source.Compile().Execute();
&lt;/pre&gt; &lt;br /&gt;&lt;h3&gt;
VB 
&lt;/h3&gt;&lt;pre&gt;
coming soon
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from Python, Ruby, or JScript
&lt;/h2&gt;Since the DLR/Silverlight integration is a C# application and hosts the DLR itself, the above work is already done for a dynamic language. Therefore, dynamic languages only need access to the ScriptRuntime or ScriptRuntimeSetup objects.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Ruby
&lt;/h3&gt;&lt;pre&gt;
require 'Microsoft.Scripting'
include Microsoft.Scripting.Silverlight
include Microsoft.Scripting.Hosting
runtime = ScriptRuntime.new(DynamicApplication.current.runtime.setup)
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.current.runtime
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Python
&lt;/h3&gt;&lt;pre&gt;
import clr
clr.AddReference(&amp;quot;Microsoft.Scripting&amp;quot;)
from Microsoft.Scripting.Hosting import ScriptRuntime, ScriptRuntimeSetup
from Microsoft.Scripting.Silverlight import DynamicApplication
runtime = ScriptRuntime(DynamicApplication.Current.Runtime.Setup
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.Current.Runtime
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Mar 2009 20:23:43 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hosting 20090310082343P</guid></item><item><title>Updated Wiki: Hosting</title><link>http://sdlsdk.codeplex.com/Wiki/View.aspx?title=Hosting&amp;version=7</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;
Hosting the DLR in Silverlight
&lt;/h1&gt;Hosting a dynamic language in Silverlight gives any Silverlight application (in any Silverlight language: C#/VB/Ruby/Python/JScript/others) the ability to run code in either Python, Ruby, JScript, or any other DLR-based language, from inside itself. For more information on the DLR and hosting, see &lt;a href="http://sdlsdk.codeplex.com/Wiki/View.aspx?title=DLR%20docs%3ahttp%3a%2f%2fdlr.codeplex.com%2fWiki%2fView.aspx%3ftitleDocs%2520and%2520specs%26referringTitleHome&amp;amp;referringTitle=Hosting"&gt;DLR docs:http://dlr.codeplex.com/Wiki/View.aspx?titleDocs%20and%20specs&amp;amp;referringTitleHome&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Differences between desktop and Silverlight
&lt;/h2&gt;The code necessary to host the DLR inside of Silverlight is different than on the desktop. Also, the code different between static and dynamic languages. In both cases, they only differ in how you construct the ScriptRuntimeSetup object.&lt;br /&gt;&lt;h3&gt;
Discovering languages
&lt;/h3&gt;The first difference is how ScriptRuntimeSetup finds out the available languages. This information can either be loaded from a configuration file inside the XAP (language.config), or from the already-loaded assemblies themselves. The desktop does not allow loading from the assemblies, since it doesn't want to encourage loading all the language assemblies when they are not needed. However, Silverlight pre-loads all assemblies anyway, so both options are given in Silverlight.&lt;br /&gt; &lt;br /&gt;Microsoft.Scripting.Silverlight.Configuration has helper methods to load the configuration from either a language.config from the XAP file, or, to avoid having the config file, the language assemblies themselves. &lt;br /&gt;&lt;h3&gt;
Platform Adaptation Layer
&lt;/h3&gt;The desktop and Silverlight differ in a big way when it comes to the File system; Silverlight does not have access to the machine's file system. Instead, it can only access files inside the XAP file, or in Isolated Storage. The DLR abstracts platform functionality into a PlatformAdaptationLayer (PAL), which can be changed by supplying a custom ScriptHost, which knows about a custom PAL. &lt;br /&gt; &lt;br /&gt;The DLR's default PAL doesn't define any behavior for Silverlight; it just throws &amp;quot;NotImplementedException&amp;quot; if any platform functionality is used. Microsoft.Scripting.Silverlight.BrowserScriptHost is a custom ScriptHost which knows about an internal BrowserPAL class, which directs any read-only file system access to the XAP.&lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from C# or VB
&lt;/h2&gt;The following tells the ScriptRuntimeSetup about the avaliable languages from the loaded assemblies, and sets the HostType to BrowserScriptHost, which will make read-only platform-specific features work. It also pre-references platform assemblies so AddReference/LoadAssembly doesn't need to be called from script code.&lt;br /&gt;&lt;h3&gt;
C#
&lt;/h3&gt;&lt;pre&gt;
using Microsoft.Scripting.Hosting;
using Microsoft.Scripting.Silverlight;
 
ScriptRuntimeSetup setup = Configuration.LoadFromAssemblies(Package.GetManifestAssemblies());
setup.HostType = typeof(BrowserScriptHost);
ScriptRuntime runtime = new ScriptRuntime(setup);
// load platform assemblies so you don't need to call LoadAssembly in script code.
foreach (string name in new string[] { &amp;quot;mscorlib&amp;quot;, &amp;quot;System&amp;quot;, &amp;quot;System.Windows&amp;quot;, &amp;quot;System.Windows.Browser&amp;quot;, &amp;quot;System.Net&amp;quot; })
{
    runtime.Host.PlatformAdaptationLayer.LoadAssembly(name);
}
 
// now the desktop and Silverlight are the same ...
ScriptEngine engine = runtime.GetEngine(&amp;quot;Python&amp;quot;)
ScriptSource source = engine.CreateScriptSourceFromString(&amp;quot;System.Windows.Browser.HtmlPage.Document.Message.innerHTML = 'Hello, World'&amp;quot;)
source.Compile().Execute();
&lt;/pre&gt; &lt;br /&gt;&lt;h3&gt;
VB 
&lt;/h3&gt;&lt;pre&gt;
coming soon
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h2&gt;
Hosting the DLR from Python, Ruby, or JScript
&lt;/h2&gt;Since the DLR/Silverlight integration is a C# application and hosts the DLR itself, the above work is already done for a dynamic language. Therefore, dynamic languages only need access to the ScriptRuntime or ScriptRuntimeSetup objects.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Ruby
&lt;/h3&gt;&lt;pre&gt;
require 'Microsoft.Scripting'
include Microsoft.Scripting.Silverlight
include Microsoft.Scripting.Hosting
runtime = ScriptRuntime.new(DynamicApplication.current.runtime.setup)
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.current.runtime
&lt;/pre&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
Python
&lt;/h3&gt;&lt;pre&gt;
import clr
clr.AddReference(&amp;quot;Microsoft.Scripting&amp;quot;)
from Microsoft.Scripting.Hosting import ScriptRuntime, ScriptRuntimeSetup
from Microsoft.Scripting.Silverlight import DynamicApplication
runtime = ScriptRuntime(DynamicApplication.Current.Runtime.Setup
 
# or, is you just want to reuse the ScriptRuntime object:
runtime = DynamicApplication.Current.Runtime
&lt;/pre&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>jimmysch</author><pubDate>Tue, 10 Mar 2009 20:20:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Hosting 20090310082046P</guid></item></channel></rss>