Microsoft's Silverlight Disappoints

Preface: I initially started playing with Silverlight with the hopes of writing software that will run on multiple platforms, mostly Mac and Windows. The goal of this article was originally to develop a cross-platform application using Microsoft's Silverlight platform and the IronPython language. It didn't take me long to realize that all this alpha software has holes in it for developing a simple cross-platform applications. I understand that I'm playing with alpha software and that many of my gripes will be fixed in the future. (I hope so, anyway.)

And now we start
I've seen some demos applications created with Microsoft's Silverlight (formerly called WPFe) development platform. They look sharp and snazzy and modern. With the release of Silverlight 1.1 Alpha, Microsoft releases the ability to use .NET languages to create Silverlight applications. Included with this is the new DLR , Dynamic Language Runtime, and the ability to program with your favorite dynamic languages, like Ruby or Python via Microsoft's IronRuby or IronPython implementations. This would be a big bonus if I could use my favorite language to create Flash like applications. I started the process of gathering all the required installs from Microsoft's Silverlight website. I was planning on developing with IronPython 1.1 since IronRuby hasn't been released yet, and then porting a simple image viewer application that I wrote in WPF (Windows Presentation Foundation) a few months ago. Well, after installing most of the required files, looking at samples, and getting a better understanding with what Silverlight is, I've now decided this article is about why I can't build my sample application.

There's lots of Beta and Alpha software required to preview Silverlight. I don't have a problem with most of it because the downloads are small, and the intrusion to installing into the system is minor. However, there's one nasty required install, and that's Visual Studio Orcas Beta 1, the next generation of Visual Studio. It's a whopping 6 Gigs to download (approximate). Why do I want developer tools that are SIX gigs in size? This is one of the reasons I'm going back to simpler development technologies. After all, the process of coding an applications is pretty simple: write text into a document, compile/build it to some form that is executable, whether it's files being pushed to a web server for viewing over the web, or a native executable that a user runs on their Mac or Windows box. The development process is all essentially the same for anything a developer does, write text, package it. While it's nice to have a development environment aid in writing a lot of this text (especially the mundane and repetative), there is a line in the sand where having the environment do too much is a bad thing. Ever since Visual Studio 2003, I've hated the wizards built into Visual Studio and how it allows a developer without the proper knowledge to create a mess of a project. I can install simpler development tools with features like Intellisense for less than 40 megs (look at Active State's Komodo). Even the install for Eclipse is less than 130 megs.

Anyway, I started looking into developing a simple Silverlight application with a text editor since this is how I developed my first ASP.NET application six years ago, and it's also how I started learning WPF. When I started with WPF, I used XAMLPad, and Visual Studio Express for C#. I installed a SDK and some Visual Studio plug-ins and I was off developing. Maybe because Silverlight is such alpha code, it doesn't have this integration yet? Maybe, MSFT never intends to support an Express version of Visual Studio? Hopefully not.

I started working with plain text files and Notepad++ and looking at the sample apps. I copied the Python PhotoViewer project to use as my template (the version I've linked to was written in JScript since MSFT doesn't have the Python one posted to their website) . It's very easy to get a Canvas up and running with a TextBox in it. But I wanted to so something more, I wanted to port my existing application. I quickly found out that there was no support for WPF Layouts, DockPanels, and ComboBoxs. What, not a basic control like a ComboBox? How is a developer to develop without one? Sliverlight doesn't come with any user controls, not even a button. If you were hoping to port an existing WPF application, you're really out of luck, even for a simple application that only has a few buttons and a combo box -- which mine does.

I shake off the dissapointment and continue up the trail
Included with theSilverlight 1.1 Alpha SDK is a SilverlightControlsStarterKit that has a few basic UI controls: buttons, a very basic listbox, scrollbars, scroll viewer area, and a Range Selector (a slider-like control). However, to use these controls, I needed to build them. In order to build them, I needed Visual Studio Orcas -- something I'm refusing to install.

I was very interested in trying to use the controls in the SilverlightControlsStarterKit, so I started hacking with the .sln files to see if I couldn't build them in a version of Visual Stuido that wasn't the Orcas Beta. After a few minutes I decided this wasn't a path worth going down.

