Re: D2 & Web-Framework

2013-07-06 Thread Martin Nowak
On 07/14/2011 12:49 PM, Robert M. Münch wrote: Hi, is there a matured framework for building the server side part of web-apps in D2? I don't need totally fancy things, session handling, dynamic content and simple output generation. http://vibed.org/

Re: D2 & Web-Framework

2013-07-04 Thread RedX
On Wednesday, 3 July 2013 at 13:05:27 UTC, Adam D. Ruppe wrote: On Wednesday, 3 July 2013 at 09:24:03 UTC, RedX wrote: is this still working on the latest git (2bfdccc)? I don't seem to be able to call anything.. I found the bug, I had a static if that was too restrictive and stopped reading

Re: D2 & Web-Framework

2013-07-03 Thread Paulo Pinto
Am 03.07.2013 12:03, schrieb Russel Winder: On Wed, 2013-07-03 at 11:39 +0200, Paulo Pinto wrote: […] On the other hand threading is everywhere. Threads (and processes) are like stacks and heaps, you know they are there but if you are manipulating them explicitly instead of as a managed resour

Re: D2 & Web-Framework

2013-07-03 Thread Dicebot
On Wednesday, 3 July 2013 at 13:31:56 UTC, Adam D. Ruppe wrote: The process pool on Linux though was dead easy and worked really well. I find it kinda interesting how threads in D seem to emulate processes too, with TLS giving you a sort of separate address space - just easier to get right as t

Re: D2 & Web-Framework

2013-07-03 Thread Adam D. Ruppe
On Wednesday, 3 July 2013 at 09:45:18 UTC, Dicebot wrote: On the other hand both creating process and thread are so much more expensive than not creating anything at all :P I recently added a process pool to cgi.d and it was both the simplest and the fastest option for the http server it has.

Re: D2 & Web-Framework

2013-07-03 Thread Adam D. Ruppe
On Wednesday, 3 July 2013 at 09:24:03 UTC, RedX wrote: is this still working on the latest git (2bfdccc)? I don't seem to be able to call anything.. I found the bug, I had a static if that was too restrictive and stopped reading the child object functions. It is fixed now on the newest githu

Re: D2 & Web-Framework

2013-07-03 Thread Russel Winder
On Wed, 2013-07-03 at 11:39 +0200, Paulo Pinto wrote: […] > On the other hand threading is everywhere. Threads (and processes) are like stacks and heaps, you know they are there but if you are manipulating them explicitly instead of as a managed resource, you need to have a very, very good reason

Re: D2 & Web-Framework

2013-07-03 Thread Dicebot
On Wednesday, 3 July 2013 at 09:39:43 UTC, Paulo Pinto wrote: On the other hand threading is everywhere. On the other hand both creating process and thread are so much more expensive than not creating anything at all :P

Re: D2 & Web-Framework

2013-07-03 Thread Paulo Pinto
On Friday, 15 July 2011 at 22:37:00 UTC, Andrei Alexandrescu wrote: On 7/15/11 4:26 PM, Adam Ruppe wrote: IMO it makes sense to use this to reduce process creation times. Process creation is a very small cost with D programs. It's nothing to worry about unless you have real world data to the

Re: D2 & Web-Framework

