Feedback on Streams concept, similar to Ranges

Steven Schveighoffer schveiguy at gmail.com
Mon May 22 12:37:38 UTC 2023


On 5/22/23 6:49 AM, Jacob Shtokolov wrote:
> On Thursday, 18 May 2023 at 16:10:44 UTC, Andrew wrote:
>> So maybe I should focus my efforts there? I don't know yet.

More effort on iopipe is always welcome! The library needs a lot of polish.

> 
> There is definitely a need for a good set of functions that are 
> interchangeable between different file types in Phobos: for instance, 
> Socket seems to have no such primitive as File.byChunk(), etc.

Yeah, this is the intention of iopipe. Once you get to a buffer, you can 
use whatever you want on it. The idea is that I don't have to care 
whether it's a socket, file, or memory buffer, I can run my e.g. parser 
on it.

`byChunk` would be trivial to put on top of this (though there's little 
reason to use it in this context). I already have `delimitedText` and 
the more specific `byLine` pipes, which extend to the next delimiter 
code point 
(https://schveiguy.github.io/iopipe/iopipe/textpipe/delimitedText.html)

What iopipe lacks quite a bit is polish and probably a bunch of 
shortcuts (setting up a buffered stream is a lot more verbose than I 
would like). I also need to really focus on a formatting API.

> So if we can have this kind of functionality somehow compatible with the 
> built-in `std.algorithm` and specifically for IO, that would be really 
> cool!

My next focus is async i/o. That is a precursor to what I really want to 
create -- a web server/framework. It's unfortunately slow going though, 
as this is spare time project for me.

> What's your nickname in Discord, BTW? I feel like there are multiple 
> on-going efforts from different people targeting the same core concept: 
> the easy-to-use IO operations. Would be nice to exchange some ideas!

I believe Andrew's Discord is pretty straightforward. Also feel free to 
ping me if you want to discuss (schveiguy).

-Steve


More information about the Digitalmars-d mailing list