Feedback on Streams concept, similar to Ranges

Andrew andrewlalisofficial at gmail.com
Mon May 15 10:45:12 UTC 2023


On Monday, 15 May 2023 at 10:26:24 UTC, Sergey wrote:
> 1) Does it support auto buffer for performance purposes 
> (something like BufReader/BufWriter in other langs , for 
> example 
> https://zig.news/kristoff/how-to-add-buffering-to-a-writer-reader-in-zig-7jd)

I haven't added such a buffered wrapper type to this library yet, 
but now that I read that article, it seems entirely doable to add 
that to this implementation, so I'll do that shortly!

> 2) while implementing have you consider to look into undead 
> repo? 
> https://github.com/dlang/undeaD/blob/master/src/undead/stream.d

undead/stream.d is, as far as I can see, a purely OOP-style 
approach to IO streams, which looks like it's loosely inspired by 
Java/C#, while my streams implementation does offer an OOP 
interface (like Phobos does for ranges), the main goal is to use 
compile-time checks to let anything be a stream if it behaves 
like one.

> 3) will it be possible to connect it with things like Kafka?

Well, yes, that is possible, but I don't personally have much 
experience with Kafka's binary protocol. But generally, it should 
be rather trivial to translate existing implementations that use 
a similar IO approach to my proposed streams implementation.




More information about the Digitalmars-d mailing list