[IronPython] IronPython and Silverlight 2

Michael Foord fuzzyman at voidspace.org.uk
Sun Mar 9 13:03:52 PDT 2008


Dino Viehland wrote:
> Hand rolling XML manifest files is really just create one and re-use 
> it all over the place.  This is what it typically looks like:
>  
> <Deployment 
> xmlns="http://schemas.microsoft.com/client/2007/deployment" 
> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
> RuntimeVersion="2.0.30226.00" 
> EntryPointAssembly="Microsoft.Scripting.Silverlight" 
> EntryPointType="Microsoft.Scripting.Silverlight.DynamicApplication">
>   <Deployment.Parts>
>     <!-- Add additional assemblies here -->
>     <AssemblyPart Name="Microsoft.Scripting.Silverlight" 
> Source="Microsoft.Scripting.Silverlight.dll" />
>     <AssemblyPart Source="Microsoft.Scripting.dll" />
>     <AssemblyPart Source="IronPython.dll" />
>     <AssemblyPart Source="IronPython.Modules.dll" />
>   </Deployment.Parts>
> </Deployment>
>  
> Drop that in a .ZIP file w/ the python file and those DLLs and rename 
> it .xap.  Unfortunately I don't believe there's a way to just deploy a 
> .py file.  The current model is you have the manfiest which points at 
> DynamicApplication and that in turn loads the language and 
> subsequently the .py file.
>  
> Somehow the referred assemblies can be somewhere else as well but I'm 
> not sure what that looks like.
>  

Ok. I've been playing with manifest files and still can't use the extra 
controls. See separate email.

Can you confirm that (as far as you know) this means that *every* 
IronPython Silverlight application has to send the IronPython dlls. Plus 
if I want to make the standard library available (for a Python 
interactive interpreter for example) then I have to package the *whole* 
standard library in the 'xap' file?

This is instead of the previous model (fro Silverlight 1.1) where 
assemblies and Python files would only be fetched from the server if 
they were actually needed. If what I have just said is true then the new 
model is *massively* inferior in my opinion.

It is also ironic that Jim Hugunin and John Lam (in Mix 07) made much of 
how the great advantages of working with dynamic languages for 
Silverlight is that they can be deployed as text. Now of course they 
need to be 'compiled' with a custom tool (chiron) and deployed in this 
compiled form - and not deployed as text...

Feel free to pass my comments on to those who made these decisions (I'm 
well aware it isn't you Dino)... On the other hand I may be wrong (and 
would be both delighted and apologetic).

Michael Foord
http://www.manning.com/foord

> ------------------------------------------------------------------------
> *From:* users-bounces at lists.ironpython.com 
> [users-bounces at lists.ironpython.com] On Behalf Of Michael Foord 
> [fuzzyman at voidspace.org.uk]
> *Sent:* Sunday, March 09, 2008 5:19 AM
> *To:* Discussion of IronPython
> *Subject:* Re: [IronPython] IronPython and Silverlight 2
>
>
>
> On 09/03/2008, *Kevin Chu* <redmoon17 at gmail.com 
> <mailto:redmoon17 at gmail.com>> wrote:
>
>     Hi
>     there is my blog about IronPython and Silverlight
>     2:http://www.cnblogs.com/redmoon/archive/2008/03/08/1096331.html
>     I write it in Chinese, however you can translate it by Google
>     Language Tool.
>     And this blog contain some useful links.
>
>
>
> As far as I can tell (!) your blog only shows how to create a Dynamic 
> Language Silverlight 2 application using 'app.xap' created with 
> Chiron. I want to be able to create an application *without* Chiron 
> which is deployed as text on the server (one of the great advantages 
> of using Dynamic Languages with Silverlight as explained by Jim 
> Hugunin at Mix07...).
>
> This means using a 'Silverlight.createObjectEx' call from Javascript 
> in the webpage - where I can pass in the name of the xaml file to 
> load. What I don't know is how in Silverlight 2 do I specify a Python 
> file - either in the 'createObjectEx' call or in the xaml file it loads...
>
> I don't want to be dependent on Chiron for creating/deploying dynamic 
> language applications, and I certainly don't want to have to hand roll 
> XML manifest files. Hopefully this isn't necessary I just can't quite 
> work it out yet.
>
> Michael
>  
>
>     On Sun, Mar 9, 2008 at 7:42 PM, Michael Foord
>     <fuzzyman at voidspace.org.uk <mailto:fuzzyman at voidspace.org.uk>> wrote:
>
>         Hello guys,
>
>         I would like to create Silverlight 2 applications *without*
>         using chiron
>         to create and deploy them. How do I specify the Python
>         application file?
>
>         I see that I can still use Silverlight.js and the 'createObjectEx'
>         function to initialise the Silverlight control in my html. How
>         do I
>         specify in 'app.xaml' the Python file to load?
>
>
>         function createSilverlightEx()
>         {
>            Silverlight.createObjectEx({
>                source: 'app.xaml',          // Source property value.
>                parentElement:parentElement,    // DOM reference to
>         hosting DIV tag.
>                id:'myPlugin',                  // Unique plug-in ID value.
>                properties:{                    // Plug-in properties.
>                    width:'1024',               // Width of rectangular
>         region
>         of plug-in, in pixels.
>                    height:'530',               // Height of
>         rectangular region
>         of plug-in, in pixels.
>                    inplaceInstallPrompt:false, // Determines whether
>         to display
>         in-place install prompt if invalid version is detected.
>                    background:'white',         // Background color of
>         plug-in.
>                    isWindowless:'false',       // Determines whether
>         to display
>         plug-in in windowless mode.
>                    framerate:'24',             // MaxFrameRate
>         property value.
>                    version:'1.0'},             // Silverlight version.
>                events:{
>                    onError:null,               // OnError property
>         value --
>         event-handler function name.
>                    onLoad:null},               // OnLoad property value --
>         event-handler function name.
>                initParams:null,                // initParams property
>         value --
>         user-settable string for information passing.
>                context:null});                 // Context value --
>         passed to
>         Silverlight.js onLoad event handlers.
>         }
>
>         Thanks
>
>         Michael
>
>
>         _______________________________________________
>         Users mailing list
>         Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>         http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
>
>
>     -- 
>     Once in a Redmoon
>     _______________________________________________
>     Users mailing list
>     Users at lists.ironpython.com <mailto:Users at lists.ironpython.com>
>     http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
>
>
> -- 
> http://www.manning.com/foord
> http://www.voidspace.org.uk
> http://www.ironpython.info
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   



More information about the Users mailing list