G-Wan Superfast Webserver for C Scripting
I unpacked the zip file and ran the 106KB exe and pow had a local web server running that appears robust, comes with a number of sample scripts and has a decent API and documentation. I ran the amortization example, showing monthly payments for my house loan over 25 years. That page took 2,736,400 cpu clock cycles to generate on my PC where 3 million = 1 ms. That's very quick! Reading the source code I notice that it uses Ajax to do the call to the C script.
For those that are skeptical about using C code in a web server, G-Wan implements dynamic buffers with a library of calls to load files from disk, do text manipulation, even find and replace strings. "Standard" scripting code such as PHP requires functions like url_encode, escape_html to deal with html or escape values. In G-Wan these functions are provided, as is high precision CPU time so you can measure how long it took to output a page to the CPU Cycle! Overall I get the feeling that it has been very well thought as a powerful yet light weight web-server.
I have one suggestion that could enhance G-Wan. Make it work with SQLite as it appears a natural fit.


Hi David,
Thank you for the review -and for your pertinent suggestion.
SQLite will be very easy to integrate with G-WAN because G-WAN will soon show examples about how to drag & drop shared libraries in a folder to import all their function calls (without writing any interface code).
The same will go with graphic libraries, scientific libraries, encryption and so on.
Developers will also be able to instantly reuse any library they have used in the past whether or not they have its source code.
G-WAN is there to make coders’ life easier.
Pierre
http://trustleap.ch/
interesting project.
it is a pitty the gentleman (Pierre) is relying
solely on a web form as means of electronic
contact and this form appears to be disfunctional.
so i’ll put my question here, he seems to read this page :]
btw. this is still the only page i have found that has
the closest thing to a review..
(just a tip for greater publicity: create a g-wan wikipedia page and put a see also link on all the other webservers..)
so the mail i tried to send to the author but getting
an error message all the time:
hi there,
a very interesting project.
it’s nice that c script can be run,
but what about using g-wan as general purpose web server? is it faster serving php sites than say nginx? do you have benchmarks for this? could you also use some other benchmarking tools than ab? like http_load and some others? thank you
I also tried to submit an email there, without success. I love the looks of this, but the only build right now is Windows. I’d love to see an OS X release.
Hello “a. nonymous”,
My email address xyz@twd-industries.com (my previous project) receives thousands of junk emails per day (after anti-SPAM filters do their job) because that’s pretty targetted text rather than just the usual crap.
I was not animated by the burning desire to expose xxxxxx@trustleap.com to the same feat (but you can just replace the ‘x’ with my first-name to reach me).
Regarding the web form, you have the source code as part of G-WAN samples. It is not dysfunctional. If your emails do not go through then this is because they are blocked (by an external player).
A couple of fans posted twice TrustLeap to Wikipedia and it was censored instantly.
Paid Web servers have no problem to be listed so the only reason why TrustLeap is rejected seems to be the fact that it is not appreciated by long-arm players…
For PHP, I explored the possibilities and, beleive me they are not pretty. So-called “FastCGI” is way too big and slow to serve the purpose it claims to fit: G-WAN would double in size by just linking with the FastCGI library.
People do not seem to realize that this is all about latency: everything must be carefully implemented to avoid bottlenecks.
Some hope for you:
The next version of G-WAN (expected for Nov. 2009) will let you use G-WAN as a socket-server (with Connection Handlers). It means that you will be able to implement an email server (IMAP, POP3, SMTP), or SSL, or an interface to anything else (like FastCGI or directly to PHP/Perl, etc.).
Connection Handlers will let you intervene:
- after accept
- after read
- before write
- after write
so G-WAN will be all yours for any project you might imagine.
Don, this release will also bring a Linux port. Solaris will follow. One requested NetBSD, and now you want Mac OS X. Hopefully, it will be easier within the Unix world than between Windows and Linux.
Benchmark tools:
I tried others than ab but as I need to compare platforms availability on Windows/Linux/Solaris/etc. is a must.
You are free to do your own test (please let me know what you got).
If you want to follow what is going on, have a look at:
http://trustleap.ch/en_timeline.html
Sincerely,
Pierre.
Pierre:
1. Contact form http://www.gwan.com/en_contact.html takes 20 seconds to respond after “Send”, and there’s no ack of failure or success. I tried three times with long and short msgs. (Firefox 3.5.5, XP SP3)
2. Wikipedia: Don’t blame “long-arm players” for “censorship” in the deletion of a G-WAN article. It’s more likely a zealous editor acting on personal bias, not some company. Spend more time editing WP articles & reading policies, and you’ll see that there are lots of reasons badly written, ad-like, or unsubstantiated articles get proposed for deletion. You haven’t been singled out – just look at http://en.wikipedia.org/wiki/Lighttpd – it’s at risk of going away because it looks like a desperate ad.
See my followup email to you…
Cheers