[rust-dev] strings, slices and nulls

Brendan Eich brendan at mozilla.org
Thu Apr 19 13:42:31 PDT 2012


Graydon Hoare wrote:
>> * C functions that scan for null are inefficient, so they're even more
>> >  likely to be replaced with Rust equivalents than other C functions.
>
> Hm, I think this is not a reasonable stance:
>
> $ find/usr/include/  -name \*.h \
>    | xargs cat \
>    | grep -c 'char\( *const\)\? *\*'
> 10488
>
> There are a lot of C APIs that take strings. "Rewrite the world in rust"
> is going to take a long time.

Also guessing that C code is slow because of NUL-termination searches 
needs evidence. Over my ~30 years of C/Unix I've heard this but I've 
never seen such evidence. Maybe I missed it!

/be


More information about the Rust-dev mailing list