Category Archives: silverlight

Microsoft’s new .NET logo

One thing I forgot to mention from PDC 2008: the new .NET logo:

Note the visual link to the Silverlight logo; the ribbon (I may be reading too much into this); and the soft brushwork that is meant to evoke “designer” as well as “developer”.

The .NET part has changed from lower case to upper case. This was the old logo:

 

Since as far as I’m aware Microsoft has always preferred .NET to .net or .Net (except in the logo) I guess this makes sense. Must remember to type it that way.

Hello Windows Azure

Ozzie has made his big announcement here at PDC 2008. Windows Azure is, he says, Windows for the cloud; a “web tier” offering that runs on Microsoft’s own datacenters. The basics: develop a web service in Visual Studio, deploy it to Azure. You can test and debug using a local Azure server. The client for Azure apps can be anything that can call a service – web app, Silverlight app, Windows app. Your Azure apps can call upon a set of other services many of which are already familiar. For example, the database is SQL Services, formerly called SQL Data Services. Workflow can be managed with Workflow Foundation (WF). For identity and access control, there will be an Active Directory connector, or other options (more on this later).

Note that Azure is a platform for hosted applications, written in .NET but eventually with an option for native code, rather than a VM running Windows in the manner of Amazon’s EC2 service. Thus, Azure has more in common with Google App Engine than with what Amazon is offering. Microsoft’s slides also show Sharepoint, Live Services, and Dynamics CRM as part of the Azure platform.

Microsoft will compete on things like the scope and ease of use of its platform. Integration with Visual Studio and Active Directory should make it relatively easy for Microsoft platform developers to start experimenting with enterprise apps hosted on Azure. Business model not spelt out yet, but the assumption is that Azure apps will scale seamlessly and on-demand.

Technorati tags: , ,

BBC adopting Adobe AIR for platform-neutral iPlayer downloads

Just noticed that the BBC is adopting Adobe AIR to create a platform-neutral download client for iPlayer. Erik Huggers says:

Today, we are announcing that in partnership with Adobe we are building a platform-neutral download client.

Using Adobe Integrated Runtime (AIR), we intend to make BBC iPlayer download functionality available on Mac, Linux and Windows for the first time later this year. Whatever platform you use, you’ll now be able to download TV programmes from the BBC to watch later.

This follows much criticism of the BBC for its original Windows-only iPlayer.

Looks like Adobe has the BBC in its grip, technology wise, having ousted Microsoft from iPlayer completely – though I believe it is still experimenting with Silverlight’s Deep Zoom.

Technorati tags: , , , ,

Silverlight 2.0 is released, Eclipse tools for Silverlight announced

Microsoft’s Scott Guthrie has announced the final release of Silverlight 2.0, its browser plug-in which includes a cross-platform implementation of the .NET runtime as well as a multimedia rendering engine. It will be available for download tomorrow.

Not really a surprise, but nonetheless a significant moment for Microsoft. I have been watching the project closely since it was first announced at PDC 2005 as Windows Presentation Foundation Everywhere. I am particularly interested in the cross-platform aspect. When .NET was first released in 2001, as Microsoft’s answer to Java after falling out with Sun, it had obvious cross-platform potential, yet the company held back form any commercial implementation outside Windows. Miguel de Icaza took independent action to create an unofficial open source Linux implementation, that also runs on Mac and Windows, called Mono. Microsoft was initially wary of Mono, but in my view the company had more to gain than to lose by supporting it. That now appears to be recognized, with Microsoft working formally with Mono to support Moonlight, Silverlight on Linux, and to provide it with multimedia codecs.

Microsoft has also announced Eclipse tools for Silverlight, in partnership with Soyatec, the idea being to enable Java developers to develop for the Silverlight client within Eclipse.

One clarification: although the press release says “This includes support for Mac, Windows and Linux”, the Mac support for Silverlight 2.0 is Intel Mac only, and the Linux version lacks multimedia support and the 2.0 version is described as “Experimental”; it is a long way from full release. Although Microsoft is now working with Mono, cross-platform currently means Windows and Intel Mac, though this does account for a large proportion of active Web users.

Press release is here.

Technorati tags: , ,

Doubling performance with Silverlight multithreading

Bart Czernicki has a detailed post showing how Silverlight 2.0’s multithreading can improve performance. He took my counting primes code and  adapted it for parallel processing. On my quad core system the results are impressive:

