IronPython for ASP.NET

| by Jonathan Allen Follow 330 Followers on Nov 02, 2006. Estimated reading time: 1 minute |

A note to our readers: As per your request we have developed a set of features that allow you to reduce the noise, while not losing sight of anything that is important. Get email and web notifications by choosing the topics you are interested in.

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.

Rate this Article

Adoption Stage

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread


Login to InfoQ to interact with what matters most to you.

Recover your password...


Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.


More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.


Stay up-to-date

Set up your notifications and don't miss out on content that matters to you