Marketing of D - article topic ideas?
Justin Spahr-Summers
Justin.SpahrSummers at gmail.com
Sun Jun 6 20:34:54 PDT 2010
On Sun, 6 Jun 2010 22:42:42 +0000 (UTC), dsimcha <dsimcha at yahoo.com>
wrote:
>
> == Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> > D is an extremely powerful language, but when I read complaints and sighs about
> > other languages, few seem to know that these problems are solved with D.
> > Essentially, we have a marketing problem.
> > One great way to address it is by writing articles about various aspects of D
> > and how they solve problems, like
> >
> http://www.reddit.com/r/programming/comments/cb14j/compiletime_function_execution_in_d/
> > which was well received on reddit.
> > Anyone have good ideas on topics for D articles? And anyone want to stand up and
> > write an article?
> > They don't have to be comprehensive articles (though of course those are
> > better), even blog entries will do.
>
> This probably won't be replied to because I'm starting a new sub-thread in a
> mature discussion, but I wonder if we could write about the advantages and
> disadvantages of duck typing vs. static typing, comparing Python vs. Java at
> first, then bring D into the picture to show how, to a greater extent than C++
> templates or C#/Java generics, it solves may of the problems of static typing
> without introducing the pitfalls of duck typing.
>
> Here's a simple example of something that would be awkward to impossible to do
> efficiently in any other language:
>
> /**Finds the largest element present in any of the ranges passed in.\
> */
> CommonType!(staticMap!(ElementType, T)) largestElement(T...)(T args) {
> // Quick and dirty impl ignoring error checking:
> typeof(return) ret = args[0].front();
>
> foreach(arg; args) {
> foreach(elem; arg) {
> ret = max(elem, ret);
> }
> }
>
> return ret;
> }
>
> Do this in C++ -> FAIL because there are no variadics. (Yes, C++1x will have
> them, but I might die of old age by the time C++1x exists.)
>
> Do this in any dynamic language -> FAIL because looping is so slow that you might
> die of old age before it executes. Besides, who wants to do computationally
> intensive, multithreaded work in a dynamic language?
>
> Do this in Java -> FAIL because arrays are primitives, not Objects and variadics
> only work with Objects. You can't easily make an array of arrays because the
> elements of args may be different but related types (e.g. int, float).
Seems like that example could be done fairly easily with Objective-C.
Granted, it won't have the raw performance of D, but it might be
worthwhile to point it out, since it (or rather, its superset on top of
C) is duck typed.
If someone were to create Objective-D, I think I'd die of happiness.
More information about the Digitalmars-d
mailing list