views:

103

answers:

5

I've heard of ASP.NET compiled DLLs which only works on Windows Server, but I would like to know if there are any other compiled server side languages?, maybe even ones for Apache server?

Installation of the runtime shouldn't be a problem because I will have physical access to the Unix/Windows servers, but if it is a CGI plugin its an added benefit since I can install it using only FTP.

A: 

PHP is compiled at runtime similar to ASP.NET. Or if you want to take the extra step you can use a PHP compiler to pre-compile your PHP (also a capability of ASP.NET).

PHP is not as pleasant to work with as ASP.NET in my opinion, but if I were restricted to Linux it would probably be my choice for its speed, overall popularity and support.

Steve Wortham
ASP.NET can be precompiled
TheTXI
Why the downvotes?
Steve Wortham
PHP is not a compiled language. It is known as a scripting language, I thought my question would make that obvious.
Jenko
OK. You might want to change the question a bit. I think of it as a compiled language because the PHP engine does indeed compile the code on first-run just like ASP.NET. So it's fast, very fast. You can compare this with some of the incredibly slow interpreted languages like Ruby.
Steve Wortham
By the way, I'm no expert on PHP. But you can pre-compile PHP code. It's an extra step but there are many PHP compilers out there to choose from if you so desire.
Steve Wortham
Excellent points. Thank you for taking the time to clarify!
Jenko
No problem. It looks like I'm getting downvotes again though. Seems this is an unpopular answer for some unknown reason - ha.
Steve Wortham
+2  A: 

Java would be at the head of the list of compiled languages for use with Apache - especially when you get away from Windows.

Also, you can use ASP.NET on non-Windows platforms with Mono.

Joe Erickson
+2  A: 

You can run ASP.NET using Mono and it's mod_mono for Apache

abatishchev
A: 

JSP with Tomcat

Gregoire
+1  A: 

The term "compiled language" doesn't make any sense. A language isn't compiled. A language isn't interpreted. A language just is.

Whether a particular implementation uses a compiler or an interpreter is a trait of the implementation and has nothing to do with the language. Indeed, every language can be implemented with either an interpreter or a compiler. In fact, the vast majority of modern language implementations (CPython, Perl, PHP, YARV, IronRuby, HotSpot, Mono, CLR, TraceMonkey and so on) use both an interpreter and a compiler. HotSpot for example constantly switches between compiler and interpreter depending on which is faster.

So, to answer your question: every language that can access environment variables, read text from stdin and write text to stdout can be used with CGI and thus Apache (and indeed pretty much every webserver on the planet). And every language can be compiled. Therefore, every language can be used in the way you describe.

Jörg W Mittag