by Miguel de Icaza

After a loving incubation period, the Moonlight 2.0 preview, an open source implementation of Microsoft's Silverlight for Linux has been released:

This is really the release I have been looking for since Microsoft first introduced Silverlight 1.1 and ever since our 21-day hack-a-thon to bring Silverlight to Linux.

This is the ECMA VM running inside the browser and powering C# and any other CIL-compatible languages like Ruby, Python and Boo. You can use Moonlight/Silverlight as a GUI (this is what most folks do) or you can use it as the engine to power your Python/Ruby scripting in the browser.

Installing Moonlight 1.9

Go to our preview page, select the platform and hit the download icon.

That will download and install the plugin in your Firefox installation. You can then restart the browser, and you should see this:

Then you can try out some of the test web sites we have been working on. This is CNN's The Moment that uses Silverlight/Photosynth:

If instead of binaries you want to build Moonlight in the comfort of your own living room while sipping margaritas, fetch the source code for mono, mcs, mono-basic and moon from the branch and build them in this order: mono, mono-basic and moon.

While one hand holds your margarita, use the other one to follow the instructions on how to compile Mono from SVN.

Some Notes on this Release

Now some qualifications to this release:

This is a preview release. By this we mean that we are not yet feature complete with Silverlight 2.0 feature-to-feature but we are relatively close. For example, we do not yet pass the entire Silverlight GUI 2.0 test suite that was provided to us by Microsoft and you can spot glitches in various web sites.

Security Sandbox: One of the reasons we delayed the first preview of Moonlight for public consumption was that we did not want to release Moonlight without the security sandbox. In the pre-Moonlight days there was no reason for Mono to implement a security sandbox, so we never had it. With Moonlight a security sandbox is mandatory so we implemented it.

Moonlight 2.0 ships with the new CoreCLR Sandbox that was introduced in Silverlight 2.0. This security system is very easy to understand, it is pretty straightforward and is a lot easier to secure and audit than something like CAS. I will blog about the security stack in another post.

But even if we now have a security sandbox , we have not completed the security audit.

Weekly Releases: Our current plan is to update the plugin once a week during this preview/alpha period hoping that we can get good bug reports and to ensure that we work in as many Linux distributions as possible.

Debug Builds: During the preview/alpha cycle we are shipping our code with debugging symbols hoping that this will improve the quality of the bug reports that we receive. This means that the plugin size instead of being 3.9 megs is 8.8 megs on average. This will change when we do the final release.

The Cool Toys

There are a number of cool toys on this release, the foundation for many things to come. Here are some:

Silverlight Unix SDK: If you install Mono 2.4 and Moonlight SDK (not the browser plugin, but the -devel package) you can now develop Silverlight applications entirely in Unix.

In fact when you install Eclipse4SL (a Microsoft sponsored project) you need Mono 2.4 to build Silverlight apps. With the Moonlight SDK you can skip an entire step by having the SDK assemblies present at installation time.

I will do another blog on how to build Silverlight apps from the ground up on Unix using the Moonlight SDK.

Microsoft MS-PL Controls: Instead of reimplementing the high-level controls (buttons, Checkboxes, listboxes, containers, calendars, datepickers, sliders) or the very advanced controls (like a full database bound datagrid) Moonlight reuses Microsoft's open sourced Silverlight controls.

Iron* Languages: In addition to C# you can run code written in a variety of programming languages that target the ECMA CLI. In particular dynamic languages.

IronRuby and IronPython are open source implementations of Ruby and Python done by Microsoft that can be used in Silverlight but you can also use a variety of other languages in the browser like Visual Basic or PHP (Phalanger).

Visual Basic Runtime: This is just a plug for the work that Mainsoft did a few years ago. One of the things that Silverlight ships with is a Visual Basic class library for all the VB helper functions.

Mainsoft contributed a few years ago a VB runtime written entirely in VB

We ship a "tuned" version of their assemblies as part of the Moonlight release.

Adaptive Streaming: This also deserves a blog entry of its own. In addition to the support for HTTP-Streaming (to support seeking and stream quality selection) Silverlight allows developers to create their own transports to fetch media and not be limited by HTTP.

For instance, a developer could write a transport that fetches different bits of the media from different servers. Or use bittorrent to fetch the media instead of depending on a single server. More in an upcoming blog entry.

DeepZoom: with all of the bells and whistles that you expect.

Hard Rock Memorabilia on Moonlight/Linux.

Silverlight 3.0 APIs: As we were implementing the 2.0 APIs a handful of features from 3.0 fit naturally into our design. So instead of going the extra mile to limit things in 2.0, we just expose the 3.0 APIs in a forward-compatible fashion.

This Moonlight preview includes a few 3.0 features:

Out-of-browser support (although this is currently a manual process, not yet automated, and without a GUI).

WritableBitmap class.

3.0 pluggable media pipeline.

SaveDialog support.

There are more details see Chris Toshok's blog entry.

The pluggable media framework is very exciting to us, because it means that developers can author their own codecs without waiting for Silverlight or Moonlight to add support for it.

We have developed a handful of open source codecs for Dirac, Vorbis and ADPCM that can be used with Silverlight 3/Moonlight Preview based on existing C# and Java implementations. Hopefully someone will help us fill in the blanks with more codecs (like Theora).

For up-to-date news check out our README file.

In the words of Paris Jobs, this release is nothing short of hawt.

Moonlight Twitteristas

If you want to follow the progress of various Moonlight activities on Twitter, you can follow these folks:

moonproject: the twitter account for project news.

kumpera: in charge of the Mono metadata and IL verifier and creator of Mono.SIMD.

spouliot: Mono's security and cryptography Czar and graphics hacker.

lewing: Moonlight core hacker, in charge of Moonlight's layout and performance and also the creator of the Linux logo and co-developer of F-Spot.

toshok: Moonlight team leader and maintainer of the core of Moonlight. ex-Winforms team lead.

jbevain: In charge of the Silverlight 2.1 API, Mono's Linker and Cecil.

kangamono: Codec hacker, hard-problem solver, iPhone support, Mono on Mac.

atsushi_eno: XML, LINQ to XML, WCF and pluggable codec author.

sh4na: Recovering winformista, in charge of the new toggle ref implementation and the Moonlight/Javascript bridge.

rolfkvinge: media pipeline, visual basic runtime, vbnc compiler (Mono's VB compiler written in VB).

jstedfast: text layout engine, and ex-Evolution hacker.

jacksonh: All things XAML, a recovering Winformista/Ilasm-ista. A must-follow twitterista, considering that even Aimee_b_loved follows him.

rustyhowell: release engineering.

Some of the team members are not twitteristas yet.

Alternatively, if you are not really into twitter, you can always check our aggregated blogs at monologue.