[phobos] Phobos has way too many modules

Lars Tandle Kyllingstad lars at kyllingen.net
Wed Sep 15 04:56:14 PDT 2010


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
        std.boxer      - superseded by std.variant
        std.contracts  - superseded by std.exception
        std.cstream    - superseded by std.stdio.File
        std.demangle   - superseded by core.demangle
        std.iterator   - superseded by std.range
        std.openrj     - obscure format, better to use std.json
        std.perf       - superseded by StopWatch
        std.regexp     - superseded by std.regex
        std.stream     - ranges are the way to go
        std.syserror   - superseded by std.windows.syserror
        std.c.*        - superseded by core.stdc.* and core.sys.*

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?)
        
And finally, some renaming suggestions (which were actually posed by
Andrei):

        std.conv -> std.convert
        std.stdio -> std.io


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


Just something to think about.

-Lars



More information about the phobos mailing list