2013-07-03 Thread RedX
On Friday, 15 July 2011 at 01:00:51 UTC, Adam D. Ruppe wrote: Let me list some of the newer features in web.d too, added in the last couple weeks. class ApiObject; These let you expose a more object oriented interface to your stuff on the url. class User : ApiObject { this(Foo foo, str

Re: D2 & Web-Framework

2011-07-15 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ivr07p$8cq$1...@digitalmars.com... > Just a general comment... my D web stuff is spoiling me. > > Guy just asked me for a form based file uploader. With web.d: > > === > import arsd.web; > import std.file; > class SiteAdmin : ApiProvider { >override void

Re: D2 & Web-Framework

2011-07-15 Thread Adam D. Ruppe
Just a general comment... my D web stuff is spoiling me. Guy just asked me for a form based file uploader. With web.d: === import arsd.web; import std.file; class SiteAdmin : ApiProvider { override void _initialize() { cgi.requireBasicAuth("user", "pass"); } string uploadNewVideo(Cgi.Upl

Re: D2 & Web-Framework

2011-07-15 Thread Adam D. Ruppe
Andrei Alexandrescu wrote: > Doesn't that apply more to Unix than to D? Somewhat, though a lot of the CGI flames from the day were coming from unix machines. There's two factors (I speculate) that contributed to it: a) Linux used to be slower at forking and execing than it is now. b) Most cgi a

Re: D2 & Web-Framework

2011-07-15 Thread Trass3r
One of the paradigm shifts incurred when I moved to Unix from Windows was how incredibly cheap it was to create processes on Unix, and how many great idioms derive from that. In Windows one gets used to thinking creating a process is a big deal, which requires a fair amount of unlearning.

Re: D2 & Web-Framework

2011-07-15 Thread Andrei Alexandrescu
On 7/15/11 4:26 PM, Adam Ruppe wrote: IMO it makes sense to use this to reduce process creation times. Process creation is a very small cost with D programs. It's nothing to worry about unless you have real world data to the contrary for your project. Doesn't that apply more to Unix than to D

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
Nick Sabalausky wrote: > Does your undo stack persist after the editor (or the file) is > closed? How big is the undo stack? How easy is to undo to a specific > working (ie, not "in the middle of a task") state? It /can/ do them all, though I personally only the infinitely sized undo stack part. (

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
Nick Sabalausky wrote: > But, HEAD is technically required (though I have no idea what the > real-world use-cases are), so I'm not quite sure what to do. Actually, I'd be surprised if your web server didn't handle it... it can just send a GET to your app then simply discard the response body. As

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
> IMO it makes sense to use this to reduce process creation times. Process creation is a very small cost with D programs. It's nothing to worry about unless you have real world data to the contrary for your project. My cgi.d though supports standard cgi, fast cgi, and an embedded http server, if

Re: D2 & Web-Framework

2011-07-15 Thread Robert M. Münch
On 2011-07-14 16:00:33 +0200, Long Chang said: I create one , fastcgi & template is done , but I need dynamic link lib of posix support , ... I'll take a look at the fastcgi stuff. IMO it makes sense to use this to reduce process creation times. -- Robert M. Münch http://www.robertmuench.de

Re: D2 & Web-Framework

2011-07-15 Thread Robert M. Münch
On 2011-07-14 13:21:32 +0200, Trass3r said: http://arsdnet.net/dcode/ Thanks (for this link and the other related posts). I'll give it a try and play around with it. The session stuff can be kept simple via cookies or a REST interface ID. -- Robert M. Münch http://www.robertmuench.de

Re: D2 & Web-Framework

2011-07-15 Thread Nick Sabalausky
"Adam Ruppe" wrote in message news:ivp9aq$jn4$1...@digitalmars.com... > > (The difficulty I'm having there is I really want it to throw on > not implemented or unknown stuff, but I also want it to be able to > handle the kind of pure putrid shit you find on the open internet. Yea, I've been havi

Re: D2 & Web-Framework

2011-07-15 Thread Nick Sabalausky
"Adam Ruppe" wrote in message news:ivpdoo$rif$1...@digitalmars.com... > Nick Sabalausky wrote: >> Sooo...I don't suppose you've given thought to using Hg/BitBucket or >> Git/GitHub? ;) >> >> It'd make a lot of things much easier for both you and others using >> your code. And it would better fac

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
I changed my symlinks to hardlinks and it seems to have worked. So that github thingy is up to date now. Hopefully it will be simple to keep it that way!

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
Nick Sabalausky wrote: > Sooo...I don't suppose you've given thought to using Hg/BitBucket or > Git/GitHub? ;) > > It'd make a lot of things much easier for both you and others using > your code. And it would better facilitate people submitting patches > to you. Theyare an extra tool to learn and

Re: D2 & Web-Framework

2011-07-15 Thread Adam Ruppe
Nick Sabalausky wrote: > I might have found another one in the new dom.d. Starting at line > 3006 it has: Nah, that's just not implemented. The reason those cases are there is the browser app would throw an exception on it (assert(0) I believe) if it didn't recognize the names, but those are commo

Re: D2 & Web-Framework

2011-07-14 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ivo1ga$1ete$1...@digitalmars.com... > Nick Sabalausky wrote: >> Oh, one other thing I noticed: With DMD 2.054 banning implicit >> switch/case fallthrough, it pointed out an implicit fallthrough >> in dom.d at line 2641 > > That's interesting... I updated my d

Re: D2 & Web-Framework

2011-07-14 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ivo1ga$1ete$1...@digitalmars.com... > Nick Sabalausky wrote: >> Oh, one other thing I noticed: With DMD 2.054 banning implicit >> switch/case fallthrough, it pointed out an implicit fallthrough >> in dom.d at line 2641 > > That's interesting... I updated my d

Re: D2 & Web-Framework

2011-07-14 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ivo1ga$1ete$1...@digitalmars.com... > Nick Sabalausky wrote: >> (Not sure why IIS changes the redirect's "/" to "localstart.asp", >> probably just IIS trying to be "smart", but I usually only use IIS > >> locally, so > I don't really care right now). > > It'

Re: D2 & Web-Framework

2011-07-14 Thread Adam D. Ruppe
Let me list some of the newer features in web.d too, added in the last couple weeks. class ApiObject; These let you expose a more object oriented interface to your stuff on the url. class User : ApiObject { this(Foo foo, string id) {} } class Foo : ApiProvider { alias User user; } ==

Re: D2 & Web-Framework

2011-07-14 Thread Adam D. Ruppe
Nick Sabalausky wrote: > (Not sure why IIS changes the redirect's "/" to "localstart.asp", > probably just IIS trying to be "smart", but I usually only use IIS > locally, > so I don't really care right now). It's possible I messed up... the line of code is specifically: cgi.setResponseLo

Re: D2 & Web-Framework

2011-07-14 Thread Nick Sabalausky
"Adam D. Ruppe" wrote in message news:ivnq7e$1244$1...@digitalmars.com... > Nick Sabalausky wrote: >> I'm having trouble figuring out how to use the executable. > > [...helpful info...] Cool, thanks. On the cmdline, setting the env PATH_INFO to / makes it work. In the browser/IIS, adding a tra

Re: D2 & Web-Framework

2011-07-14 Thread Adam D. Ruppe
Nick Sabalausky wrote: > I'm having trouble figuring out how to use the executable. You'll need to make sure the program is set to run as CGI and that the stuff after the path is forwarded to the program. In Apache, dropping it in cgi-bin does both for you, or you can do a SetHandler cgi-script

Re: D2 & Web-Framework

2011-07-14 Thread Nick Sabalausky
"Adam Ruppe" wrote in message news:ivms0h$s8p$1...@digitalmars.com... > > Finally, web.d builds on top of dom and cgi to provide a higher > level interface; instead of manually parsing the cgi object, it tries > to do it automatically, to call your functions with reflection. > I recently started

Re: D2 & Web-Framework

2011-07-14 Thread Masahiro Nakagawa
Hi Robert, On Thu, 14 Jul 2011 19:49:10 +0900, Robert M. Münch wrote: dynamic content and simple output generation. In this point, I implement simple template engine called Mustache(Pure D and single file). https://bitbucket.org/repeatedly/mustache4d/overview Sorry, I don't have other

Re: D2 & Web-Framework

2011-07-14 Thread Robert Clipsham
On 14/07/2011 11:49, Robert M. Münch wrote: Hi, is there a matured framework for building the server side part of web-apps in D2? I don't need totally fancy things, session handling, dynamic content and simple output generation. I recommend Adam's given that he's using it in production. I shoul

Re: D2 & Web-Framework

2011-07-14 Thread Long Chang
I create one , fastcgi & template is done , but I need dynamic link lib of posix support , http://d.puremagic.com/issues/show_bug.cgi?id=6014 also block the jade template engine . https://github.com/sleets/oak

Re: D2 & Web-Framework

2011-07-14 Thread Adam Ruppe
Oh I forgot to mention what it *doesn't* do - session handling. Over the last year and a half that I've been using it for real sites every day, I just haven't felt the need for that beyond the most basic cookie thing and the database. If I need something like a session, I've always just done it in

Re: D2 & Web-Framework

2011-07-14 Thread Adam Ruppe
> http://arsdnet.net/dcode/ In there, you'll find most my files for the websites I create in D. The basic one is cgi.d. It gives easy access to things like get and post variables, uploaded files, and writing out responses. I think it works standing alone, but it might require the sha.d in there t

Re: D2 & Web-Framework

2011-07-14 Thread Trass3r
http://arsdnet.net/dcode/

D2 & Web-Framework

2011-07-14 Thread Robert M. Münch
Hi, is there a matured framework for building the server side part of web-apps in D2? I don't need totally fancy things, session handling, dynamic content and simple output generation. -- Robert M. Münch http://www.robertmuench.de