Picture of jgehtland

Silverlight, the DLR, and thee

  • Posted By Justin Gehtland on May 15, 2007

I had the privilege of giving a talk last week at the Triangle .NET User group on the topic of Ruby and the CLR. My talk was prepared well in advance, and was going to go into detail about RubyCLR and its place in the Ruby runtime universe. Then, of course, at the beginning of last week, the world shifted under my feet at Mix07 when John and Jim announced Silverlight, the DLR and IronRuby.

At the meeting, Chris Love gave a 15-minute talk before I got up, all showing samples of Silverlight in action. (Thanks, Chris, for the kind words, by the way). Chris did a great and enthusiastic job, but he said something then that I’ve since heard repeated and I’d like to talk about. He said, approximately, “Here’s Silverlight, and it has just killed Ajax.”

Silverlight vs. Ajax

The general thrust of this argument is that having a full-fledge rich-windowing experience in the browser is going to put a stop to all that amateurish mucking around with JavaScript and the DOM. I said it at the meeting, and I’ll say it again here, that’s hogwash. First and foremost, there will always be a developer community whose members will not adopt a technology that is a) closed source and b) under the control of a single corporate entity. Anybody who ever used the acronym LAMP in casual conversation is a member of this group. They simply will not base their technology stack on Silverlight, or Flash, or Flex, or JavaFX, or whatever.

Which means that, to the extent that Chris and others are right, they may be right that Silverlight will kill off Ajax development within the current Microsoft development community. That’s probably true, but only to a degree. Silverlight currently runs only in IE and Firefox on Windows and Firefox and Safari on the Mac. (From what I hear, Opera for both platforms is “close”.) There are two platforms missing from that list: *nix and the loose collection of OSes known as mobile devices. Development teams will still need to support those clients, so Silverlight won’t just nix JavaScript and the DOM overnight.

More importantly, if the message of Silverlight is “write rich desktop-like apps and deliver them in the browser”, then Silverlight isn’t going to kill Ajax. It is going to kill ASP.NET. Why even have a stack whose purpose is to translate big, functional, object-oriented code into some combination of HTML and JavaScript if you can just whip up some slick XAML and get cool features like local storage to boot? If Silverlight is the future, then necessarily, ASP.NET is the past. I don’t see many people talking about this. Sure, there are a ton of articles about creating Silverlight controls for ASP.NET apps, but really, why not go all the way? Which brings me to my next question….

Silverlight vs. Flash vs. ClickOnce vs. Web Start vs. XUL vs. Applets

Remember when applets were the future? And the browser wars of the mid-90’s were supposedly because Microsoft was afraid that Netscape Navigator would replace the desktop? Remember when Flash represented the future of the UI? Or Web Start and ClickOnce would bridge the gap between the rich desktop experience and the ease of deployment of the web? Yeah, me too. And exactly 0% of those things came to pass. Applets died and left the world with nothing but a gymnastic Starfleet insignia. Navigator bought it when IE became “free” as in “monopoly”. If the state of XUL can be inferred from the state of XULPlanet, then XUL has been visited by the Borg. Web Start was too slow, and ClickOnce was just another way to launch a Windows installer but without all the, well, windows. Flash has become the game/media player/cartoon/hip banner ad technology of choice, but how many of us have actually used an application developed in Flash? (Other than Rich Kilmer).

So what does Silverlight have that the others don’t? At first glance, it is just the Flash model. Except, its the Flash model with multiple possible languages with which to write your code. So you get reach, rich controls, browser interaction, access to extra-browser capabilities, cross-platform deployment AND your choice of C#, VB, JScript, IronPython or IronRuby to author your apps. The downsides seem to be Microsoft dependence, lack of *nix support, lack of Standards (meaning minimal third-party ability to create more deployment vectors), and the Microsoft Permissive License (worst legal document name EVAH…sounds like something from a swingers’ club).

What about JavaFX?

So, Sun immediately comes out with its answer to Silverlight, called JavaFX. It seems to be an unimpressive, needless alternative to Groovy (I’m not alone in thinking this. It has no coherent deployment story, other than the JavaFX Mobile platform, so it at least hits a niche Microsoft missed on its first swing. I think I’ll just stick with Groovy, thanks. Or JRuby. Or Jython. Or anything that doesn’t have this lame q/a in its FAQ:

Why isn’t Groovy enough? Groovy and other languages have two specific traits which don’t precisely meet these needs, namely that they are generic in nature and don’t provide the appropriate abstractions necessary to optimize the UI design process and similarly are designed specifically for programmers other than content authors.

I mean, c’mon. Even if you leave aside the actual SwingBuilder libraries and other downloadable UI layers for Groovy that already exist, the entire POINT of a language like Groovy is that it is flexible enough to write those abstractions your own damn self. That reasoning is beyond flawed; its written by a salesman, who doesn’t have the faintest idea what Groovy is, or why anybody would use it. Which brings me to point #4….

The DLR

When you hear Microsoft people speak of Silverlight, they will often mention the DLR (Dynamic Language Runtime). This is the layer that replaces the IronPython bridge and RubyCLR. They’ve created a common type system for a variety of languages, including JScript, VB (the way it ought to be), IronPython, and now IronRuby. It then provides a bridge between this dynamic type system and the standard CTS. It currently runs in Silverlight, which means it will let me write my in-browser code in Ruby, which makes me happy.

In fact, I’d argue that the DLR was my favorite attempt at a new runtime for Dynamic languages except for two small items: first, the team has gone and written its own spec for dynamic type systems without really playing with the other kids on the block. Charles Nutter, for example, has been leading the charge on creating a real spec for Ruby, and Microsoft pretty much sidestepped the whole thing. The second issue is….

Microsoft might be the lamest company in existence.

Microsoft recently announced that it believes that up to 235 of its patents have been infringed by FOSS. They are laying the groundwork for a culling of the herd; they are threatening legal action, hoping that the weakest of the FOSS vendors will crawl into Redmond and pay tithe so they won’t have to go to court over the issue. Microsoft really doesn’t want to go to court. They’ve already beta tested that option by sponsoring SCO. No, Microsoft just wants to spread the FUD and pocket the low-hanging fruit. I’m with Tim on this one.

All of which means that, if Microsoft is going to go and adopt open source technologies to make their platform better, while distributing their own code under what can best be described as the Nixon-mask version of an open source license, and then spread FUD grenades around in the crowded marketplace, then their dynamic platform has very little real chance of being adopted by anybody outside of Redmond.

Comments
  1. Gavin StarkMay 15, 2007 @ 07:19 PM

    There are many great MVC platforms (you’ve commented on many) but most seem to leave the V to suffer the pitfalls of HTML/CSS browser incompatibility, piles of Javascript and Javascript libraries and the general difficulty in building rich interfaces.

    So what about Open Laszlo (http://www.openlaszlo.org) It seems an appealing open format that can be rendered down to Flash/DHTML (and who knows, maybe this Flashlight, oh I mean Silverlight, thing someday)

    If Silverlight, Flex, Laszlo and other view frameworks can bring to the table the improvements we’ve seen in model and controller stacks I believe we’ll see experience another great boost.

    So my fear is that the lure of these technologies will make Silverlight or Flex too attractive to many developers (including myself) I don’t want to be in the position of choosing between banging my head against an endless sea of IE hacks and Javascript libraries or selling my soul to Adobe or Microsoft.

    Is there really a good-enough alternative to “all that amateurish mucking around with JavaScript and the DOM” ?

  2. murpheeMay 15, 2007 @ 09:13 PM

    DLR: What in the world does the DLR have to do with the RubySpec? A RubySpec (for instance, the one generate by two Google SoC projects) will be useful for the IronRuby guys too.

    Flash apps: What flash applications have I used? I don’t know… Google Analytics? Google Finance? Yahoo Maps? You seem to exclude YouTube or Google Video from the term “applications”, but nevertheless: they would never have been possible without Flash.

  3. jgehtlandMay 16, 2007 @ 12:46 AM

    murphee—

    The DLR is half of the implementation of IronRuby; IronRuby is, itself, the other half. To date, the Microsoft team appears to be operating in a vacuum, essentially creating its own spec for Ruby. I’d like to see them take an active role in working with the rest of the folks trying to make a spec, like the JRuby team.

    And, you are right. I over stated the case on Flash, and your comment on my definition of “application” is right on target. Flash has certainly become a mainstay of the modern web, but you’ve named pretty much every major non-gimmicky, more-than-just-a-widget implementation of Flash that is in major use. My point is that, looking at the universe of web applications, majority Flash-based apps are a severe minority.

  4. Mário LopesMay 16, 2007 @ 02:35 AM

    I’m positively surprised by the accuracy of this sentence: “Microsoft might be the lamest company in existence”. I’d only substitute “might be” by “definitely is”.

    Basically, it all boils down to that sentence. MSVP and all those MS-licking people will keep using Microsoft regardless of the quality of the product itself. Everyone else will opt for a free/open stack that it’s not controlled by one private entity.

    The time when only the product mattered is gone. So, even if Silverlight could actually be the best thing after sliced bread, it’s doomed to mediocre outcome due to the fact of being closed, controlled by Microsoft and, yet again, a lock-in strategy.

  5. John LamMay 16, 2007 @ 04:00 AM

    A couple of small comments:

    1) The MsPL is a BSD-style license. Can you help me understand what is so restrictive with the MsPL?

    2) One reason why we’re building IronRuby on top of the DLR is to act as a forcing function to validate the design (and in some cases mutate the design) of the DLR itself. The DLR type system is undergoing changes today as a result of integrating IronRuby into the set of languages. There are four languages under active development today for the DLR (and if you count Peter Fisk’s public work for his Smalltalk implementation) that makes five. Feedback from these languages will only make the DLR better over time.

    3) There are some challenges in participating in an active spec process, but I don’t make up the rules of engagement. That’s why I haven’t been as active as I would like to be here.

  6. GarthMay 16, 2007 @ 08:40 AM

    I’d like to see where Flex is going. From what I’ve used so far, it seems very promising. I think Silverlight is coming to the party a little too late – personally I think Microsoft stopped innovating in the technology space when .NET was introduced. Given the choice and Flash or Silverlight and taking into account their perceived similarities, it would have to be Flash, given the massively installed user base out there.

  7. jgehtlandMay 16, 2007 @ 11:01 AM

    John—thanks for the update on that. I’m assuming that, as of right now, you are running a one-man show on IronRuby, so it would be difficult to find time to be an active participant in the spec process yourself. But I’d love to see Microsoft make the effort.

    As for the licenses, see the next blog post.

  8. MarkMay 16, 2007 @ 01:46 PM

    It seems as if everybody gets this wrong when they start getting all worried about Silverlight killing off Ajax. Ajax is just the base-line of what we’ll expect at most “web sites”. But Ajax is hopelessly crippled as a desktop applications replacement. There’s no getting around that.

    As far as the open source fanboy ra-ra goes, it doesn’t matter. Microsoft owns the client, there will be a Mac port, and probably a Mono implementation for *nix in the future. Linux and GPL zealots are irrelevant.

  9. jgehtlandMay 16, 2007 @ 04:15 PM

    mark—I think that’s a fairly short-sighted take on Ajax, and open source. Zimbra is showing that Ajax is anything but crippled for making applications, and Microsoft owns WHAT client? The mobile OS? Nope. The browser? Not as much as it used to. The desktop? At work, maybe.

  10. MarkMay 17, 2007 @ 12:20 PM

    jghetland, The underlying technology for the stock browser is hopelessly crippled. There’s no getting around that.

    Maybe you haven’t noticed, but Microsoft still owns 95% of the desktop. You add in the Mac, and Silverlight covers 99% of the desktops out there. The linux desktop is irrelevant, but I’m sure Mono will get there eventually.