On Wed, Jul 10, 2013 at 01:01:01AM +0200, Adam D. Ruppe wrote: > On Tuesday, 9 July 2013 at 22:40:31 UTC, bearophile wrote: > >- A less allocating Phobos to produce a bit less garbage; > > Yes, and options to pass output ranges to more functions too, > instead of always returning gc allocated things. [...]
+1. I think thus far we've only truly explored the input side of the range concept. We should do more with output ranges -- they are a lot more flexible than returning values (be that gc-allocated or not). You can bypass a lot of unnecessary buffering by doing that (think to!string and std.format, for example), which helps performance and reduces garbage for the GC. We should develop some good idioms for chaining / nesting output ranges, so that what is today a bunch of string appends, say, could be a UFCS-empowered chain of output ranges that basically writes the output directly to its destination instead of sitting around in strings or buffers, etc.. T -- Error: Keyboard not attached. Press F1 to continue. -- Yoon Ha Lee, CONLANG