That is no longer accurate. G-WAN now supports C, Java, C++, D, and Objective C out of the box. [1] I am the someone who is implementing FastCGI support.
That is no longer accurate. G-WAN now supports C, Java, C++, D, and Objective C out of the box. [1] I am the someone who is implementing FastCGI support.
Second reaction: am I actually supposed to take seriously something that looks like that Java sample? 'Cause, er, I know a teeeeeensy bit about Java, and my first reaction was "what kind of moron would write Java like that?". Java isn't C, and this guy's bizarre worship of "programming to the metal" (it's a web architecture for god's sake!) makes no sense there.
It does not look like it's running in a normal JRE, which makes me really skeptical of the sibling post claiming that "you can write Java however you want". (If it was running in a normal JRE, a ton of the stuff in loan.java makes little sense...)
I'm not exactly sure how his claims of instant refreshing "scripts" works if it's a conventional JDK, though. I mean, that's just not possible, even with hot reloading (as Play Framework developers have learned to their disappointment).
On the other hand, I have written a few web applications in C. It's not that bad! :) The nice thing about it is that if you link statically, write CGI programs, and ignore memory management (or, rather, malloc all you care to and delegate garbage collection to the OS when your process goes away), you can get something that runs quickly with minimal hassle on a small device. I don't recommend it unless you have some bizarre constraints, but it's really not that bad! That approach doesn't seem possible with this server, sadly.
At that point the amount I trust 99.9% of C and C++ programmers to not screw the pooch (between dealing with HTTP requests, database interaction, string templating...) trends very close to zero. What you describe might be workable in the small, but at that point you might as well fling up Apache and mod_php. It'll probably be faster.
I think, though, that the database interacting, templating, etc., are things that you will very nearly always do in PHP because they're there. File-backed storage (if any storage is even needed) is more than adequate for most cases where one might write a CGI program in C. The last time I had occasion to write something from scratch and target CGI, I was generating graphs. No templating, no database, very fast.
The major pain of templating lies in C's string handling, though, and if you aren't worrying about freeing memory, there's not much pain. As far as HTTP goes, if the protocol was designed to be parsed in C, it's not often difficult to parse in C. But for all of those things, there's a library.
I can't comment specifically about whether or not mod_php would be faster (since I used PHP only briefly and several years ago) but I suspect very strongly that the overhead of firing up a small, statically linked C program beats it.
As I said previously, I don't think it's usually a good idea, but it's a more than viable tool and nice to keep in the box.
The author in a forum post did say that he doesn't think that FCGI is the right way to go and suggested asking Zend to build a C library for GWAN that could run PHP code [1]. I find that unlikely unless GWAN really starts getting a large following.
[1] http://forum.gwan.com/index.php?p=/discussion/comment/3801/#...
See [1] for reasons why PHP+FastCGI is a poor choice in 2012.
JavaScript, Lua, and Python can be linked directly with the server for performance you would not get via separate processes.
I had more difficulty with Go, which you can read about on the forum.[1]
They all work, but are just proofs of concept at the moment. G-WAN makes it easy to link with any C library, so it is not hard to use languages that expose a C API such as those listed. It is just a matter of writing a more complete handler.
[1]http://forum.gwan.com/index.php?p=/discussion/463/writing-g-...