InfoQ

News

IronPython for ASP.NET

Posted by Jonathan Allen on Nov 02, 2006 05:18 PM

Community
.NET
Topics
Web Frameworks
Tags
IronPython ,
ASP.NET

Microsoft has released an extension that allows IronPython to be used with ASP.NET. More importantly, they have created a route for other dynamic languages to tie into the ASP.Net framework.

According to David Ebbo of Microsoft, the primary reason why dynamic languages such as IronPython couldn't be used with ASP.Net is that they don't support static typing. ASP.Net relies heavily on CodeDOM, which assumes "that any language used for ASP.NET has the ability to produce true classes in the .NET Framework sense—that is, classes that are in on-disk assemblies and that can be loaded using standard APIs like Type.GetType." This means that any dynamic language that wanted to support ASP.NET would have to be extended.

Microsoft solved this problem by turning off page compiling and using a custom PageParserFilter. This routes some of the python code through a new base class called ScriptPage and the rest through controls. A similar mechanism is used for user controls and master pages. And because the pages don't need to be compiled, the usual first-time hit will be significantly less.

A variant of the application file is supported, as well as an App_Script directory (replaces App_Code, and HTTP handlers. Web services are not supported, as they require language features not available in most dynamic languages.

Currently ASP.NET doesn't scale well when too many unique pages are created. The cost to compile, load, and manage all of the page specific assemblies can seriously stress the server. Since dynamic pages eliminating the need to create an assembly for each page, there is no theoretical limit on the number of unique pages.

Runtime performance is expected to be nearly the same as C#. While late-bound code is slower, most of the processing time is spent in the framework code rather than the user code.

No comments

Watch Thread Reply

Educational Content

Bindings, Platforms, and Innovation

This presentation focuses on the Internet and separating myth from fact, history from the future, and the mundane from the imaginative. Bob Frankston presents a vision of what could and should be.

Orchestrating Long Running Activities with JBoss / JBPM

This article explores the use of JBoss and jBPM to implement design solutions that effectively address the issue of orchestrating long running activities.

Neo4j - The Benefits of Graph Databases

This presentation covers the use of graph databases as an optimal solution for data that is difficult to fit in static tables, rapidly evolving data or data that has a lot of optional attributes.

Realistic about Risk: Software development with Real Options

This session introduces Real Options and shows how it can help in running your project. Real Options is a decision-making process that can be used to manage risk.

Communication Flexibility Using Bindings

This article discusses the use of bindings on services and references (including the instance of non-configured bindings) as the means to implement SCA communications in a Web and SOA environment.

Writing DSLs in Groovy

After a short introduction to DSLs, Scott Davis plays with the keyboard showing how to approach the creation of a DSL by typing working snippets of Groovy code that get executed.

Scaling Agile with C/ALM (Collaborative Application Lifecycle Management)

IBM Rational and InfoQ present, Scaling Agile with C/ALM, an eBook showing organizations how to become “finely tuned software delivery machines” by enabling team integration and scaling.

Concurrent Programming with Microsoft F#

Amanda Laucher presents a real life enterprise application written in F#. She shows actual code snippets, explaining design decisions and suggesting how to use some of the F# constructs.