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/[email protected]