As you can see by squinting at the screen grab, the processing time went from 0.43 to 0.20 seconds.

Multithreading is getting a bad rap in some quarters, because it greatly complicated debugging. On the other hand, if you have an app which does some heavy duty calculations then performance benefits like this are worth a little pain.

Technorati tags: , ,

H.264, AAC comes to Silverlight. Game over for VC-1?

Microsoft has announced that Silverlight will support the H.264 video standard “in a future version”, along with AAC for audio. H.264 is also used by Adobe Flash and has wide adoption across the industry; it’s likely that your HD video camera records to H.264, for example.

Good news for Silverlight, though it may be a while before we see this rolled out, but surely bad news for VC-1, Microsoft’s preferred video format and part of the Windows Media family. Why would anyone not standardize on H.264 now?

Defining cloud computing

I liked this post by Larry Dignan on the cloud computing buzzword and how meaningless it has become.

Writing on the subject recently, I was struck by the gulf between what some people mean – online apps like Google Apps and Gmail – and what others mean, on-demand utility computing such as that delivered by Amazon Elastic Compute Cloud or Flexiscale. These things have little in common.

Dignan has even more examples.

Should we abandon the term? Maybe, but I find it useful if only as shorthand for describing how the centre of gravity is shifting to the Internet.

Some services are more cloudy than others. Dignan refers to this Forrester report (though you’ll have to look at the blog post for the extracts, unless you want to buy it) which has a table of “six key characteristics.” I don’t agree with all of them; the business model, for example, is not an inherent part of cloud computing. I am interested in number two:

Accessible via Internet protocols from any computer

Any computer? OK, probably not the Atari ST which I have in the loft. Any computer with a web browser? What about requiring a “modern” web browser, is that OK? Java? Flash? Silverlight? A specific version of Java or Flash? What about when we need a runtime like Adobe AIR or Microsoft Live Mesh? What if it doesn’t run on Linux? Or on an Apple iPhone? What about when there is an offline component such as Google Gears? All these things narrow what is meant by “any computer”.

This is the old “rich versus reach” debate; it is still being played out. My point: cloud computing isn’t a boolean characteristic, but a continuum from very cloudy (NTP) to not cloudy at all (Microsoft Office).

10 things you might not have known about XAML

I’ve written a short piece on XAML for the Register. Here’s a few things you might not have known about Microsoft’s Extensible Application Markup Language:

1. It is not just for WPF (Windows Presentation Foundation); it is also used as a language for Workflow Foundation (WF). Microsoft has hinted that we will see more XAML applications announced at the forthcoming PDC.

2. XAML doesn’t have to be XML – see the intro to the XAML Object Mapping Specification 2006, which says that “any physical representation may be used.”

3. XAML is a small core and distinct from XAML vocabularies. The huge WPF is a XAML vocabulary. WF is another vocabulary.

4. Although XAML is usually represented as XML, it is near-impossible to create an XML Schema to validate it usefully. Here’s where Microsoft explains why.

5. In Visual Studio 2005, a huge but imperfect .xsd schema file was used for validation and to drive IntelliSense (things like code completion) in the XAML editor. In Visual Studio 2008 Microsoft abandoned that idea and uses a language service instead.

6. The core idea behind XAML is to be a declarative language for .NET. WPF is merely an early application for XAML.

7. XPS, Microsoft’s fixed-layout language that competes (just about) with Adobe’s PDF, uses XAML that is a subset of WPF. This means that you can actually display XPS documents in Silverlight – there’s no need for a viewer, it is native Silverlight code.

8. When you compile a Silverlight application, the XAML stays as XAML, albeit bundled into a resource.

9. Silverlight allows you to write inline XAML within HTML.

10. XAML rhymes with Camel. Sorry, you knew that already. But did you know that CAML (Compiled Application Markup Language) is XAML compiled to MSIL (Microsoft Intermediate Language)? Microsoft tested this idea in pre-release versions of WPF, but apparently the performance benefits were disappointing and it was less compact than BAML (Binary Application Markup Language), a tokenized representation of XAML. Silverlight doesn’t bother with either: XAML is saved as a resource in a .NET DLL, and then zipped as part of the .XAP package by which a Silverlight application is delivered.

Technorati tags: , , , ,

Parts of EcmaScript 4 deemed unsound for the Web

