Unbuffered range interface

Vladimir Panteleev vladimir at thecybershadow.net
Tue Mar 25 23:49:16 PDT 2014


On Wednesday, 26 March 2014 at 00:55:31 UTC, Andrei Alexandrescu 
wrote:
> The recent discussion initiated by Walter points to a problem 
> known since a long time ago: ranges are well modeled by objects 
> in memory (arrays, lists, other containers) but poorly by 
> objects that need to load or construct elements on the fly.
>
> Here are some scenarios that we need to accommodate:
>
> 1. Files and sockets
>
> Fastest access is implemented at the OS level by means of 
> read() that takes a user-provided buffer.
>
> 2. Compression, decompression, encryption, decryption
>
> I think certain sizes would work better than others, but I'm 
> not sure how that all goes. A good case study.
>
> 3. Of course character encoding, decoding, and transcoding.
>
> What set of primitives would work best for all these scenarios 
> and more?

Have you seen Dmitry Olshansky's BufferedRange?

http://forum.dlang.org/post/l9q66g$2he3$1@digitalmars.com


More information about the Digitalmars-d mailing list