BT

IronPython for ASP.NET

by Jonathan Allen on Nov 02, 2006 |

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.

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

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT