Lots of low hanging fruit in Phobos

Walter Bright newshound2 at digitalmars.com
Thu Mar 6 13:26:46 PST 2014


A major goal for D in the short term is to reduce reliance in Phobos on the GC. 
I was looking at std.string last night, and I noticed a couple things:

1. The inputs are constrained to being strings. This is overly restrictive, the 
inputs should be InputRanges.

2. The outputs should be a range, too. In fact, the string functions should 
become algorithms. Then they won't need to allocate any memory at all.

The existing functions should not be removed, but perhaps rewritten as wrappers 
around the algorithm versions.

I've found that rewriting traditional code, which is what std.string is now, in 
terms of algorithms is a bit mind-bending. But it's well worth it, and fun.

So who wants to step up? Don't have to do the whole thing in one go, just pick a 
function and do that one.


More information about the Digitalmars-d mailing list