www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Is D a useful programming language for the web?

reply Justin Johansson <no spam.com> writes:
I throw this subject up for the D community's consideration.

Admittedly the subject is quite broad in scope.

However, in response to some of my posts of time ago, people on this NG
have said things along lines of "D is a Systems Programming Language so
we want none of that", or words to that effect.

So I'll play devil's advocate for a while and see what transpires.

Regards to all,

Justin Johansson
Mar 04 2010
next sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
Yes, though it needs a little more work on the library side to be simple
to use for it.

Web programming is still programming, a field in which D excels.

I don't really know what else to say, but I know having D's type system
is something I long for whenever using other web languages.

-- 
Adam D. Ruppe
http://arsdnet.net
Mar 04 2010
prev sibling next sibling parent =?ISO-8859-1?Q?Pelle_M=E5nsson?= <pelle.mansson gmail.com> writes:
On 03/04/2010 02:04 PM, Justin Johansson wrote:
 I throw this subject up for the D community's consideration.

 Admittedly the subject is quite broad in scope.

 However, in response to some of my posts of time ago, people on this NG
 have said things along lines of "D is a Systems Programming Language so
 we want none of that", or words to that effect.

 So I'll play devil's advocate for a while and see what transpires.

 Regards to all,

 Justin Johansson
I imagine the type system can eliminate a lot of security flaws, like the "tainted" perl strings.
Mar 04 2010
prev sibling next sibling parent "GiM" <gim bug.me.not.pl> writes:
 
 So I'll play devil's advocate for a while and see what transpires.
 
I'm not sure if it's useful but I've managed to write simple web-server (I used tango since I'm used to it) that served simple minesweeper application :) async request were made using jquery, some request were responsed with static pages, and to other content generated directly in D was sent. cheers, -- GiM
Mar 04 2010
prev sibling next sibling parent reply "Nick Sabalausky" <a a.a> writes:
"Justin Johansson" <no spam.com> wrote in message 
news:hmob4s$pai$1 digitalmars.com...
I throw this subject up for the D community's consideration.

 Admittedly the subject is quite broad in scope.

 However, in response to some of my posts of time ago, people on this NG
 have said things along lines of "D is a Systems Programming Language so
 we want none of that", or words to that effect.

 So I'll play devil's advocate for a while and see what transpires.

 Regards to all,

 Justin Johansson
