Refreshing ASP.NET Dynamic Language Support

This afternoon we released a refresh of our DLR/IronPython support for ASP.NET, now called “ASP.NET Dynamic Language Support”, on our CodePlex site.

This was originally part of our July 2007 ASP.NET Futures package, along with several other features. As updates to these features were made available, we would have liked to remove them from the package, but we wanted to wait till everything within the package was updated.

Well that time has come. This CodePlex release contains two exceedingly simple sample applications, one for WebForms and one for ASP.NET MVC. It’s compiled against the latest DLR assemblies, and our goal is to continue to push it forward fixing bugs here and there. Keep in mind that this initial refresh is pretty barebones and doesn’t contain everything that the original package contained because certain features (such as the project system) are still being updated.

I won’t go too deeply into the specifics of how to use it. Instead, be sure to check out David Ebbo’s whitepaper on IronPython and ASP.NET which was written a while ago, but still mostly relevant. Also, Jimmy Schementi from the DLR team has written a nice brief write-up on this release.

I have the pleasure of taking over as the PM for this feature (in MS parlance we’d say I “own” this feature now) which nicely complements my duties as the PM for ASP.NET MVC. If you’ve followed my blog, you know I have an interest in dynamic languages and now I can channel that interest into work time, rather than on my own time. :)

This initial release only has IronPython support, but IronRuby support will be coming soon. This gives me an opportunity to learn a bit about Python, and let me tell you, the fact that whitespace matters in this language can be nice within a normal code file, but a real pain within a view.

One nice thing about this implementation above and beyond my old IronRuby prototype is that it has true support for a Global.py file, the IronPython equivalent for Global.asax.cs. This allowed me to define my routes in IronPython directly in that file rather than reading in a separate file. I did implement some helper methods in C# that make it easy to define routes using a Python dictionary.

What others have said

Requesting Gravatar... David Novakovic Sep 23, 2008 6:52 PM
# re: Refreshing ASP.NET Dynamic Language Support
I rather like the mako way of doing templates (makotemplates.org) Something that is nice and pythonic, but also makes the "block" problem a non-issue :)

Mako now runs on GAE, so I'm guessing there must be a pure python impl, which is good news for using it in your asp.net mvc project :)
Requesting Gravatar... SoftMind Sep 24, 2008 2:27 AM
# re: Refreshing ASP.NET Dynamic Language Support
I just downloaded the MVC code. Unfortunately it
shows just IronPython working in Views, No Controllers or Models can be seen. It seems they are missing..

Any chances of getting uploaded again....?

Please Do not forget to upload the same code with IronRuby in future.
Requesting Gravatar... haacked Sep 24, 2008 9:16 AM
# re: Refreshing ASP.NET Dynamic Language Support
@SoftMind Yep, the release is focused on the ASP.NET runtime. Using IronPython and IronRuby in the controllers and models will be coming in the future. Be sure to check out the Roadmap for more details.
Requesting Gravatar... Scott Sep 24, 2008 11:37 AM
# re: Refreshing ASP.NET Dynamic Language Support
IronJavaScript support?
Requesting Gravatar... Ophir Kra-Oz Sep 24, 2008 11:58 AM
# re: Refreshing ASP.NET Dynamic Language Support
Good news.
Should allow clever tricks in the UI world as well.
Requesting Gravatar... Simon Davy Sep 25, 2008 1:12 AM
# re: Refreshing ASP.NET Dynamic Language Support
Regards MVC integration:

OK, great and all, but only support for views, not controllers or models? Way to get it backwards.

Views schmiews, I can plugin whatever I want for that already - I want to my *code* in python, not my html (although if I could get Genshi working as a ViewEngine in MVC that would be simply be awesome)

That being said, this is good news, I'm just sad to have to wait till Q1 2009 before MVC on ironpython becomes doable. I think that by then Django or NWSGI+whatever on ironpython will be much stronger choice than MVC (which, even though I use it everyday, is still playing catchup, IMHO).
Requesting Gravatar... Andrew Csontos Sep 25, 2008 7:59 AM
# re: Refreshing ASP.NET Dynamic Language Support
Phil,

When we hear about dynamic languages, IronPython and IronRuby seem to get the most love (or at least the most discussion).

What about Managed JScript?

We haven't heard much about Managed JScript since the May 2007 ASP.NET Futures.

Our team is a huge fan of JScript and have been using it for the past 10 years since the days of WScript files and Classic ASP (and of course inside the browser).

Ever since May 2007 we've been DYING to use it in ASP.NET -- specifically with ASP.NET MVC, and also want to use it for ASP.NET MVC unit tests and batch jobs too.

Do you have a plan for Managed JScript that you can share?

Many Thanks!
Requesting Gravatar... Rob Oct 07, 2008 12:06 PM
# re: Refreshing ASP.NET Dynamic Language Support
Phil,

I have to agree with Andrew. I'd *love* to see Managed JScript, and not only in ASP.NET but as part of the Desktop DLR (which I have an ideal application for). I can't wait to see its release - maybe .NET 4.0???

Thanks!!
Requesting Gravatar... Chris Pietschmann Oct 13, 2008 6:00 PM
# re: Refreshing ASP.NET Dynamic Language Support
Is the DLR coming in .NET 4.0?? I would really love to program in JavaScript on the Desktop while utilizing the .NET Framework!
Requesting Gravatar... Jon Udell Nov 03, 2008 7:19 PM
# re: Refreshing ASP.NET Dynamic Language Support
What's the scoop on using this with Azure?
Requesting Gravatar... haacked Nov 04, 2008 1:32 PM
# re: Refreshing ASP.NET Dynamic Language Support
@Jon Udell we're working on getting ASP.NET MVC working with Azure right now. We have it working with the development fabric, but haven't tested it in the actual cloud. Once we do that, dynamic languages with ASP.NET should in theory just work. We'll test it out of course. :)
Requesting Gravatar... Chris Vickerson Nov 05, 2008 11:30 AM
# re: Refreshing ASP.NET Dynamic Language Support
I've been search google high and low for guidance on how to use IronPython with tight integration into .net libraries. The one large snag I keep seeing over and over is not being able to use Attributes (System.Attribute) which would prevent key functionality from being specified/injected. Can anyone tell show me if there is a way to get around this. Even a link would be helpful.

Thanks

What do you have to say?

(will show your gravatar)
Please add 7 and 7 and type the answer here: