News for hackers. Stuff that matters.
Re:C++ design goals in the context of Rust (2010) by WalterBright on Saturday June 21, 2014 @03:33PM (#7925854)
One performance issue C has is 0 terminated strings. String processing code is constantly hampered by having to do strlen or the equivalent to find the end of the string. 0 terminated strings also means that 'slices' of strings cannot be strings themselves, a copy must be made.

Of course, a C program doesn't have to use C strings, but so many libraries and APIs do (including the C standard library) that they are unavoidable for most practical purposes.

D eliminates this problem by using dynamic arrays to represent strings. A dynamic array is a pointer/length pair.

Re:C++ design goals in the context of Rust (2010) by nwmcsween on Saturday June 21, 2014 @11:15PM (#7926783)
Pointer, length or start pointer end pointer has overhead multiplied across n strings may even become larger than the strings themselves!
Re:C++ design goals in the context of Rust (2010) by WalterBright on Sunday June 22, 2014 @10:02PM (#7929847)
Over a decade of experience with this in D shows that it's a significant net win.