An IO Streams Library

Rikki Cattermole via Digitalmars-d digitalmars-d at puremagic.com
Sat Feb 6 17:20:26 PST 2016


On 07/02/16 1:48 PM, Jason White wrote:
> I see the subject of IO streams brought up here occasionally. The
> general consensus seems to be that we need something better than what
> Phobos provides.
>
> I wrote a library "io" that can work as a replacement for std.stdio,
> std.mmfile, std.cstream, and parts of std.stream:
>
>      GitHub:  https://github.com/jasonwhite/io
>      Package: https://code.dlang.org/packages/io
>
> This library provides an input and output range interface for streams
> (which is more efficient if the stream is buffered). Thus, many of the
> wonderful range operations from std.range and std.algorithm can be used
> with this.
>
> I'm interested in feedback on this library. What is it missing? How can
> be better?
>
> I'm also interested in a discussion of what IO-related functionality
> people are missing in Phobos.
>
> Please destroy!

I posted a link to your repo a couple days ago in IRC.
Honestly? I like it. It looks reasonably well made.

There is a bit of work regarding interfaces + ranges.
I.e. Sink really should be inheriting from OutputRange!ubyte

Its no where near Phobos quality and that is ok for now.
I do think given time it could be a reasonably good base to rework 
std.socket, std.stdio, std.stream, std.cstream and std.mmfile into a 
completely new set of modules.

Most of that code it would end up replacing is I think almost 10 years 
old either way its from D1 and I think we can do better.


More information about the Digitalmars-d mailing list