Let Go, Standard Library From Community

Dan murpsoft at hotmail.com
Wed Apr 18 10:40:51 PDT 2007


Lars Ivar Igesund Wrote:

> Dan wrote:
> 
> > 
> > I just use phobos.  It gets the job done, instead of trying to be
> > everything and anything the user might possibly want to interact with;
> > like the Java libraries.
> > 
> > I find the Java libraries are so freakin' huge and multipurpose that they
> > couldn't possibly be even close to efficient or practical for any one
> > solution.
> > 
> > Likewise I fear for Tango, as it's got that OO gleam in it's eye and is
> > implementing classes for crypto.. I mean.. crypto!?  What's next, a math
> > class?  *shudders*
> 
> Seriously, classes don't inherently mean in-efficient as you seem to
> believe. Tango puts it's pride in being an efficient library, and if it is
> provably slower than other solutions, whether they are OO or procedural,
> then we would like to know, as it is most likely a bug. Note that the
> overhead with classes most often are related to the allocation cost. In
> very many cases, when it makes sense to keep the ojbect a live for a
> period, keeping state can you help you make many operations more efficient
> than if they had to be done repeatedly through a free function, quickly
> overcoming the initial allocation cost. This also often leads to easier
> overall use. Then you have the cases where the related operations
> (especially disk IO) are so expensive in itself, that whether classes are
> used or not, won't be noticed in the grand scheme of things. They may
> however ease use through encapsulation.
> 
> As for the String class; Yes, Tango has one, but do also have free functions
> for the same operations, and in most cases we provide versions that do not
> induce heap activity.
> 
> Additionally we try to design the library to be flexible and easy to use,
> and coherent with itself. We even worry about binary sizes.

~~

That's respectable.

On that note, I think I'll examine the Tango sources.  Whomever is working on Tangobos is definitely doing us all a favor.

So if I could demonstrate that many (if not all) of these implementations should really be using a struct for strictly performance reasons, for example, would that have any weight?

I find that structs tend to be able to do alot in D, with Interfaces being the only remaining thing I miss.



More information about the Digitalmars-d mailing list