
New D programming language forum, written entirely in D  - rpeden
http://forum.dlang.org/
======
dark_c
The site is amazingly fast (at least subjectively), even though there must be
a higher traffic coming from HN. Has anyone inspected the code to see how it's
done and if there's some kind of a web framework for D?

~~~
tintin
Funny that people notice this. I think this is how all pages on the internet
should be! Lately I'm getting tired of all those fancy Javascript pages or
pages build on bloated frameworks.

The speed of this forum has nothing to do with D. You can achieve this in a
language like PHP as well.

Just skip the bloat (server and client side).

~~~
CyberShadow
Here are some of the things that play a part in the forum's performance:

* Optimized and deflated static resources

* Deflated HTML output

* SQLite prepared statements

* Integrated HTTP server (although it's currently in front of an Apache proxy)

* An optimized string builder (<https://github.com/CyberShadow/DAppenderResearch>)

* RAM cache of frequent DB queries

While there are equivalents available for interpreted/CGI languages (e.g.
opcode caches, memcached), there is still a significant performance advantage.
With a warm cache, most pages can be written out in under 5ms, and the busiest
in under 50.

For some perspective, the time needed to compose the busiest view (threaded or
split-view) halved when I moved from naive string concatenation to an
optimized appender.

~~~
dkhenry
Great work. I wonder if there is a way to turn this into a more general
purpose framework then just serving up one specific forum.

~~~
CyberShadow
Yes, there are way too many things hard-coded at the moment. I want to
refactor all of it out into templates, config files and library code. There's
apparently some interest of adopting some code into D's standard library, too.

~~~
andralex
s/some/a ton of/

------
rpeden
The source is available on github:

<https://github.com/CyberShadow/DFeed>

------
javadyan
Hell yes, that's what I'm talking about. We need good tools in nice,
statically typed, native languages to make web applications!

~~~
gaius
Opa/OCaml?

------
thebigshane

       D's design goals attempt to combine the performance of 
       compiled languages with the safety and expressive power 
       of modern dynamic languages. Idiomatic D code is 
       commonly as fast as equivalent C++ code, while being 
       shorter and memory-safe.
    

D seems to have similar goals with Go (golang). Has anybody here used both?

[<http://en.wikipedia.org/wiki/D_%28programming_language%29>]

~~~
thebigshane
For those interested, more info on the differences between D and Go:
[http://stackoverflow.com/questions/3554956/d-versus-go-
compa...](http://stackoverflow.com/questions/3554956/d-versus-go-comparison)

More different than I thought.

------
SeanDav
I have always thought D was an interesting language. I never got into it
because I thought it was pretty dormant. Has it been resurrected?

~~~
CyberShadow
There's been an explosion of contributions to the compiler, runtime and
standard library since their development was moved to GitHub about a year ago.

~~~
danieldk
Cool! I may consider trying it again. Are the gcc or LLVM compilers up to date
these days?

~~~
CyberShadow
GDC is in really good shape (on *nix at least). LDC seems up-to-date, but not
sure how stable it is.

------
tl
It looks site your main site is still linking to the old forum:

HN -> <http://forum.dlang.org/> -> <http://dlang.org/overview.html> ->
<http://digitalmars.com/NewsGroup.html>

------
wingo
Nicely done!

