views:

280

answers:

5

I've just finished writing a web server in C#. Its pretty basic and only serves static content like html, xml, and images at the moment. I would like to implement a dynamic language, however. I'm trying to choose between one of the following:

  • ASP.NET
  • PHP
  • Python

I'd prefer to implement PHP or Python because I am much more familiar with those, however I would like to implement whichever might be easiest. How would I go about adding this functionality to my server, and which of the three languages would be the easiest to implement?

EDIT: this is not about what language i want to do web programing in, this is about what language i want to let people who use the server program in. I would like to be able for the server to serve applications written in either asp.net, PHP or Python.

+1  A: 

ASP.NET will surely be the easiest as you can use all the built in classes. Essentially you don't need to build it, you just hook it up to the Web server (I don't know if we can count it as writing ASP.NET though ;) )

You might want to look at Cassini source code

Mehrdad Afshari
+1  A: 

Have you considered boo? It has a very configurable compiler and there are some good OSS examples out there (for example the brail view engine for Monorail & ASP.NET MVC).

A: 

Perhaps you should take a look at IronPython.

Ignacio Vazquez-Abrams
A: 

Well it would appear you are doing this as a learning experience, after all Microsoft already provides a web server for Windows (IIS).

Similary PHP has already been ported to Windows, you could use that port directly. SImilary you could use it as a "reference implimentation" and write your own implimentation of PHP for windows.

Either way, it would then permit your web server to host lots of existing applications such as Wordpress etc.

JonnyBoats
yes i know php exists for windows, but how do i get my server to serve php web pages?
The.Anti.9
"how do i get my server to serve php web pages?" You need to do exactly what IIS does, in other words when you get a request for a PHP "page" you need to spawn the php code and then send the output back to the client.To see how to do this see: http://stackoverflow.com/questions/817176/c-problem-running-shell-commands
JonnyBoats
+1  A: 

If you implement a cgi interface, you could use any kind of backend language. If you want to get fancy, you could consider looking into fastcgi.

troelskn