X
Tech

Dissecting Silverlight

Silverlight 1.0 is the "camel's nose in the tent". In Silverlight 1.1, the camel has his whole head in the tent and is rummaging around in your backpack for food. In this article I take the wraps off the install packages to see what's inside.
Written by Ed Burnette, Contributor

Two new technologies from Microsoft should be on the radar of every Rich Internet Application developer. The first is Silverlight 1.0, a canvas-like control which is programmed by browser JavaScript. It's fairly light weight (1.4M download), and works in all major browsers on Windows and MacOSX (no Linux yet). It is currently in beta.

The second is Silverlight 1.1, which builds on 1.0 by adding a virtual machine for running logic inside the plug-in. This is much closer to the approach used by the Flash player. The advantage of bundling your own language and runtime is that developers are isolated from browser inconsistencies (it's hard work to write a Javascript program that will run in all browsers now). Silverlight does Flash one better by supporting more than one language (currently C#, VB, JavaScript, and Python). The Flash player is limited to ActionScript.

Silverlight 1.1 is not quite as light weight (4.3M download with the current alpha) because it does a lot more than 1.0. Let's take a look inside the install packages to see what you get. I'll just look at the Windows version because that's what I have.

Silverlight 1.0

Silverlight 1.0 installs only two files:

agcore.dll (2.2M installed) - This is the core ActiveX control that is responsible for Silverlight rendering and events, including audio and video decoding.

npctrl.dll (460K) - A wrapper for agcore.dll that makes it run inside Firefox. 

Silverlight 1.1

Silverlight 1.1 uses the same exact files plus many others that add a stripped-down version of the Microsoft .NET Framework:

coreclr.dll (3.2M installed) - Microsoft .NET Runtime Common Language Runtime (i.e., the virtual machine).

mscorlib.dll (1.8M) - Microsoft Common Language Runtime Class Library.

microsoft.scripting.dll (556K) - Part of the .NET framework, supports hooks for support scripting in various languages.

mscorrc.dll (326K) -  Resources (icons/text for natural language translations).

microsoft.jscript.runtime.dll (292K) - Microsoft's JavaScript language runtime. Note this JavaScript is running in the CLR not in the browser.

microsoft.visualbasic.dll (280K) - VisualBasic language runtime.

system.xml.core.dll (272K) - .NET framework libraries for XML parsing.

system.core.dll (224K) - Lowest level .NET framework libraries.

ironpython.modules.dll (216K) - Python language classes.

ironpython.dll (184K) - Python language runtime.

agclr.dll (132K) - This looks like glue to get the Silverlight control and the .NET CLR to talk to each other.

microsoft.jscript.compiler.dll (112K) - Microsoft's JavaScript compiler.

system.silverlight.dll (108K) - A .NET module that lets CLR programs access Silverlight specific APIs.

slr.dll (108K) - An abstract DOM library that lets CLR code running inside Silverlight access the browser it is hosted in. There are two versions, one for IE, and one for Firefox.

Analysis

Silverlight 1.0 is the "camel's nose in the tent". It's small and useful, with what looks like a relatively small surface for security attacks. While writing portable JavaScript is not easy, it's not impossible either, and tools like the Google Web Toolkit (or its clones) could let you pretend to program in your favorite language, compile that to JavaScript, and run RIA's with a minimum footprint.

In Silverlight 1.1, the camel has his whole head in the tent and is rummaging around in your backpack for food. Silverlight 1.1 is essentially the Microsoft .NET framework masquarading as a portable Web plug-in. This can be both good and bad. MS .NET is a nice elegant system that was designed after Microsoft and Sun had their famous falling out over what constitutes "real Java". Some .NET fans describe it as "Java done right", while Java fans just call it a blatant rip-off.

As Joel once wrote, the reason companies spend millions on something they give away is not altruism, it's to promote some complementary technology. Adobe gives away the Flash player so they can sell more tools like Flash, Illustrator, and the Flex IDE. Microsoft is giving away Silverlight 1.1 to make .NET more ubiquitous. They can then monetize this by selling tools like Expressions and Visual Studio, and of course operating systems to run those tools.

A good question to ask is, where is Sun in all this? I've heard rumors of an answer to Silverlight and Flash coming out of Santa Clara, but nothing definitive. Expect to hear more soon. JavaOne is next week, after all.
Editorial standards