views:

294

answers:

5

ASP is a Compiled Language or isnt it? sure it is. PHP is a Interpreted Language. I also developed once an asp app with the VS 2008 IDE. But there is a Big difference between ASP and PHP. What are the Differences?

+1  A: 

I have noticed when trying to add hosting on GoDaddy.com, PHP is for a Linux package and ASP was for Windows package.

Anthony Forloney
I think apache supports also asp or does is not?
streetparade
PHP is completely supported on windows systems. And Sun had created a 'port' of ASP for unix systems
Gaby
the base web server Apache package does not support ASP, but there a number of projects that do: http://httpd.apache.org/docs/1.3/misc/FAQ.html#asp
Anthony Forloney
A: 

ASP is a proprietary, closed-source implementation, PHP is not.

AJ
+2  A: 

ASP is interpreted ASP.NET is compiled. ASP is not a language but a framework, you can code ASP.NET in a bunch of languages. ASP.NET runs only on IIS (unless you use Mono and who remembers Chilisoft ASP here?)

SQLMenace
Yes thats true in VS 2008 i could code it in visual basic and in C# that was realy something i couldnt understand
streetparade
You can also use IronPython and IronRuby with the DLR
SQLMenace
+1  A: 

You could be more specific with your question.

The biggest difference is of course that ASP is programmed in a .NET language and uses the .NET framework as a basis. PHP of course is programmed in PHP and with it's library.

.NET is compiled into bytecode and that bytecode is interpretted/jitted at runtime. There are also bytecode caches for PHP (e.g. APC) and there is an active project that aims to generate native code from it using LLVM.

Axel Gneiting
PHP is written i C or isnt it?
streetparade
Yes, PHP is written in C.
David Grant
I meant that PHP applications are programmed in PHP. I'm sorry for the confusion. The PHP interpreter itself is of course written in C.
Axel Gneiting
That's not true. The Phalanger PHP implementation is written in C#, the Quercus and P8 PHP implementations are written in Java and Pipp is largely written in PIR, with some bits of NQP and PGE and only trace amounts of C. Only a small minority of PHP implementations are actually implemented in C.
Jörg W Mittag
Yet that single PHP implementation is used by approximately 99% of all PHP webservers ;-)
Axel Gneiting
+3  A: 

ASP is a Compiled Language or isnt it? sure it is.

No, it isn't.

The first reason why ASP is not a compiled language is because there is no such thing as a compiled language. A language is neither compiled nor interpreted. A language just is. A language is a bunch of abstract mathematical rules. Interpretation or Compilation are traits of a language implementation, they have nothing to do with the language. Every language can be implemented by either a compiler or an interpreter; most modern high-performance language implementations actually use both and switch between them depending on which one is faster in a particular context.

The second reason why ASP is not a compiled language is because it is not a language. It is a framework. You can write code for ASP in any language for which an ActiveScripting engine exists (e.g. Ruby via ActiveRuby), but most commonly one would write code in either VBScript or JScript.

Which brings us to the third reason: The implementations of VBScript and JScript that ship with Windows, as well as ActiveRuby and all other ActiveScripting engines that I know of, are pure interpreters, they cannot compile. So, even though I wrote above that any language can be implemented using either a compiler or an interpreter, all the language execution engines that are supported by ASP are interpreted.

PHP is a Interpreted Language.

Again: no, it isn't.

Reason one is the same as above: there simply is no such thing as an interpreted language.

And, in contrast to ASP, the vast majority of PHP implementations actually do contain a compiler. Some even are pure compilers, they don't even have an interpreter. (Phalanger, for example always compiles straight to CIL, with no interpretation whatsoever. P8 can either interpret or compile straight to JVM bytecode or both: interpret, gather profile data while interpreting and then JIT-compile to JVM bytecode.)

But there is a Big difference between ASP and PHP. What are the Differences?

ASP is a (language-independent) framework, PHP is a language. That's a rather big difference. (Actually, PHP contains one small bit that would in other languages usually considered to be part of a web framework: webserver integration.)

PHP is highly portable across operating systems, CPU architectures and webservers: there is a PHP implementation for nearly every execution environment, from the JVM to the CLI to Parrot to running natively on pretty much every operating system under the sun. ASP is pretty tightly bound to Microsoft Internet Information Server, Microsoft Windows and the PC platform. (There were some other implementations but they are pretty obscure and no longer available.)

PHP has lots of different implementations (Phalanger, Quercus, Pipp, PHC, P8, Zend), ASP has only one. (Like I said, the two other ones are no longer available.)

The vast majority of PHP implementations are Open Source (I think the only exception is P8), while all three ASP implementations that I know of are proprietary.

PHP is actively developed and maintained, whereas ASP is largely obsolete and has been superseded by ASP.NET.

Jörg W Mittag