Introduction to IronPython & SilverlightPython in Your Browser![]() IronPython & Silverlight
IntroductionSilverlight 2 is a browser plugin from Microsoft. Through Silverlight it is possible to create dynamic applications and natively script the browser with Python. In this series of articles we will look at what it is possible to achieve with Silverlight, and how to get started with dynamic applications. This includes the following topics:
The examples used throughout these articles are online and available for download. They all require Silverlight 2.0 Beta 1. First though, an introduction to both IronPython and Silverlight. (For the quick lowdown on what's new in Silverlight 2, read Silverlight 2 and Dynamic Silverlight.) IronPythonIronPython is an implementation of the popular dynamic programming language Python. Python is a general purpose programming language used for everything from desktop applications, running YouTube, games, managing Imageworks animation pipeline, automated hard drive testing for Seagate - and much more. IronPython runs on the .NET framework and Mono. This allows Python programmers to take advantage of the extensive framework libraries and powerful runtime of .NET, and allows .NET programmers to take advantage of Python! IronPython was originally created by Jim Hugunin, and is now developed by a team of programmers (which sometimes includes Jim!) at Microsoft. IronPython is a Python compiler, compiling Python code to in memory assemblies.
For a more comprehensive introduction to Python and IronPython you can read the first chapter of IronPython in Action which is free to download. SilverlightSilverlight is Microsoft's entry into the rich internet application framework race.
Silverlight is a sandboxed browser plugin for creating rich client-side web applications. It runs on Windows and Mac OSX, supporting Firefox, IE and Safari (with support for more browsers on the way). Nokia S60 and Windows Mobile support have also been announced. There is a Mono version called Moonlight, which runs on Linux (supporting Firefox). This is now officially backed by Microsoft who are making the media codecs, the test suite and the full specification available to the Mono team. Initially it will target Firefox on Linux, but eventually will run on multiple browsers everywhere that Mono runs. Version 1 of Silverlight focusses on media streaming and is programmed with Javascript. Version 2, which is still in beta, ships with a cut down version of the CLR (the core of the .NET framework). It can be programmed with C# or any of the DLR languages which includes IronPython. All the examples I show here require Silverlight 2.0 Beta 1. What Does Silverlight Offer
It isn't just Python that you can program Silverlight with. The dynamic languages currently available (from Microsoft) for Silverlight are IronPython, IronRuby and managed JScript. Why managed JScript? Managed Javascript is ECMAScript compliant (ECMAScript 3.0) - so code written AJAX style with traditional Javascript can be ported over to run in Silverlight, and run much faster. Really well integrated with the rest of the platform. These languages can also interoperate with the traditional .NET languages. They can use classes created from C# /VB code without wrappers. To the dynamic languages they are natural objects just as much as ones they have created themselves. There are several ways that dynamic applications can use Silverlight:
One major difference between Silverlight and Adobe Flex/AIR is that there is currently no way to use Silverlight to create applications that are separate from the browser (well the Mono guys have done this with Moonlight). Silverlight separates presentation from code (design from development), through XAML. This is an XML markup for creating user interfaces, including theming interfaces and defining animations. This is intended to be created by tools like Expression Blend (currently in free beta). There is also a version for Mono called 'Lunar Eclipse' under development. We will be looking at how to create user interfaces, using the fancy new controls for Silverlight 2, either by working with XAML from IronPython or directly from code. We'll also explore interacting with the browser DOM and (normal) Javascript. First we'll look at the structure of an IronPython & Silverlight application. For buying techie books, science fiction, computer hardware or the latest gadgets: visit The Voidspace Amazon Store. If you're looking for a new techie job, try the Voidspace Tech Job Board. This is part of the Hidden Network of technology and programming jobs.
Last edited Sat Mar 22 01:15:41 2008. Counter... |
|
|
Blogads
Follow me on: Tech Jobs |