Unbuffered range interface

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Mar 25 17:55:30 PDT 2014


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?


Andrei


More information about the Digitalmars-d mailing list