Hum...
It seems that I am a bit late in this discussion -but I just discovered it now.
And I am grateful to all of you for so much input.
I am G-WAN's author, which makes it clear that I have seriously worked on the matter: G-WAN is both faster than all other Web servers (no processing) AND all other Web App. servers (any processing you can imagine).
Yes, ANSI C also made it possible to process more static content - with less powerful CPUs (ANSI C is not only about making dynamic contents fly).
By the way, G-WAN uses C scripts (no C compiler and linker needed) so the compiling/linking cycle/delay does not exist.
In the process of comparing G-WAN to .Net Java and PHP, I wrote SIMILAR Web applications in all 4 languages:
http://gwan.ch/source/
And, to my dismay, the modern scripting languages were NOT easier to use.
One part of the job which is especially frustrating is to DESPERATELY SEARCH for the 'magic' API call that will do what you want to do.
Think about how to do 'pretty thousands' in:
C# String.Format("{0:n}"...
Java DecimalFormat("0.00"); ...
PHP number_format($amount, 2); ...
ANSI C snprintf("%'.2f", amount);
The "..." mean that some pre-configuration -or post processing- is necessary.
ANSI C is clearly easier to use (and to remember).
When PHP has more than 5900 API calls (C# and Java not far away), finding the RIGHT API call is a challenge on its own.
The time wasted to find this (and then to find how badly the NATIVE API call is implemented), the time to learn by hart it for the next time you need it, all this time is depriving you from the time necessary to resolve your application problems.
I have read (above) that PHP is more concise than ANSI C?
Why then use "//:: this is a comment ::" rather than "// this is a comment"?
Why have a so stupidly complex 'pretty thousands' syntax?
The other usual argument is that Java and the like provide dedicated calls for Web applications.
I was not able to find anything to escape HTML in Java so I wrote my version of it:
// all litteral strings provided by a client must be escaped this way
// if you inject them into an HTML page
//public static String escape_html(String Name)
{
int len = Name.length();
StringBuffer sb = new StringBuffer(len);
boolean lastWasBlankChar = false;
int c;
for(int i=0; i<len; i++)
{
c = Name.charAt(i);
if(c == ' ') sb.append(" "); else
if(c == '"') sb.append("""); else
if(c == '&') sb.append("&"); else
if(c == '<') sb.append("<"); else
if(c == '>') sb.append(">"); else
if(c == '\n') sb.append("<br/>");
else
{
c = c&0xffff; // unicode
if(c < 32 || c > 127)
{
sb.append("&#");
sb.append(new Integer(c).toString());
sb.append(';');
}
else
sb.append(c);
}
}
//return sb.toString();
szName = sb.toString();
}
Do you really believe that the same code in ANSI C would be more complex?
No, it would be both immensely simpler AND faster.
Java (derived from C) is REQUIRING programmers to link multi-line strings with a '+'
C# (derived from C) is REQUIRING programmers to link multi-line strings with a '+'
PHP (derived from C) is REQUIRING programmers to link multi-line strings with a '.'
ANSI C does not have this now completely stupid (obsolete) requirement.
So, were is the so obvious progress claimed by the modern languages?
I am still looking for it.
Sincerely,
Pierre.