I went to Google and started searching for Silverlight Controls ComboBox and couldn't find anything -- I was expecting another developer to have conjured up one by now. What I did find was that the third-party company Telerik was building RadControls for Silverlight -- not a ComboBox, though.

All is not lost!
There are a couple of nifty samples, though, in the Silverlight 1.1 SDK. One is the PhotoViewer written with Python as the language. It's located in the samplesPhotoViewerpython folder. Basically, a web page hosts the Silverlight runtime and calls some Javascript to load a XAML file, which binds to the code, whether C#, VB.NET, JavaScript, or Python. In this sample case, it was binding the XAML to IronPython with the following in the header:
<x:Code Source="Code.py" Type="text/python" />

That's the only change required in the XAML file to bind to the IronPython runtime. So Simple.

The DLR Console

Media_httpdocsgooglec_fakdu
The other cool sample is the DLR console runtime that allows you to play with different languages (Python and Javascript supported for now, I imagine Ruby will be in the future) and dynamically modify WPF properties in the display window much like the XAMLPad that comes with the WPF SDK allows with XAML. Look at the code in the window above, that's what Python looks like controlling the Silverlight API. Ahhhh...Python. Just wait until how beautiful Ruby will look!

Other Silverlight Disappointments and Revelations
I'm also disappointed that it looks like Silverlight will only run inside the browser, like current Flash applications. Adobe's been there, been doing that for years. I was really hoping to be able to generate executables for both Mac OSX and Windows (would also like to support Linux), but the only way I can think to do that is to make a native executable shim for each OS and embed a web browser that can host the Silverlight Controls. Not something that's entirely out of the question, plenty of people have been doing this with Flash. This led me to a revelation: Silverlight isn't my golden ticket to cross-platform simple application development, what I'm really looking for is a cross-platform WPF runtime.

I'm going to now research the upcoming Adobe Apollo environment, which promises Windows, Mac, and Linux runtimes. The only thing I'm not really digging about Apollo is having to use Adobe's ActionScript. It would be so much better if it supported existing scripting languages that many developers already know, like Python, Ruby, Perl, etc.. This was the draw for me to looking at Microsoft's Silverlight in the first place.

I'm not going to totally dismiss Silverlight, as an alpha is far from release, and the promise to be able to develop in Python or Ruby is quite enticing to me. I justvelopers to use. I could even write it in Python.

Questions/Comments for Microsoft:

  • Couldn't the compiled dlls SilverlightControlsStarterKit for these so we could at least start playing with them wit hope that when the time comes for Silverlight to be mainstream, I'm not going to have to use Microsoft's latest Visual Studio, that maybe they'll have a lightweight and free version like they do for their C# and VB and WebDevelopment platforms.

    And, maybe I should be a little less lazy and build a ComboBox in Silverlight for all dehout compiling them like we could the rest of the samples in the SDK?

  • What is the plan for including user controls? Is Silverlight going to be too lightweight (no basic controls that were even included in Visual Basic 3.0 14 years ago)?
  • Is there a document somewhere listing what features/controls from WPF will be supported in Silverlight?A Microsoft Silverlight Developer Reference, for those who are visual.
  • With Silverlight will we be able to install applications to target platform, like Adobe Apollo, or is Silverlight only intended to run inside the browser? I know the answer to this, but I'm hoping this isn't so. Silverlight isn't going to compete against Apollo, but Flash in it's ability to stream custom content to custom embeded applications.
  • Is there ever going to be a cross-platform runtime for WPF? (This is what I'm really looking for.) Learned that NOPE, not unless we wait for Mono to port .NET 3.0 Looking at the new Microsoft Developer Reference image (link below), there are some classes in Silverlight 1.1 that aren't in the current .CHM document, most interestingly to me is the Windows.Applicaiton class -- hmm, could this mean anything for my desires?
  • Remember your target audience for these Alphas includes the hardcore developers, especially those who don't want to install massive beta software. Delivering some simple text file templates would go a long way. (I should clarify, that you only need the simple SDK to start your fun hacking, but my complaint about this has more to do with Orcas being required to play with the included controls, which I wanted to do. This wasn't a well thoughtout comment.)

10 Reasons to Learn the Python Programming Language

