[phobos] Phobos has way too many modules

Andrei Alexandrescu andrei at erdani.com
Sun Jan 2 15:35:41 PST 2011


On 9/15/10 6:56 AM, Lars Tandle Kyllingstad wrote:
> I said in an earlier e-mail that I think std.file, std.path, and
> std.stdio should remain separate modules.  However, I do think that, for
> a library with a flat module hierarchy, Phobos has acquired way too many
> modules.  Some of them should (and will) be removed, and some could be
> merged.
>
> The following are my suggestions for how to trim the Phobos module list
> a bit.  At the bottom I'll show the resulting module list.
>
>
> Modules which could be removed, most of them *right now*, because they
> are superseded by other modules or built-in functionality:
>
>          std.bind       - use lambdas or nested functions instead

Done.

>          std.boxer      - superseded by std.variant

Done.

>          std.contracts  - superseded by std.exception

Not yet.

>          std.cstream    - superseded by std.stdio.File

Not yet - waiting for the new streams.

>          std.demangle   - superseded by core.demangle

There's no http://www.digitalmars.com/d/2.0/phobos/core_demangle.html. 
Walter, Sean?

>          std.iterator   - superseded by std.range

That's been eliminated for a while. Looks like Walter didn't update 
std.ddoc before generating the docs. Walter?

>          std.openrj     - obscure format, better to use std.json

Can't find it.

>          std.perf       - superseded by StopWatch

Can't find it.

>          std.regexp     - superseded by std.regex

Deprecated.

>          std.stream     - ranges are the way to go

Wating for the new streams.

>          std.syserror   - superseded by std.windows.syserror

Can't find it.

>          std.c.*        - superseded by core.stdc.* and core.sys.*

Walter, Sean? Are we ready for this step?

> Modules for which there is no documentation on the D home page, and
> which I suspect nobody are using:
>
>          std.loader
>          std.stdarg
>          std.typelist
>
> Modules which can be merged into a single one, possibly after
> substantial/complete rewrites:
>
>          std.compiler + std.cpuid + std.system (= std.sysinfo?)
>          std.ctype + std.uni (= std.character?)
>          std.date + std.dateparse + std.gregorian + std.stopwatch
>            (= std.datetime?)
>          std.encoding + std.utf (= std.encoding?)
>          std.socket + std.socketstream (= std.socket (or std.net?))
>          std.typecons + std.typetuple (= std.types?)

If anyone wants to work on this, please discuss.

> And finally, some renaming suggestions (which were actually posed by
> Andrei):
>
>          std.conv ->  std.convert
>          std.stdio ->  std.io

I guess we can leave these alone.

> All this gives us the following, nice and short (well... shorter, at
> least) module list:
>
>          std.algorithm
>          std.array
>          std.base64
>          std.bigint
>          std.bitmanip
>          std.character
>          std.complex
>          std.concurrency
>          std.container
>          std.convert
>          std.datetime
>          std.encoding
>          std.exception
>          std.file
>          std.format
>          std.functional
>          std.getopt
>          std.intrinsic
>          std.io
>          std.json
>          std.math
>          std.md5
>          std.metastrings
>          std.mmfile
>          std.numeric
>          std.outbuffer
>          std.path
>          std.process
>          std.random
>          std.range
>          std.regex
>          std.signals
>          std.socket
>          std.stdint
>          std.string
>          std.sysinfo
>          std.traits
>          std.types
>          std.variant
>          std.xml
>          std.zip
>          std.linux
>          std.windows

Looks good to me. There's no std.osx to complement the other two.


Andrei


More information about the phobos mailing list