X
Tech

Volta: Browser capabilities on steroids

I ran across Mary Jo Foley's recent post in a series on Microsoft code names where she discussed Volta. As I tend, as a developer, to look at these things from a different angle, I thought I'd add my own explanation of the technology.
Written by John Carroll, Contributor

I ran across Mary Jo Foley's recent post in a series on Microsoft code names where she discussed Volta. As I tend, as a developer, to look at these things from a different angle, I thought I'd add my own explanation of the technology.

I first saw Volta mentioned in a Thinkweek proposal about a year ago. The bit that resonated strongest with me was the how Volta could convert .NET code into Javascript. The paper went into detail about how .NET IL structures could be represented in the browser scripting language. The advantage, of course, is that the code is generated, and thus doesn't require the hand tuning that leads Javascript programmers to pull their hair out (I have done far too much Javascript programming in my career, which in my case has just made my hair longer).

That paper, however, was like finding a leaf lying on the ground in a forest. Volta does far more than just convert IL to Javascript, as I learned from watching this interview with Erik Meijer on Channel 9, Microsoft's video site for developers.

In most development projects, it's pretty hard to write everything in .NET. If you use a database, you often have to write a bunch of database-specific stored procedure or SQL calls. If you intend the application to be accessed through a web browser, unless that browser supports Silverlight (and as a soon to be released product, not too many do), you will have to write HTML, CSS and Javascript.

Microsoft is trying to reduce the need for such non-managed implementations by creating surrounding infrastructure that will handle the unique details of a particular interaction on the developers behalf. For instance, the new LINQ extensions that will come with version 3.0 of the C# language enable developers to write data access code in C# and allow LINQ Data Provider objects to handle the fiddly details of how those requests are honored.

Volta does the same thing on the client side. You can write code that targets Silverlight, as an example, and if the target browser doesn't support Silverlight, the code will be "converted" to a DHTML / CSS / Javascript implementation on the fly. In fact, that implementation can be tailored to the unique requirements of the browser, and functionality can be boosted or reduced depending on what that browser can handle. For those familiar with ASP.NET programming, this is like Browser Capabilities on steroids.

Way back when I wrote a series about .NET taking over the world, I talked about the self-describing nature of .NET "binaries" as a neat way to get source code for released software in any computer language you prefer. Lutz Roeder's .NET Reflector demonstrates that in spades, allowing you to decompile a .NET assembly into any .NET-compatible language for which plugins exist (if you haven't downloaded it yet, do it now). Volta is like a strange form of decompilation where the generated code is designed to convert a managed code application into something that can run in a standard web browser.

There's even some logic included in Volta to transform 3D graphics into DHTML. Erik Meijer talks about it in the video interview, but it involves the ability to represent any image through a series of triangles, which Meijer creates through a rather interesting trick of div tag definition.

The interviewer asked what performance was like in a system that used swarms of simulated triangle-shaped divs, and obviously, it isn't as good as if you are running a Silverlight application locally. However, that's the interesting feature of Volta. You can write an application for maximum functionality using nothing but managed code, and know that the result will run on even downlevel browsers that have never heard of .NET.

Volta is interesting stuff, and proof that Microsoft's real competitive advantage is the platform experts that populate its halls like teams of computer science superheroes. That's a point that Microsoft would do well to remember. It's always good to know what you do well. It shapes how you decide to attack other markets.

Editorial standards