On Apr 20, 2012, at 8:33 PM, Kevin Cantu <[email protected]> wrote:

> The cost isn't an extra byte of storage.  The cost is that every slice
> will have to be a copy+append.
>
> Both D and Go have special slice types to store pointers and offsets
> to the underlying arrays/strings, so slice operations can avoid that
> hit, IIRC.

It would definitely be more forward-thinking to use slices as the
primary native mechanism for passing around strings and
memory-contiguous sequences in general. Regions should help make
data-sharing slices safe to use. Since C calls already require that
arguments be copied to the FFI context, does making null-terminated
copies of strings add that much additional overhead? Copying is pretty
cheap on modern platforms.

-Joe
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to