If I were managing my own web server I would *absolutely* use D. Unfortunately, damn near everything is shared-LAMP hosting these days. And while there may be better servers out there, as a programmer I rarely have any control over my client's or employer's servers or choice of host. So when I do web-dev (Ie, nearly all the damn time) I have to put up with that god-awful PHP instead. And when the only common ground available on the servers you deal with is PHP (as is typically the case, such as with me) then the *only* alternative to PHP (Ie something that can be compiled to PHP) is Haxe, which is certainly better than straight PHP, but it's still crap too (especially the package system...I mean, people sometimes complain about D's package system, but Haxe's is truly horrible, so bad that I'd almost prefer C/PHP-style includes). D's great for web, *if*, as the programmer, you're lucky enough to have a high degree of control over the server. Usually you aren't that lucky. Which actually happens to be one of the main motivating factors for my Goldie project ( http://www.dsource.org/projects/goldie ). Eventually I want to get it to a point where it can handle languages like D and PHP, and have a strong, ultra-flexible and generalized AST system that knows how to emulate one set of language features with some other set of language features, so I can automate translation from whatever the hell language I want (say, D) to whatever the hell language I want (say, PHP). Yea, it'll run much slower on the server than normal natively-compiled D, but, well, that's what's gonna happen when some sysadmin insists on crap like PHP as a baseline, so screw 'em, I say. If the sysadmin wants their server running fast then they can let me natively compile whatever the hell I need to, otherwise, tough shit to them.
Mar 04 2010
parent reply Chad J <chadjoan __spam.is.bad__gmail.com> writes:
Nick Sabalausky wrote:
 
 ...
 
 D's great for web, *if*, as the programmer, you're lucky enough to have a 
 high degree of control over the server. Usually you aren't that lucky. Which 
 actually happens to be one of the main motivating factors for my Goldie 
 project ( http://www.dsource.org/projects/goldie ). Eventually I want to get 
 it to a point where it can handle languages like D and PHP, and have a 
 strong, ultra-flexible and generalized AST system that knows how to emulate 
 one set of language features with some other set of language features, so I 
 can automate translation from whatever the hell language I want (say, D) to 
 whatever the hell language I want (say, PHP). ...
You sir, are a hero. Question though, why not just have llvm emit code in another language?
Mar 06 2010
parent reply "Nick Sabalausky" <a a.a> writes:
"Chad J" <chadjoan __spam.is.bad__gmail.com> wrote in message 
news:hmul75$qsm$1 digitalmars.com...
 Nick Sabalausky wrote:
 ...

 D's great for web, *if*, as the programmer, you're lucky enough to have a
 high degree of control over the server. Usually you aren't that lucky. 
 Which
 actually happens to be one of the main motivating factors for my Goldie
 project ( http://www.dsource.org/projects/goldie ). Eventually I want to 
 get
 it to a point where it can handle languages like D and PHP, and have a
 strong, ultra-flexible and generalized AST system that knows how to 
 emulate
 one set of language features with some other set of language features, so 
 I
 can automate translation from whatever the hell language I want (say, D) 
 to
 whatever the hell language I want (say, PHP). ...
You sir, are a hero.
Heh, thanks :)
 Question though, why not just have llvm emit code in another language?
A few (admittedly not very big) reasons, in no order: - I wanted some experience writing lexer/parser code on my own. - LLVM's written in, umm, either C or C++, not D, and I'd rather not have to deal with C/C++ (*especially* if it involves string manipulation) or D<->C/C++ bindings if I don't have to (I spent years with C/C++...then I found D. I'll be very happy if I never have to go back). - AIUI, LLVM's intermediate representation is very low-level, so high level code generated from it would be pretty much unreadable and bear no resemblance to the original code. This is certainly fine for many uses, but I wanted to take a more generalized approach, to allow for more basic source manipulations than just language translation (such as customized pretty-printing and whitespace-stripping), or to act as the first step in maintaining a port of some app/lib in another language, or to allow for "language-tweaking", such as "python with curly-brace scoping", or "VB with semicolon statement-terminators" (The motivation and ideal goal behind this is to make many langauge feature debates as pointless as a debate on what tabsize your editor should use). Yea, it's very ambitious, and as such, I have no idea how it'll actually turn out. But I think it's at least worth attempting. Goldie's really aiming to be more of an evolved ANTLR rater than something like LLVM. The closest competing project to Goldie would probably be Gazelle (or an ultra-souped-up version of GOLD Parser Builder, which Goldie is currently oriented around, or something like JetBrains MPS, but not tied to a single IDE and not so insanely slow and bloated).
Mar 06 2010
parent Chad J <chadjoan __spam.is.bad__gmail.com> writes:
Nick Sabalausky wrote:
 "Chad J" <chadjoan __spam.is.bad__gmail.com> wrote in message 
 news:hmul75$qsm$1 digitalmars.com...
 
 ...
 
 Question though, why not just have llvm emit code in another language?
A few (admittedly not very big) reasons, in no order: - I wanted some experience writing lexer/parser code on my own. - LLVM's written in, umm, either C or C++, not D, and I'd rather not have to deal with C/C++ (*especially* if it involves string manipulation) or D<->C/C++ bindings if I don't have to (I spent years with C/C++...then I found D. I'll be very happy if I never have to go back).
amen.
 - AIUI, LLVM's intermediate representation is very low-level, so high level 
 code generated from it would be pretty much unreadable and bear no 
 resemblance to the original code. This is certainly fine for many uses, but 
 I wanted to take a more generalized approach, to allow for more basic source 
 manipulations than just language translation (such as customized 
 pretty-printing and whitespace-stripping), or to act as the first step in 
 maintaining a port of some app/lib in another language, or to allow for 
 "language-tweaking", such as "python with curly-brace scoping", or "VB with 
 semicolon statement-terminators" (The motivation and ideal goal behind this 
 is to make many langauge feature debates as pointless as a debate on what 
 tabsize your editor should use). Yea, it's very ambitious, and as such, I 
 have no idea how it'll actually turn out. But I think it's at least worth 
 attempting.
 
 Goldie's really aiming to be more of an evolved ANTLR rater than something 
 like LLVM. The closest competing project to Goldie would probably be Gazelle 
 (or an ultra-souped-up version of GOLD Parser Builder, which Goldie is 
 currently oriented around, or something like JetBrains MPS, but not tied to 
 a single IDE and not so insanely slow and bloated).
 
 
OK, neat. Thanks for explaining.
Mar 07 2010
prev sibling parent Steve Teale <steve.teale britseyeview.com> writes:
I was working on a web application framework kind of like Tomcat (using 
AJP), but different. At one point I thought it was going quite well.

I foundered on the inability to dynamically load things, which was an 
essential. I tried  messing with DDL, but that seemed to be a dead end.

Shared libraries would have been OK but ...

Steve
Mar 04 2010