Walter Bright:
> Anyone have good ideas on topics for D articles?

Here are 7 possible articles:

1) We can write some cool larghish library/program and then show the results of 
the program, something like a small 2D or 3D game, a numerical plotting lib, 
etc. Graphics is very good because it catches the eye even if it's something 
simple.
For example I'd like to translate a small CPS (Constraint Problem Solver) like 
this into a single D2 module:
http://labix.org/python-constraint
Once written such module can be the basis for a "cool" article about one D2 
usage (and then I can use the CPS module in various ways).
I have other ideas for useful/nice single modules for D2, there are plenty of 
ideas to copy from in repositories of modules/programs written in Python, Perl, 
Ruby, Clojure, etc.


2) Another possibility is to appeal to the C++ crowd, for example translating 
this C++ to D2:
http://accu.org/index.php/journals/1422
A literal translation of the C++ code of this article to D2 is possible, but at 
the end of the D2 article it can show that there is a better solution in D2, 
like using variable-argument templated structs to implement n-way trees of 
types, as I have discussed a bit with Downs (keeping in mind that C++0x too has 
variable-argument templates. If you want to compare D2 with C++ to show D2 then 
you *must* use C++0x otherwise people will say you are cheating).


3) This is another awesome small C++ program that must be translated to D2 (but 
I am not certain this is the most updated version of this program), it's just a 
single C++ file about 24 KB of code and heavely templated, and in my opinion no 
other language beside C++ and D (and maybe Lisp) can be used to write a program 
so fast and so short to solve this:
http://www.codeguru.com/cpp/misc/samples/games/article.php/c13607/
It's textual and console-based code, so almost no libs are required.
Once translated, this can be the basis for a good article that explains the D2 
code, templates, etc.


4) Another quite interesting article can show how to implement Expression 
templates in D2, like the ones used in Blitz++ and successive libs:
http://en.wikipedia.org/wiki/Expression_templates
(If this article uncovers problems in D2 language then it's better to find them 
now than later :-) ).


5) You have noticed that I write a lot in this newsgroup. My recent "Huffman 
coding comparison" post can be seen as an article that shows D2 and Phobos2 
because the D2 code I've shown there is nice looking.


6) You can find C++0x variadic templates articles that can be translated to D2:
http://www.jot.fm/issues/issue_2008_02/article2/
http://mlangc.wordpress.com/2010/04/18/using-c0x-variadic-templates-to-pretty-print-types/


7) This is one of the changes in G++ 4.5:
http://gcc.gnu.org/gcc-4.5/changes.html
>Compilation time for code that uses templates should now scale linearly with 
>the number of instantiations rather than quadratically, as template 
>instantiations are now looked up using hash tables.<
So an article about D2 can show how DMD template performance is compared to the 
template performance of G++ 4.5. See also:
http://cpptruths.blogspot.com/2010/03/faster-meta-programs-using-gcc-45-and.html

Bye,
bearophile

Reply via email to