Migration Solutions for ColdFusion Applications to ASP.NET
      
Vince Bonfanti's Weblog

.NET Dynamic Language Runtime (DLR) and BlueDragon/CFML

Earlier this week I was at Microsoft working with the developers of the .NET Dynamic Language Runtime (DLR) and would like to share what I've learned, what we accomplished, and the potential future impact on BlueDragon and CFML.

Scott Guthrie started with an overview of Microsoft's strategy for developer tools and technologies, and an explanation of how the DLR fits into this strategy. He identified three major areas of software application development:

  • desktop applications (console and GUI-based)
  • HTML-based web applications
  • media-based rich Internet applications (RIA)
Microsoft's goal is to provide a common set of technologies and developer/designer tools for building applications in all of these three areas. The common technologies are:
  • the .NET Framework
  • Windows Presentation Foundation (WPF)
  • Silverlight (formerly WPF/e)
The common developer/designer tools are:
  • Visual Studio (for developers)
  • Expression Studio (for designers)
Contrast this to the situation that existed prior to the introduction of these technologies and tools. Building Windows desktop applications required using C/C++ and programming to the Win32 APIs. Building HTML-based web applications required use of either ASP, JSP, PHP, or CFML, along with JavaScript. Building RIA applications essentially meant using Flash and ActionScript. Each of these technologies comes with its own set of programming tools, and there's little or no integration among any of the developer tools and tools used by designers.

It's the ability to use a common set of technologies and tools to target a variety of application domains that makes Microsoft's strategy so appealing. The goal of the DLR effort is to make sure dynamic languages--such as Python, Ruby, JavaScript, etc.--can participate as first class citizens alongside static languages--such as C#, Visual Basic.NET, etc.--in this overall strategy. Our goal at New Atlanta is to make sure that CFML is one of those dynamic languages.

So what did we accomplish in three days? First, we modified the IronPython interactive command-line shell to support a small subset of CFML--just the CFSET and CFOUTPUT tags so far. Here's some sample output (the ">>>" characters are the command-line prompt):

This may not look very exciting, but let me explain what's going on here. This isn't a toy example; the CFML parsing is being done by the BlueDragon.NET parser--the very same one in the currently shipping BlueDragon.NET 7.0 product. And, the CFML is not being interpreted--every line is being compiled on-the-fly (dynamically) by the DLR into .NET Intermediate Language (IL) byte code and executed by the .NET runtime.

What we're demonstrating here is the ability to hook up the BlueDragon.NET CFML parsing front-end with the DLR code generation back-end to produce a much tighter integration between CFML and the .NET runtime than what's currently provided by BlueDragon.NET. We're not very many steps away from being able to create a Windows console application that looks like this:

<cfcomponent name="Hello">
    <cffunction name="Main">
        <cfset text="Hello, world!">
        <cfoutput>#text#</cfoutput>
    </cffunction>
</cfcomponent>

The idea is that you'll be able to compile the above code into a Windows executable ("Hello.exe") and run it. The result would be exactly equivalent to the following C# code:

using System;

class Hello { static void Main() { string text = "Hello, world!"; Console.WriteLine( text ); } }

Add to this the ability to create and invoke .NET objects via CreateObject/CFOBJECT, and you can easily imagine how it'll be possible to create desktop applications in CFML using .NET-based Windows Forms (WinForms). You'll also be able to use CFML to create ASP.NET web applications, and be able to run CFML within Silverlight. Again, this is the goal of Microsoft's strategy: to be able to use the same programming languages, tools, and technologies to create any type of application.

What about tools support? By integrating CFML with the DLR, we were also able to demonstrate step debugging within Visual Studio. Here's a screenshot of setting a breakpoint on a CFSET tag:

Not bad for three days work! (OK, we cheated--the step debugging was finished on the plane ride home yesterday).

We're very excited by the possibilites and promise of a DLR-based implementation of BlueDragon (which, you may notice from the screenshots, we're calling "IronDragon"). CFML will no longer be just about creating HTML-based web applications--though it'll still be great for that, of course--and will be supported as a first-class citizen by Microsoft development tools.

Among other topics, I'm going to talk more about IronDragon and provide additional demonstrations during my keynote presentation at CFUNITED-07. I'm also going to be available at our booth to talk about this in more detail, so please stop by and see me if you're interested in learning more.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Vince,

This is pretty cool. The idea of having a CFML based exe is exciting. However, SilverLight is Windows only, so we're going back to the single vendor and we all know our customers won't like that. We can't tell our customers, "Just buy a Windows PC!"

http://www.microsoft.com/silverlight/system-requir...

