Dennis Forbes on Pragmatic Software Development
Subscribe to RSS
 
Thursday, May 03 2007

I mentioned Microsoft's new Silverlight platform a week ago, opining that it appeared to be nothing more than a Flash competitor...despite all the noise, enthusiasm and bluster that comes out of the gathering of the faithful (Mix '07).

If Flash wasn't already the answer for a particular problem space -- and it seldom is necessary or beneficial given the incredible power and versatility of the foundational web technologies -- why would Silverlight change the equation?

For those instances where Flash is an appropriate solution, the question then is what Silverlight brings to the table that Flash doesn't? What could possibly overcome the new entrant's already limited platform coverage and concerning vendor conflict of interest? Is Silverlight really just another attempt at pushing Windows Media, released as a last-ditch attempt to recapture some of the marketshare that WMV has lost, largely to Flash of all players.

The answer came as Mix progressed, when it was announced that the Silverlight platform will optionally come equipped with a .NET Common Language Runtime (the common language of course being Common Intermediate Language), equipped with a greatly pruned down Framework: the runtime and the framework occupy 2MB, so clearly it's only a tiny subset of the full .NET 2/3 framework.

Supposedly the CIL really is the same CIL used in our desktop and server .NET apps, so hypothetically a given assembly can be used on the desktop, in Silverlight on Windows, and even on Silverlight on the Mac (or any other platform that Microsoft decides to target), which is interesting.

In practice it's never that easy. The minimized framework included with Silverlight means that a lot of code will have dependencies that aren't satisfied in Silverlight, similar to the experiences many will have attempting to run .NET code on a Mono platform (despite Mono having a vastly larger Framework to draw from).

What it does mean, however, is that code (which before deployment will be "compiled" from whatever source language to the remarkably high-level Intermediate Language, much like you can use tools to "compile" Java to JavaScript, or Wasabi to PHP, or between any other Turing-complete language) run within Silverlight will likely demonstrate excellent performance: The .NET team has done a superb job of teasing great performance out of managed code, and I would expect that to carry over to Silverlight as well.

Silverlight was completely uninteresting before, but this new information makes me somewhat curious, and it does technologically differentiate the product.

This should light some fires under the team incorporating the JavaScript Tamarin engine (which humorously came from Flash) in Mozilla products. As it currently stands, the JavaScript interpreter in Mozilla is among the performance frontrunners, however that pack in general is proving to be unacceptably slow as the web becomes increasingly rich.

The Tamarin engine, and similar designs, hyper-accelerates things by doing JIT compilation of ECMAScript Edition 4 (JavaScript 2) to native code where possible, offering potentially enormous performance improvements.

Back to Silverlight, I laugh at those who are giddy with glee about the death of "HTML", or the coming of "Web 3.0" (which is an embarrassing comment being bandied about in regards to Silverlight).

Were Java Applets Web 3.0? Was ActiveX Web 3.0? Was VRML Web 3.0? Flash/Shockwave have been with us since Web 0.9.

Put a Remote Desktop ActiveX control on a page and people will declare it Web 3.0. Who knows, maybe Google will do just that.

Reader Comments

"which before deployment will be "compiled" from whatever source language to the remarkably high-level Intermediate Language, much like you can use tools to "compile" Java to JavaScript, or Wasabi to PHP"

You have it completely wrong. Its not a translation from one high level language to a slightly higher one, ala Java to JavaScript. IL is machine instructions for the .NET virtual machine, and is a much *lower* level than the source code.
Mike Moore @ 5/3/2007 4:12:08 PM
Mike,

A language that includes constructs like objects (both static and instances), specific types, virtual methods, and so on, is hardly a low-level language.

CIL is actually a remarkably high level "language". I've spent enough time spelunking through CIL to have a pretty good idea what I'm talking about. Play with Lutz Roeder's Reflector for a while and you start to get a feeling that it might be worthwhile skipping the syntactical sugar, and just programming CIL (well, the "assembly" variant textual representations of byte codes).

CIL is little like traditional machine code.
Dennis Forbes @ 5/3/2007 7:21:47 PM
Dennis,

I'm not convinced when you say that "CIL is absolutely *nothing* like machine code".

I'm from a machine code background, and looking at .NET assemblies via Reflector, as you suggest, looks very familiar indeed to me.

Of course, as you say, you have all the object stuff on top, which the processor doesn't understand natively (at least not at the moment). However, most of the other operations are pretty much like machine code, like the stack operations, basic math operations, etc.

The fact that it was so familiar is what I liked about .NET. Although I don't program directly in IL, it is not a completely insane idea. In fact, I use C# in VS2005, as it is more productive.

Regards,

Steve Jones.
Steve Jones @ 5/4/2007 3:48:50 AM
I certainly won't disagree that there are plenty of similarities. The object awareness of the "machine", however, completely and absolutely differentiates it from any low-level language, in my mind, however.

Really the richness or height of a language can often be determined by the verbosity of the language -- how many insructions are necessary to represent a correlating piece of "higher" level code, or a given piece of functionality. CIL tends to be extraordinarily brief for correlating .NET code, often distilling into a 1:1 opcode lines to higher level lines.
Dennis Forbes @ 5/4/2007 6:52:18 AM

Add Comment

Name *:

Email Address:

(your email address is not displayed)
Website:

Comment *:


Dennis Forbes - Dennis Forbes is a Toronto-based software architect and technology writer