www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Multiple "Standard" Libraries for D?

reply sybrandy <sybrandy gmail.com> writes:
I know some people have been talking about adding various 
classes/libraries that they are working on to Phobos, however there's a 
good possibility that we make the standard library too large.  So, I'd 
like to propose that instead of one huge standard library, there be 
several libraries developed for different uses.

For example, Phobos could contain everything that one would need to 
build other libraries easily.  E.g. pretty much everything it has now. 
Another library could be a math library containing everything for large 
number, matrix arithmetic, statistics, etc.  Another could be crypto 
library.

Essentially, what I'm looking at is a standardized set of libraries, but 
having them broken out so that when someone downloads the D compiler, 
they get a minimal set vs. everything.  Also, by having everything 
maintained in the same spot, it would hopefully make it easy for people 
to find and download the libraries they need.  Think of something like 
Perl's CPAN.

Anyway, just a thought.

Casey
Apr 26 2010
parent reply Norbert Nemec <Norbert Nemec-online.de> writes:
I am less worried about the size than about the quality.

Replacing any part of the standard library is an act similar to changing 
the language definition, so including new modules into the library 
should be done with as much care as including new features into the 
language.

Apart from that, however, I like the "batteries-included" approach of 
e.g. Python. Crypto, math, web services and many other parts are of 
sufficient general interest to be part of the standard library. However, 
if the quality of any module is questionable, it should rather be left 
out until it is up to shape.

A CPAN-like repository with easy-to-retrieve additional modules is 
certainly interesting as well, but it does not replace an extensive 
standard library that you can rely on to be there whenever you write D code.

Greetings,
Norbert



On 27/04/10 00:30, sybrandy wrote:
 I know some people have been talking about adding various
 classes/libraries that they are working on to Phobos, however there's a
 good possibility that we make the standard library too large. So, I'd
 like to propose that instead of one huge standard library, there be
 several libraries developed for different uses.

 For example, Phobos could contain everything that one would need to
 build other libraries easily. E.g. pretty much everything it has now.
 Another library could be a math library containing everything for large
 number, matrix arithmetic, statistics, etc. Another could be crypto
 library.

 Essentially, what I'm looking at is a standardized set of libraries, but
 having them broken out so that when someone downloads the D compiler,
 they get a minimal set vs. everything. Also, by having everything
 maintained in the same spot, it would hopefully make it easy for people
 to find and download the libraries they need. Think of something like
 Perl's CPAN.

 Anyway, just a thought.

 Casey
Apr 27 2010
parent sybrandy <sybrandy gmail.com> writes:
On 04/27/2010 05:15 AM, Norbert Nemec wrote:
 I am less worried about the size than about the quality.

 Replacing any part of the standard library is an act similar to changing
 the language definition, so including new modules into the library
 should be done with as much care as including new features into the
 language.
Understood. I believe that these libraries need to be maintained in the same similar fashion as Phobos.
 Apart from that, however, I like the "batteries-included" approach of
 e.g. Python. Crypto, math, web services and many other parts are of
 sufficient general interest to be part of the standard library. However,
 if the quality of any module is questionable, it should rather be left
 out until it is up to shape.
Understood. It's just that I have seen several complaints about languages being "too hard to understand" due to the amount of libraries that the language comes with. This was just one possible solution to mitigate that especially since people are interested in contributing code to Phobos. Personally, I'm all for having lots of tools at my disposal at any time, however I can see where there can be too much stuff in a standard library. I believe that the Perl maintainers only add a new library to the core language if it's heavily used, though that is not always the case as I'm sure the DBI (the standard Perl database interface) is not part of the standard library.
 A CPAN-like repository with easy-to-retrieve additional modules is
 certainly interesting as well, but it does not replace an extensive
 standard library that you can rely on to be there whenever you write D
 code.
Agreed, however sometimes it's just nice to be able to quickly find something you need without scouring the bowels of the internet. It's a big reason why I love Perl. Casey
Apr 27 2010