Thread overview | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
June 25, 2012 GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
For those interested in web development, GWAN is a VERY fast web server (Linux only) which allow development of dynamic pages in C, C++, Objective-C, Objective-C++, and D (since january this year) ! see http://gwan.ch/ NB: the perf benchmark on this site seems incredible, but try yourself ... I did it and I'm convinced. |
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to P. Lefevre | D.annunce newsgroup fits better :)
However I can't find any example/sdk for D pages...
Neither in tarball I see in download section.
On Monday, 25 June 2012 at 10:17:27 UTC, P. Lefevre wrote:
> For those interested in web development, GWAN is a VERY fast web server (Linux only) which allow development of dynamic pages in C, C++, Objective-C, Objective-C++, and D (since january this year) !
>
> see http://gwan.ch/
>
> NB: the perf benchmark on this site seems incredible, but try yourself ...
> I did it and I'm convinced.
|
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | There is an example at "0.0.0.0_8080/#0.0.0.0/csp/hello.d_" in the tarball. To use it, install GDC and rename "hello.d_" to "hello.d". You may have difficulties depending on the version of GDC you use. I do not recall which version is supported. I will find out and make another reply. On Monday, 25 June 2012 at 10:42:36 UTC, Andrea Fontana wrote: > D.annunce newsgroup fits better :) > > However I can't find any example/sdk for D pages... > Neither in tarball I see in download section. |
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Eric R. Schulz (ers35) | It's just an import of two extern(C) functions.
I read:
extern (C) // could anyone translate the whole gwan.h file?
{
void *get_reply(char[][]);
char *xbuf_ncat(void *, char *, uint);
}
And then:
xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - 1);
Maybe they should give a better support for D language...
On Monday, 25 June 2012 at 11:08:06 UTC, Eric R. Schulz (ers35) wrote:
> There is an example at "0.0.0.0_8080/#0.0.0.0/csp/hello.d_" in the tarball. To use it, install GDC and rename "hello.d_" to "hello.d".
>
> You may have difficulties depending on the version of GDC you use. I do not recall which version is supported. I will find out and make another reply.
>
> On Monday, 25 June 2012 at 10:42:36 UTC, Andrea Fontana wrote:
>> D.annunce newsgroup fits better :)
>>
>> However I can't find any example/sdk for D pages...
>> Neither in tarball I see in download section.
|
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | G-WAN exports a C API and D supports calling C functions. In what way could G-WAN better support D? Perhaps reading the G-WAN manual would help to explain: http://gwan.ch/archives/gwan_linux.pdf > Maybe they should give a better support for D language... |
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Eric R. Schulz (ers35) | Using C plain api it's not a good way to use D power IMHO :)
xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - 1);
Probably this example doesn't work properly.
On my machine writeln("1234".sizeof); gives "16" because of UTF-8.
So "1234".sizeof - 1 is 15.
AFAIK D strings are not null-terminated (are they?) and i guess that line of code won't work.
Encapsulate code with classes/template/etc would be a good idea.
On Monday, 25 June 2012 at 13:29:59 UTC, Eric R. Schulz (ers35) wrote:
> G-WAN exports a C API and D supports calling C functions.
>
> In what way could G-WAN better support D?
>
> Perhaps reading the G-WAN manual would help to explain: http://gwan.ch/archives/gwan_linux.pdf
>
>> Maybe they should give a better support for D language...
|
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | True. I will investigate writing a D wrapper for the C API.
> Using C plain api it's not a good way to use D power IMHO :)
> Encapsulate code with classes/template/etc would be a good idea.
|
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to P. Lefevre | I don't know much about web servers, but is it really the only web server "able to scale on multi-core CPUs"?? I've played around with Yesod/Warp and I was under the impression that it's one of the fastest. http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-language-benchmarks On Mon, Jun 25, 2012 at 5:17 AM, P. Lefevre <pascal.lefevre@yahoo.fr> wrote: > For those interested in web development, GWAN is a VERY fast web server > (Linux only) which allow development of dynamic pages in C, C++, > Objective-C, Objective-C++, and D (since january this year) ! > > see http://gwan.ch/ > > NB: the perf benchmark on this site seems incredible, but try yourself ... I did it and I'm convinced. > |
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Caligo | See [1] for details on how to run your own benchmark. It would be interesting to compare Warp and G-WAN using both of their provided benchmark tests. [1]http://forum.gwan.com/index.php?p=/discussion/525/nginx1.0.6-vs-lighttpd1.4.29-vs-g-wan2.9.30-rpscpuram On Monday, 25 June 2012 at 15:09:58 UTC, Caligo wrote: > I don't know much about web servers, but is it really the only web > server "able to scale on multi-core CPUs"?? I've played around with > Yesod/Warp and I was under the impression that it's one of the > fastest. http://www.yesodweb.com/blog/2011/03/preliminary-warp-cross-language-benchmarks |
June 25, 2012 Re: GWAN webserver allowing dynamic pages in D | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrea Fontana | On 06/25/2012 03:42 PM, Andrea Fontana wrote: > Using C plain api it's not a good way to use D power IMHO :) > > xbuf_ncat(get_reply(argv), "Hello World (D)", "Hello World (C)".sizeof - > 1); > > Probably this example doesn't work properly. > On my machine writeln("1234".sizeof); gives "16" because of UTF-8. Actually it gives 16 because sizeof gives the size of immutable(char)[]. length would give the correct length in this case. > So "1234".sizeof - 1 is 15. > > AFAIK D strings are not null-terminated (are they?) String literals are, but that does not affect their length. > and i guess that line of code won't work. > |
Copyright © 1999-2021 by the D Language Foundation