This was the conclusion of an EcmaScript meeting in Oslo last month. Specifically, as Brendan Eich explains, three features – packages, namespaces and early binding – were considered too heavyweight unsuitable for a browser scripting language. Here is Eich’s “Executive summary”:

The committee has resolved in favor of these tasks and conclusions:

1. Focus work on ES3.1 with full collaboration of all parties, and target two interoperable implementations by early next year.

2. Collaborate on the next step beyond ES3.1, which will include syntactic extensions but which will be more modest than ES4 in both semantic and syntactic innovation.

3. Some ES4 proposals have been deemed unsound for the Web, and are off the table for good: packages, namespaces and early binding. This conclusion is key to Harmony.

4. Other goals and ideas from ES4 are being rephrased to keep consensus in the committee; these include a notion of classes based on existing ES3 concepts combined with proposed ES3.1 extensions.

This means that the evolution of JavaScript is now on a new path, focused for now on a more modest enhancement to the language called EcmaScript 3.1.

Given how loudly Eich protested about EcmaScript 3.1 last October, it is a surprising turn of events. Was Eich convinced by the arguments of Microsoft and Yahoo in support of a more lightweight JavaScript?

What this means is that JavaScript 2.0 won’t happen as previously envisaged. John Resig:

… you can forget a lot of what you learned about ECMAScript 4, previously. Many of the complicated concepts contained in the language have been tossed. Instead there is a considerable amount of effort going in to making sure that new features will be easily duplicable through other means.

Eich and Resig are keen to stress that JavaScript will still be a highly capable language. Still, the obvious conclusion is that this will be good for plug-ins which support more powerful languages: Adobe Flash, Microsoft Silverlight, Sun Java or Java/FX. Personally I’m disappointed.

It is also presenting Adobe with a tricky problem, as it implemented much of an earlier specification for EcmaScript 4 in ActionScript 3. Rather than being a standard language, as Adobe had planned, it looks like this will now be more of an Adobe language. I doubt this will have much practical impact on developers.

PS Brendan Eich has commented below.

Silverlight 2 threading issues, Quickstarts not working

I’ve been working on a Silverlight tutorial involving reading an RSS feed. Silverlight has a SyndicationFeed class which is meant to make this easy – as Microsoft’s Scott Barnes enthuses here.

It is handy, but I discovered that the Quickstart Barnes refers to does not work in Silverlight 2 Beta 2. The Quickstart section on Silverlight.net needs some work. Even if you get to this Quickstart via the link for Silverlight 2 Beta 2 examples on this page, it is soon apparent that it is actually for Silverlight 2 Beta 1. Click the Run It button and you’ll see that it asks for the older runtime.

The code doesn’t work in Beta 2 either; and as so often with thread-y stuff, it’s not immediately clear what’s going wrong. I got a blank page and the following message in the Debug output window in Visual Studio:

A first chance exception of type ‘System.UnauthorizedAccessException’ occurred in mscorlib.dll

In situations like this I recommend breaking on all CLR exceptions (Debug – Exceptions – check the Thrown box for Common Language Runtime exceptions in Visual Studio). Run again; and this time Visual Studio stops on the line which updates a Silverlight TextBlock:

feedcontent.Text += "* " + item.Title.Text + Environment.NewLine

with the message “Invalid cross-thread access”:

Rooting about a bit, I found this post from Karen Corby on changes in Silverlight 2 Beta 2:

HttpWebRequest’s delegates are called on a new non-UI thread.

  • Delegates were previously always called on the UI thread.
  • You must invoke back on to the UI thread if the data you’re retrieving will be consumed by a UI element.
  • For an example, see the updated networking post series (part one).

What this means is that you have two doses of asynchronous coding to think about if you use HttpWebRequest. First, the request itself; and second, in the code you write for the response handler if it needs to update the UI – which in most cases it will.

The example referenced by Corby shows a neat solution using a SynchronizationContext object, or you can use the Dispatcher class as explained by Wilco Bauwer here – he also draws attention to locking issues. See also Shawn Wildermuth’s post though note that CheckAccess is available despite what is said here.

This adds a significant dose of complexity to Silverlight coding. I’m not sure if any of this will change again in the final release.

I also noticed that VB coders are not well served by the Silverlight examples out there, which are overwhelmingly C#. Looks like this is the language of choice if you want an easy life.