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.

1 comment

Reply

thks by ugr ony Posted Jul 1, 2008 5:51 AM
  1. Back to top

    thks

    Jul 1, 2008 5:51 AM by ugr ony

Exclusive Content

Agile Project Management: Lessons Learned at Google

In this presentation filmed during QCon 2007, Jeff Sutherland, the creator of Scrum, talks about his visit at Google to do an analysis of Google's first implementation of Scrum.

AtomServer – The Power of Publishing for Data Distribution

In this article, Bryon Jacob and Chris Berry introduce AtomServer, their implementation of a full-fledged Atom Store based on Apache Abdera, which is now available as open source.

An Introduction to Virtualization

It is easy to think that virtualization applies only to servers. In reality the recent resurgence of the concept is also being applied to networking, storage, and application infrastructure.

REST Anti-Patterns

In this article, Stefan Tilkov explains some of the most common anti-patterns found in applications that claim to follow a "RESTful" design and suggests ways to avoid them.

Choosing between Routing and Orchestration in an ESB

In this article, Adrien Louis and Marc Dutoo discuss the differences and relative merits of using orchestration vs. routing in a typical ESB setup, and discuss various implementation options.

Enterprise Batch Processing with Spring

Wayne Lund discusses batch processing, Spring Batch objectives and features, scenarios for usage, Spring Batch architecture, scaling, example code, failures and retrying, and the future roadmap.

User Story Estimation Techniques

Developer Jay Fields draws on his experiences as a ThoughtWorks consultant to describe effective user story estimation techniques.

Security (CAS and OpenID) with Ruby

In this talk from QCon SF 2007, Justin Gehtland explains two open solutions to distributed identity and their Rails integration components: OpenID (using ruby-openid) and CAS (using rubycas-client).