10 Reasons to Learn the Python Programming Language (Not necessarily in order)
  1. Access to developing light-weight embedded web applications. Yes, like the UI you use to configure your router. Like future UIs to control access to your NAS, or to potentially stream music and video from your NAS. Read Implementing an embedded Linux web app framework to see how to implement a full-featured web stack environment in less than 10 megabytes. Sweet.
  2. Plenty of APIs. There aren't as many third-party add-ons available for Python as there is for Java or .NET, however, I have faith that anything you wanted to do with a commercial web application -- even authenticating against LDAP or Microsoft's Active Directory -- can be done in Python. The Python community is quite active and there's plenty of resources available to those who use Google search.
  3. Object-Oriented Goodness. Classes, inheritance, and reusable libraries. Loose the messiness of Perl for large applications, but with all the benefits of a dynamic language and all those design patterns that you learned for Java. Create code that is succinct and simple to read.
  4. Plenty of Web Frameworks offering AJAX with friendly MVC (Model View Controller) implementations. Some argue that what makes developing in Ruby so great is that there's one defacto way of doing things. Others argue that you need to find the right tool for the right job, and that not all frameworks are designed to solve the same problems. Python offers many web stacks: full-blown MVC implementations in Django, TurboGears (which uses CherryPy), Zope, or Pylons; or smaller lighter scripts with Python Server Pages which are similar to Microsoft's Active Server Pages, JSP (Sun's Java Server Pages), or PHP Scripts.
  5. Write scripts that run natively on Mac OSX (It comes with the Python interpreter).
  6. Learn a language that will allow you to write applications that can take advantage of Amazon's Elastic Compute Cloud (Amazon EC2) and S2 infrastructure hosting. Innovate and create your web services or next great technology without worrying about the infrastructure it runs on. Just know it's Linux and that a lot of the hard details have been handled for you. Create backup services, file transfer, custom bookmarking , photo sharing, or Your-Next-Big-Idea.
  7. Lightweight development environment. My installation of Visual Studio 2005 takes over 2 gigs of hard drive space. It's not easy to move my development environment around. My installation of Eclipse and some Java love is a much lighter 250 megs. An installation of Komodo and the Python run-times (complete with Django and TurboGears) is about 140 megs. You can get much lighter, if you don't want a full-featured development IDE like Komodo that has integrated debugging and code-completion (Emacs, VI, Notepad++, IDLE -- this comes with Python for Windows).
  8. Better integration APIs for disparate Enterprise technologies than Ruby (though, I have faith that Ruby will get there). Python has been around and used for well over a decade. When I was at Microsoft, back in 1997, they acquired a company whose entire commerce server product was written in Python. Microsoft tossed some COM wrappers over this python code and released it as Merchant Server 1.0. Even back in 1997, there were production ready ODBC drivers and the ability for COM component creation. Now days, there's xml-rpc, SOAP Suppot (Soapy ), ado bindings (plus many other supported databases), etc...Python has been around longer than Java. Extends easily into Java. Checkout a variation of Python that runs inside the java run-time and allows full access to the Java APIs Jython Jython (thouh JRuby was just acquired by Sun). IronPython allows Python to run inside the .NET CLR. With Active State's Enterprise Edition you can purchase yearly support contracts to make managers (and their managers) happy.
  9. Write web applications once, deploy to multitude of platforms. Develop a web application on either your DELL or Mac laptop. Deploy to your production off-site hosing company's Linux servers, or Amazon's forthcoming Elastic Compute Cloud (EC2) technologies (See #6 above).
  10. Write fat clients for multiple platforms. Target your applications for both Windows, OSX, and Linux. Read about wxPython's implementation of wxWidgets for sexy cross-platform development goodness. Or, try a Riverbank's PyQt Python wrapper for Trolltech's QT commercial cross-platform libraries. These days, I can't develop software for home consumers that can't run on multiple-platforms. Yes, I want them to use my brilliance with their Macs, Windows, and Linux desktops -- that is, if my ideas are worthy.
  11. Google, Yahoo, Amazon. What do they know about technology that you don't, besides delivering the most reliable websites on the web? Remember that movie, The Phantom Menace? Industrial Light & Magic used Python to aid in the creation of the special effects. Python everywhere: scripting, GUI development, and web-based apps.