Safer casts

Dee Girl deegirl at noreply.com
Sun May 11 10:23:56 PDT 2008


Yigal Chripun Wrote:

> Disclaimer: this post reflects my personal opinion only and should not
> start yet another flame war about tango vs phobos. feel free to disagree
> with everything I say.
> 
> based on what I know:
> phobos uses the C IO. this is both bad for performance (yet another
> layer) and the interface is ugly. Tango's IO much more powerful, more
> efficient, and more flexible. the cost of it is that it's more complex
> (compared to the  C-like functions phobos provides).
> phobos is ill organized mixing the run-time library (which you as a user
> should never touch) with the user code. Why is the GC internals in the
> same library as the string manipulation functions?? also the namespace
> in tango is much better organized into packages and modules (although,
> sometimes it's too much, like the collections being nested in utils). I
> prefer Tango's tango.io.Stdout vs std.stdio. I think Stdout is lame but
> at least it's inside an IO package. what's the deal with using 8-letter
> acronyms that are hard to remember anyway? we are not limited by DOS' 8
> chars length for file names anymore.
> Tango has much more functionality, is optimized for performance, has
> less bugs and more maintainers than phobos. Walter is a genius compiler
> writer but he can't spend all his time on phobos, And I really dislike
> the C++ smell from all of the code Andrei added to phobos. He's a C++
> Wizard, But that C++ mindset that templates solve everything is bad IMO.
> sometimes, the language does need to provide proper syntax. D needs a
> good tuple support and not a template Tuple!(...)  for example. another
> example would be all the templates in std.algorithm. I'd prefer a reduce
> function that takes a delegate rather than a reduce template.

I am not sure I understood all how D templates work. But how it seems is this. Please correct if it is wrong. If reduce takes a template argument then expands a loop each time in client code. If reduce as you want takes a delegate argument then there is only one loop but there is one indirect call for each iteration.

Question is which one is better. Conceptually they have same power. There are details of performance. I think first one is best because really offers you both. The second only limits your choice. But they have same power, why would you hate one and love another? Thank you, Dee Girl




More information about the Digitalmars-d mailing list