emscripten

Alexander Pánek a.panek at brainsware.org
Wed Dec 15 01:42:53 PST 2010


Vladimir Panteleev Wrote:

> On Tue, 14 Dec 2010 18:27:28 +0200, Alexander Pánek  
> <a.panek at brainsware.org> wrote:
> 
> > D as server-side was once something I tried to achieve, but it wasn't  
> > the right time. It would have been perfect as backend for a full-blown  
> > JS browser app, only handling & shuffling data around, sending JSON back  
> > and forth.
> 
> I've done this. I wrote three web-apps (HTML/CSS, JS+jQuery and D). It's  
> awesome.
> 
> Two of the three are private, but here's the simplest one I wrote in 2006  
> (no jQuery):
> http://snoop.worms2d.info/ (basically web IRC client)

Nice nice!

> D really hits the spot here, though. The apps' backends needed to be  
> persistent and fast (things like searching through growable memory-mapped  
> files), so CGI-like languages (PHP/Perl) were no good. With D's inline  
> struct types and a JSON serializer, returning JSON is really clean and  
> easy, which isn't possible in mainstream compiled languages:
> 
> if (resource == "/getfoo")
> {
> 	struct FooResult { int n; string s; }
> 	return toJSON(FooResult(42, "bar")); // {"n":42,"s":"bar"}
> }

That's what I'm talkin' 'bout! :D


More information about the Digitalmars-d mailing list