www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Web development howto?

reply Jaime Barciela <jbarciela gmail.com> writes:
Hello everyone,

I'm going though TDPL and I just joined this list.

I've been looking for guidance on how to do web applications in D but
I haven't found anything.

My background is not C/C++ but Java (and Delphi many years ago) so I
have not only a new language but a new culture to get used to as well.

Could somebody give me some pointers?

Thanks
Jaime
Apr 21 2011
next sibling parent Robert Clipsham <robert octarineparrot.com> writes:
On 22/04/2011 03:53, Jaime Barciela wrote:
 Hello everyone,

 I'm going though TDPL and I just joined this list.

 I've been looking for guidance on how to do web applications in D but
 I haven't found anything.

 My background is not C/C++ but Java (and Delphi many years ago) so I
 have not only a new language but a new culture to get used to as well.

 Could somebody give me some pointers?

 Thanks
 Jaime

The simplest way to make a web application with D is to use CGI/FastCGI etc. There are also at least two frameworks in development (that I know of), one is significantly more developed. http://arsdnet.net/dcode/ - see web.d, cgi.d etc, this is the most mature (that I know of). https://github.com/mrmonday/serenity - One I'm working on. It's due to undergo significant changes and is lacking a lot of basic functionality, so I'd avoid it, for now at least. -- Robert http://octarineparrot.com/
Apr 22 2011
prev sibling next sibling parent Jaime Barciela <jbarciela gmail.com> writes:
Robert,

I think your effort is much needed. Thank you -- from a fellow Brown Coat :)

I was toying with the idea of writing a handler for Mongrel2 in D. But
I'm a D n00b, it may take me a while. If anybody wants to pick that
idea up and make it a reality that would be great.

In fact it will be a big reason for people to get into D in general.

I'll take a look at (Fast)CGI and arsdnet.net.

Thanks
Jaime


On Fri, Apr 22, 2011 at 3:27 AM, Robert Clipsham
<robert octarineparrot.com> wrote:
 On 22/04/2011 03:53, Jaime Barciela wrote:
 Hello everyone,

 I'm going though TDPL and I just joined this list.

 I've been looking for guidance on how to do web applications in D but
 I haven't found anything.

 My background is not C/C++ but Java (and Delphi many years ago) so I
 have not only a new language but a new culture to get used to as well.

 Could somebody give me some pointers?

 Thanks
 Jaime

The simplest way to make a web application with D is to use CGI/FastCGI etc. There are also at least two frameworks in development (that I know of), one is significantly more developed. http://arsdnet.net/dcode/ - see web.d, cgi.d etc, this is the most mature (that I know of). https://github.com/mrmonday/serenity - One I'm working on. It's due to undergo significant changes and is lacking a lot of basic functionality, so I'd avoid it, for now at least. -- Robert http://octarineparrot.com/

Apr 25 2011
prev sibling parent Jaime Barciela <jbarciela gmail.com> writes:
With the disclaimer that I haven't use it myself, only read *some* of
the docs, here is my (surely terrible) take at explaining the beast.

Mongrel2 is a neat idea based on 2 other projects:

 - 0mq ( http://www.zeromq.org/ ) which is an async communication
library that feels like sockets but behaves like a message queue. By
iMatix.
 - the original Mongrel http parser (
http://en.wikipedia.org/wiki/Mongrel_(web_server) ). Also by Zed Shaw.

The idea is that you have "handlers" that work on requests in an async
way. They are processes outside the web server and you can have as
many as you need anywhere in the network and can create and destroy
them as needed without disturbing the web server. This is similar to
FastCGI except you also get non-blocking I/O and a Publish/Subscribe
model for your application.

The really neat part of this is that if you look at it from the server
side looking out towards the browsers Mongrel2 essentially allows you
to include web browsers in a 0mq topology. A really nice trick.

0mq is a c library and there is a D binding for it:
https://github.com/itiu/zeromq-connector

But I haven't found a D handler for Mongrel2.


About ripping a FastCGI wrapper out of Serenity: Yes, I mean that is
actually general enough that you can make it a separate project and
use it yourself in Serenity. That would be great, not only for me but
for many newcomers like me as well.


Jaime

On Mon, Apr 25, 2011 at 1:42 PM, Robert Clipsham
<robert octarineparrot.com> wrote:
 On 25/04/2011 16:56, Jaime Barciela wrote:
 Robert,

 I think your effort is much needed. Thank you -- from a fellow Brown Coat
 :)

I just hope Captain Shiny Pants doesn't find out, I don't fancy my chances against him in a fight if he realizes I stole his ship's name ;P
 I was toying with the idea of writing a handler for Mongrel2 in D. But
 I'm a D n00b, it may take me a while. If anybody wants to pick that
 idea up and make it a reality that would be great.

I'm not entirely sure what it is after 10 minutes of clicking my way around its site - looks interesting, whatever it is (I hate sites like that!)
 In fact it will be a big reason for people to get into D in general.

 I'll take a look at (Fast)CGI and arsdnet.net.

If you want a quick and easy FastCGI wrapper, I can rip it out of Serenity for you without too much effort, save you reinventing the wheel. Not sure if the arsdnet code has a FastCGI wrapper, may just be CGI.
 Thanks
 Jaime

-- Robert http://octarineparrot.com/

Apr 25 2011