Library tutorials & articles

The Zen of Volta

IL Re-writing

This article was originally published by developmentor
developmentor

On December 5th, 2007, Microsoft announced an incubation project they have been working on called Volta (http://labs.live.com/volta). The announcement focused on a new way of deploying applications written using conventional single-tier architecture to a multi-tiered client/server environment without having to rewrite the code. Along with the announcement, Microsoft posted a preview version of the Volta infrastructure for people to start experimenting with. This is not an official CTP or beta, simply a way for people to get an early view of what Microsoft is exploring and to be able to provide feedback.

The software preview requires Visual Studio 2008 and adds a number of new Volta project types:

New Volta Project

The included samples are all web based and show off one of the main features of Volta: the ability to write an application in C#, and then have the Volta toolkit post-process the compiled code into JavaScript. This allows the application to run as a standard HTML-based web application, while still allowing the developer to build it in a comfortable environment. This feature is very similar to the Google Web Toolkit (GWT), which attempts to solve many of the same issues. However, Volta is far more ambitious as this article will demonstrate.

IL Re-Writing

The real technology that Volta encapsulates is IL re-writing. As you are probably aware, in the .NET world, the compiler’s job is to translate your source code into Intermediate Language (IL) code. This IL is then just-in-time (JIT) compiled into executable code at runtime. The IL itself is a very simple stack-based byte code which is easy to verify and easy to translate into executable code – a critical requirement if you are going to compile it at runtime!

IL re-writing examines the compiled assembly and rewrites it for a different platform or to provide extra functionality – features that the developer wants to have but didn’t want to code. With Volta, the developer simply declares their “intention” through a series of attributes and Volta re-writes the IL code to implement the requested feature! Volta has a post-compiler to perform this bit of magic and they target the IL specifically so that it is language agnostic so any .NET language can utilize this new toolkit. This is a primary difference from GWT, which targets only Java today.

The Volta team organizes this IL re-writing capability into three areas: repurposing, remodulating and refactoring.

Repurposing

Repurposing is the feature we have already mentioned – taking the IL and transforming it into something else such as JavaScript. With this capability we can repurpose the code for other platforms (such as the web) without doing a manual rewrite. This is the feature that has gotten the most attention so far because of the potential – the current target is basic JavaScript/HTML but the same technique could generate RIA clients using Silverlight.

Remodulating

Remodulating involves generating code that is directed at a specific browser at runtime so that we get the best possible experience we can for that user. This is probably the least interesting of the three types of rewriting as the web controls in ASP.NET have been able to do browser-dependent rendering since ASP.NET 1.0.

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of The Zen of Volta.

Leave a comment

Sign in or Join us (it's free).

Richard Blewett Richard is the CTO of DevelopMentor UK. He began life as a mainframe programmer writing ALGOL and COBOL, but jumped to OS/2 after a year. In 1995, he started developing under Windows and got his fi...
AddThis

Related discussion

Related podcasts

  • More jQuery in ASP.NET

    In this episode Chris Brandsma, Rick Strahl, Dave Ward, Bertrand Le Roy, and Scott Koon conclude their discussion of Microsoft's jQuery in ASP.NET announcement1.This episode of the Alt.NET Podcast is brought to you by LLBLGen Pro, the most mature O/R mapper and code generator out there.Are ...

Events coming up

  • Nov 18

    15 Minutes of Fame

    Dresher, United States

    This is a yearly tradition. We select 10 of the favorite speakers from monthly meetings, code camps, and hands on labs. Each one does a 15 minute talk on their favorite .NET technology. This is our 10th anniversary so we plan a gala event with special prizes and refreshments.

We'd love to hear what you think! Submit ideas or give us feedback