Uploaded ASP Classic Compiler Build 0.5.3.32871 with support for Windows Azure, variable initializer and extension operator

by lichen 10/25/2009 5:43:00 PM

Today, I have uploaded change Set 30945, version 0.5.3.32871, built with DLR Changeset 32871. It could be downloaded from the source tab of http://www.dotneteer.com/aspclassiccompiler. The following are a summary of changes:

  1. Now ASP Classic Compiler would run under medium trust or Windows Azure partial-trust. Partial-trust is the default trust level of Windows Azure. Windows Azure does not support asp classic. Windows Azure supprots php but requires full-trust. Asp Classic Compiler is the only way to run asp page on Azure without changing the trust level.
  2. Azure sample uploaded. We modified only one view /home/index.asp but that is enough to prove the concept.
  3. Variable initialization in declaration statement as a VBScript extension. For example: dim s = new system.text.stringbuilder()
  4. Add the operator overloading through extension methods. C# supports extension methods, but not "extension operators". We added this support so that we can add new behavior without the need to modify our binders. Some typical asp code would now run much faster by a simple change. For example, asp pages often have codes like:
<%    
dim s    
dim i        
s = "<table>"    
for i = 1 to 12
s = s + "<tr>"
s = s + "<td>" + i + "</td>"
s = s + "<td>" + MonthName(i) + "</td>"
s = s + "</tr>"
next    
s = s + "</table>"    
response.Write(s)
%>

This code is slow because the runtime kept creating new string and discard the one one. Now we just need a simple change:
<%    
imports system    
dim s = new system.text.stringbuilder()    
dim i        
s = s + "<table>"    
for i = 1 to 12
s = s + "<tr>"
s = s + "<td>" + i + "</td>"
s = s + "<td>" + MonthName(i) + "</td>"
s = s + "</tr>"    
next    
s = s + "</table>"    
response.Write(s)
%>
Note that we added "+" operator as an extension operator for the class System.Text.StringBuilder. 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

ASP.NET

Related posts

Comments are closed

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2010

      Sign in