Or does Microsoft have plans to port this to Mac and Linux?
# Posted By Jake Munson | 5/25/2007 4:14 PM
@Jake, Silverlight already runs as a browser plugin on Mac OS X (although my own experience was less than stellar - others have had more success). I have no idea about Linux but the Mono crowd have plans to get Silverlight running on Mono so who knows?
# Posted By Sean Corfield | 5/25/2007 4:44 PM
Hi Jake,

Silverlight is *not* Windows only! It currently runs on Mac OS X (Intel only, not PPC), and is supported in Firefox and Safari, as well as IE. Support for Opera is under development.

Miguel de Icaza, the creator of Mono--an implementation of .NET for Linux--has publicly stated plans to support Silverlight on Linux by the end of this year. He was at the same event at Microsoft this past week and I had a brief chat with him about Silverlight on Linux. He was very positive about this and even showed me a brief demo of some of the key pieces already running.

Here's a link to his blog about the Microsoft compiler lab this week (his mention of the "ColdFussion compiler" is about our work on IronDragon):

http://tirania.org/blog/archive/2007/May-23.html
# Posted By vinceb | 5/25/2007 4:46 PM
P.S. Yes, we're looking forward to being able to support IronDragon/CFML on Linux via Mono for all application domains: desktop, HTML-based web, and RIA (via Silverlight).
# Posted By vinceb | 5/25/2007 4:50 PM
Very intriguing indeed.

Is there any chance that your keynote will be webcast live from CFUNITED this year? ( For those of us that can't make it )
# Posted By Jeff Houser | 5/25/2007 7:37 PM
Exciting stuff! Have you had a chance to get a quick sense of what will/will not be possible? Do you expect to see any problems implementing mixins (class or object based) or doing things like dynamically evaluating class and method names? Will there be any additional type checking restrictions? I know these are the classes of problems the DLR was designed to solve, but I've not come across any really detailed info on the DLR API or the exact features it provides for dynamic language providers.

Please keep us all posted. I'm not in love with Silverlight, but I think having a version of CFML as a DLR language would be a very interesting thing to see.
# Posted By Peter Bell | 5/26/2007 7:50 AM
Vince- That's very exciting stuff and good to see. I've often wondered what it might be like to program Windows apps in CF (and now it looks like I'll get a chance to try it sometime).
# Posted By Sammy Larbi | 5/26/2007 8:25 AM
Vince,

This is awesome as it'd be damn cool to write CFML inside Silverlight or a subset of it at the very least.

Looking forward to seeing more and sorry we didn't catchup at MIX07 :(

-
Scott Barnes
Developer Evangelist
Microsoft.
# Posted By Scott Barnes | 5/26/2007 11:44 PM
Wow! I'm using CFMX and not BD, but this news is really interesting because we could leverage our cfml knowledge in other domains too.
But, when we could use Visual Studio for cfml applications? CFML developers need an IDE. An addins for Visual Studio would be really cool.
# Posted By Fabio Serra | 5/27/2007 5:54 PM
@Jeff: I don't have any control over webcasts of CFUNITED keynotes--you'll have to pose that question to TeraTech. In any case, I'll post regular updates to my blog about IronDragon and related topics.

@Peter: at this point it doesn't look like there will be any limitations to implementing existing CFML via the DLR. All the dynamic stuff you know and love will be possible, and will almost certainly perform much, much better than anything implemented on a Java VM (BlueDragon.NET already outperforms any JVM-based CFML implementation, so you can imagine what tighter integration with the DLR/CLR will provide). In addition, there are many new features that will be possible via the DLR. Stay tuned.

I'm not sure why you're "not in love with Silverlight." Put aside the Flash-like media capabilities for a moment, and just focus on the embedded CLR as a replacement for the browser's JavaScript engine. The CLR performs better, plus gives you end-to-end step debugging capabilities (Microsoft has even demonstrated the ability within Visual Studio to step from server-side code into client code running in a browser on the Mac!). Imagine being able to write and debug AJAX-style applications using CFML running in the browser--that's what I find cool about Silverlight.

@Scott: maybe next year I'll leave my wife at home, which will open up my evenings for more "networking." ;-)

@Fabio: we're not ready to make any announcements yet about a Visual Studio plug-in for BlueDragon/CFML. I'd say probably not before the end of 2007, but you never know. Some of the stuff Microsoft is doing is making it incredibly easy for us to build on top of, and we're just starting to learn about and experiment with these new APIs. Keep an eye on my blog for future announcements.
# Posted By vinceb | 5/31/2007 3:28 PM
How is IronDragon coming along, Vince?
Keep me posted, it sounds exciting.
# Posted By Nicolas | 1/15/2008 9:39 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.001. Contact Blog Owner

company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine