Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread JFD
A potential "mod_d" Apache module would go a long way to promote D language to the web application world. But it seems that implementing a "mod_d" Apache module may require that C instantiates a D language interpreter (similar to Py_NewInterpreter() for Python), or do the functionality of RDMD wit

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Daniel Gibson
JFD schrieb: A potential "mod_d" Apache module would go a long way to promote D language to the web application world. But it seems that implementing a "mod_d" Apache module may require that C instantiates a D language interpreter (similar to Py_NewInterpreter() for Python), or do the functional

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread JFD
Yes, you're right. One should implement Apache module in D. One thing is that Apache module entry point expects a "C" function. I've figure that that one could just add extern(C) in front of D function to be callable from C, so that was easy. Also, Apache expects .so shared library, and one co

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Andrei Alexandrescu
On 11/8/10 4:37 PM, JFD wrote: Yes, you're right. One should implement Apache module in D. One thing is that Apache module entry point expects a "C" function. I've figure that that one could just add extern(C) in front of D function to be callable from C, so that was easy. Also, Apache expec

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Torarin
2010/11/9 Andrei Alexandrescu : > People at Facebook told me that the adoption of D inside the company might > be helped if they could simply write to insert D code into a > page. I'm not sure how difficult such a plugin would be to implement. Also, > D code should be able to call PHP code (which

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... > > People at Facebook told me that the adoption of D inside the company might > be helped if they could simply write to insert D code into a > page. I'm not sure how difficult such a plugin would be to implement. I'm

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Andrei Alexandrescu
On 11/8/10 9:17 PM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... People at Facebook told me that the adoption of D inside the company might be helped if they could simply write to insert D code into a page. I'm not sure how difficult such

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:ibam3u$1b5...@digitalmars.com... > On 11/8/10 9:17 PM, Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:ibaepi$vf...@digitalmars.com... >>> >>> People at Facebook told me that the adoption of D inside the company >>> might >>>

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread spir
On Tue, 9 Nov 2010 00:17:48 -0500 "Nick Sabalausky" wrote: > > People at Facebook told me that the adoption of D inside the company might > > be helped if they could simply write to insert D code into a > > page. I'm not sure how difficult such a plugin would be to implement. > > I'm very s

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Nick Sabalausky
"spir" wrote in message news:mailman.201.1289284596.21107.digitalmar...@puremagic.com... > On Tue, 9 Nov 2010 00:17:48 -0500 > "Nick Sabalausky" wrote: > > > > People at Facebook told me that the adoption of D inside the company > > > might > > > be helped if they could simply write to insert

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Andrei Alexandrescu
On 11/8/10 10:36 PM, spir wrote: On Tue, 9 Nov 2010 00:17:48 -0500 "Nick Sabalausky" wrote: People at Facebook told me that the adoption of D inside the company might be helped if they could simply write to insert D code into a page. I'm not sure how difficult such a plugin would be to implem

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-08 Thread Nick Sabalausky
"Andrei Alexandrescu" wrote in message news:ibark6$1k3...@digitalmars.com... > On 11/8/10 10:36 PM, spir wrote: >> On Tue, 9 Nov 2010 00:17:48 -0500 >> "Nick Sabalausky" wrote: >> People at Facebook told me that the adoption of D inside the company might be helped if they could s

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Walter Bright
JFD wrote: Yes, you're right. One should implement Apache module in D. One thing is that Apache module entry point expects a "C" function. I've figure that that one could just add extern(C) in front of D function to be callable from C, so that was easy. Also, Apache expects .so shared librar

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Jacob Carlborg
On 2010-11-09 01:37, JFD wrote: Yes, you're right. One should implement Apache module in D. One thing is that Apache module entry point expects a "C" function. I've figure that that one could just add extern(C) in front of D function to be callable from C, so that was easy. Also, Apache expe

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Jacob Carlborg
On 2010-11-09 06:17, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... People at Facebook told me that the adoption of D inside the company might be helped if they could simply write to insert D code into a page. I'm not sure how difficult such

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread sybrandy
Ahh, I see that's written by the ANTLR/StringTemplate guy. I never read that paper, but the docs for his StringTemplate were a big part of what convinced me that template engines shouldn't try to be full-fledged imperative programming languages. I've done web development for a chunk of my care

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Jacob Carlborg
On 2010-11-09 04:21, Andrei Alexandrescu wrote: On 11/8/10 4:37 PM, JFD wrote: Yes, you're right. One should implement Apache module in D. One thing is that Apache module entry point expects a "C" function. I've figure that that one could just add extern(C) in front of D function to be callable

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Nick Sabalausky
"Jacob Carlborg" wrote in message news:ibbjmv$e8...@digitalmars.com... > On 2010-11-09 04:21, Andrei Alexandrescu wrote: >> On 11/8/10 4:37 PM, JFD wrote: >>> Yes, you're right. One should implement Apache module in D. >>> >>> One thing is that Apache module entry point expects a "C" function. >>

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Walter Bright
Nick Sabalausky wrote: I seem to remember hearing that was being depricated. And it was never anything like what Andrei's describing. IIRC, all it did was completely ignore all the HTML stuff (ie, treat it like comments). It didn't send it to Stdout or anything. Right. It was not a good idea

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Eric Poggel
On 11/9/2010 12:17 AM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... People at Facebook told me that the adoption of D inside the company might be helped if they could simply write to insert D code into a page. I'm not sure how difficult su

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Nick Sabalausky
"Eric Poggel" wrote in message news:ibcn72$2u3...@digitalmars.com... > On 11/9/2010 12:17 AM, Nick Sabalausky wrote: >> "Andrei Alexandrescu" wrote in message >> news:ibaepi$vf...@digitalmars.com... >>> >>> People at Facebook told me that the adoption of D inside the company >>> might >>> be he

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Roman Ivanov
On 11/9/2010 12:17 AM, Nick Sabalausky wrote: > "Andrei Alexandrescu" wrote in message > news:ibaepi$vf...@digitalmars.com... >> >> People at Facebook told me that the adoption of D inside the company might >> be helped if they could simply write to insert D code into a >> page. I'm not sure h

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Eric Poggel
On 11/9/2010 7:25 PM, Nick Sabalausky wrote: I could probably live with that as long as the "PHP template" stayed view-only and didn't grow too much logic. Are there any web-friendly languages that are mature, offer the sanity and static typing of C#, and the "immediate mode" of php?

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-09 Thread Nick Sabalausky
"Eric Poggel" wrote in message news:ibd00s$dl...@digitalmars.com... > On 11/9/2010 7:25 PM, Nick Sabalausky wrote: >> I could probably live with that as long as the "PHP template" stayed >> view-only and didn't grow too much logic. > > Are there any web-friendly languages that are mature, offer t

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Jacob Carlborg
On 2010-11-10 01:25, Nick Sabalausky wrote: "Eric Poggel" wrote in message news:ibcn72$2u3...@digitalmars.com... On 11/9/2010 12:17 AM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... People at Facebook told me that the adoption of D insid

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Jacob Carlborg
On 2010-11-10 03:28, Eric Poggel wrote: On 11/9/2010 7:25 PM, Nick Sabalausky wrote: I could probably live with that as long as the "PHP template" stayed view-only and didn't grow too much logic. Are there any web-friendly languages that are mature, offer the sanity and static typing of C#, an

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Jacob Carlborg
On 2010-11-10 00:57, Eric Poggel wrote: On 11/9/2010 12:17 AM, Nick Sabalausky wrote: "Andrei Alexandrescu" wrote in message news:ibaepi$vf...@digitalmars.com... People at Facebook told me that the adoption of D inside the company might be helped if they could simply write to insert D code int

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread sybrandy
On 11/09/2010 06:57 PM, Eric Poggel wrote: I've always felt the opposite way. It's been a while since I've worked with Asp.net controls, but I remember something like this: . // Later, in C# for (int i=0; i<10; i++) List.innerHtml += "" + sanitize(someArray[i]) + "" While php would do some

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Roman Ivanov
== Quote from Nick Sabalausky (a...@a.a)'s article > "Eric Poggel" wrote in message > news:ibd00s$dl...@digitalmars.com... > > On 11/9/2010 7:25 PM, Nick Sabalausky wrote: > >> I could probably live with that as long as the "PHP template" stayed > >> view-only and didn't grow too much logic. > > >

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Adam Ruppe
Eric Poggel wrote: > Are there any web-friendly languages that are mature, offer the sanity and > static typing of C#, and the "immediate mode" of php? We could do it in D, somewhat easily. Here's an implementation with only mild bugginess: === import std.file; import std.string; import std.std

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Radu
On 11/8/2010 11:45 PM, JFD wrote: A potential "mod_d" Apache module would go a long way to promote D language to the web application world. But it seems that implementing a "mod_d" Apache module may require that C instantiates a D language interpreter (similar to Py_NewInterpreter() for Python),

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Adam Ruppe
Nick Sabalausky wrote: > (but I've done worse - I once tried to build HTML > buy manually adding nodes to an XML DOM...it seemed like a good idea > until I actually started doing it). This is actually one of the methods I've been using in my D web apps throughout the year. It's not that bad if you

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Nick Sabalausky
"Radu" wrote in message news:ibe95h$gl...@digitalmars.com... > On 11/8/2010 11:45 PM, JFD wrote: >> A potential "mod_d" Apache module would go a long way to promote D >> language to >> the web application world. >> >> But it seems that implementing a "mod_d" Apache module may require that C >> in

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Nick Sabalausky
"Nick Sabalausky" wrote in message news:ibev09$1vf...@digitalmars.com... > "Radu" wrote in message news:ibe95h$gl...@digitalmars.com... >> On 11/8/2010 11:45 PM, JFD wrote: >>> A potential "mod_d" Apache module would go a long way to promote D >>> language to >>> the web application world. >>>

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Radu
On 11/10/2010 10:47 PM, Nick Sabalausky wrote: "Nick Sabalausky" wrote in message news:ibev09$1vf...@digitalmars.com... "Radu" wrote in message news:ibe95h$gl...@digitalmars.com... On 11/8/2010 11:45 PM, JFD wrote: A potential "mod_d" Apache module would go a long way to promote D language t

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread Nick Sabalausky
"sybrandy" wrote in message news:ibbkh3$fv...@digitalmars.com... >> Ahh, I see that's written by the ANTLR/StringTemplate guy. I never read >> that >> paper, but the docs for his StringTemplate were a big part of what >> convinced >> me that template engines shouldn't try to be full-fledged imp

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-10 Thread JFD
== Quote from Jacob Carlborg (d...@me.com)'s article > On 2010-11-09 01:37, JFD wrote: > > Yes, you're right. One should implement Apache module in D. > > > > One thing is that Apache module entry point expects a "C" function. I've > > figure > > that that one could just add extern(C) in front o

Re: Apache "mod_d" needs C to instantiate D interpreter?

2010-11-24 Thread Roman Ivanov
On 11/9/2010 1:36 AM, spir wrote: > On Tue, 9 Nov 2010 00:17:48 -0500 > "Nick Sabalausky" wrote: > >>> People at Facebook told me that the adoption of D inside the company might >>> be helped if they could simply write to insert D code into a >>> page. I'm not sure how difficult such a plugin

Re: Apache "mod_d" needs C to instantiate D interpreter?/D embedded in HTML

2010-11-09 Thread JFD
> Can't DMD already compile D code embedded in HTML: > http://www.digitalmars.com/d/2.0/html.html ? I tried the sample at the link, but got error. I also tried it without the HTML code inside. Am I missing something? $ dmd hello.html Error: module hello html source files is deprecated hello.htm

Re: Apache "mod_d" needs C to instantiate D interpreter?/D embedded in HTML

2010-11-09 Thread Robert Clipsham
On 09/11/10 14:24, JFD wrote: Can't DMD already compile D code embedded in HTML: http://www.digitalmars.com/d/2.0/html.html ? I tried the sample at the link, but got error. I also tried it without the HTML code inside. Am I missing something? $ dmd hello.html Error: module hello html source