Search code examples
streamdstandard-library

What is the Dlang standard streams module?


What is the Dlang standard streams module?

https://digitalmars.com/d/2.0/phobos/std_stream.html refers to https://github.com/dlang/phobos/blob/master/std/stream.d but this page at GitHub does not exist.

I guess, it is removed because of deprecation. What it is superseded with?


Solution

  • Have a look at the upcoming std.io module. It is intended to provide a "thin, OS-independent abstractions over I/O devices". Here's a short example of this module.

    There's also the more high-level iopipe which uses the upcoming std.io module and provides a nice and efficient range API for I/O devices.

    However, as D is becoming more popular and seeing more usage, the Phobos dev team got more concerned with the quality of the standard modules and thus the addition process got more rigid. In the meantime, dub (D's package manager) became the de-facto package manager for D and it got a lot easier to share new "standard modules" via dub (and having proper SemVer releases for them).

    You might also be interested in Vibe.d (probably the best-known web framework for D), also it defines its own streaming functionality that can be used standalone from vibe-core. See e.g. stream.d for details.

    Last, but not least, std.stream is not fully gone yet and continues to live in undeaD.