Refreshing ASP.NET Dynamic Language Support

asp.net, dlr 0 comments suggest edit

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.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

13 responses

  1. Avatar for dpn
    dpn September 23rd, 2008

    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 :)

  2. Avatar for SoftMind
    SoftMind September 23rd, 2008

    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.

  3. Avatar for haacked
    haacked September 23rd, 2008

    @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.

  4. Avatar for Scott
    Scott September 24th, 2008

    IronJavaScript support?

  5. Avatar for Ophir Kra-Oz
    Ophir Kra-Oz September 24th, 2008

    Good news.
    Should allow clever tricks in the UI world as well.

  6. Avatar for Simon Davy
    Simon Davy September 24th, 2008

    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).

  7. Avatar for Andrew Csontos
    Andrew Csontos September 24th, 2008

    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!

  8. Avatar for Rob
    Rob October 7th, 2008

    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!!

  9. Avatar for Chris
    Chris October 13th, 2008

    Is the DLR coming in .NET 4.0?? I would really love to program in JavaScript on the Desktop while utilizing the .NET Framework!

  10. Avatar for Jon Udell
    Jon Udell November 3rd, 2008

    What's the scoop on using this with Azure?

  11. Avatar for haacked
    haacked November 4th, 2008

    @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. :)

  12. Avatar for Chris Vickerson
    Chris Vickerson November 5th, 2008

    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

  13. Avatar for sohibulhabib
    sohibulhabib January 31st, 2014

    thanks for the sharing unique one, ilove it
    my blog http://sohibulhabib.com