On 11-09-07 07:18 AM, Marijn Haverbeke wrote:

But if you ignore the actual binary calling convention, you can think
of this proposal as passing everything by reference. Immediates will
in fact be passed by value, since this is more efficient, but the
difference is not observable in regular, safe code.

I'm mostly ok with this change, subject to some caveats and preferences:

The key phrase in your message is "safe code". Unsafe code can observe it. I want the addr-vs-copy distinction clearly spelled out in either:

  - The language semantics, in the manual.

or

  - Something discoverable at compile time and subject to conditional
    compilation.

A mystery-heuristic that programmers can't depend on is much less attractive. Users are going to write unsafe code that occasionally observes the distinction. I don't want to be hiding this.

Other preferences:

  - I prefer the sigil as + rather than *, matches - for move-mode.

  - I prefer not having a sigil, really, just using the (now existing)
    unary 'copy' operator (works on caller or callee side).

  - the {x} trick can / should be changed to use 'copy' when it occurs,
    presently. I think! Assuming 'copy' is being translated properly
    now.

  - If we can make 'copy' into a library function, all the better; but
    until then I'm ok with it being in the compiler. De-keywording a
    keyword in the future is a harmless change.

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

Reply via email to