On 13-05-29 02:40 PM, Gábor Lehel wrote:
> Maybe I'm unusual. But in C++ I'm always super-careful (one might say
> anal retentive) about keeping my headers as clean of implementation
> details as humanly possible. I don't think forgetting a `priv` would
> ever be an issue. But I'm not everyone.

Because Rust does not differentiate between "header" and
"implementation" -- the signatures and metadata are extracted from the
program and compiled-in to the resulting binary -- our experience when
"everything was public" (as it once was, briefly) was that everything
got exported. People just didn't notice all the things they were
exporting, or deferred having to think about it.

At a different time, we had explicit export lists, and a sort of "phase
transition" when developing a library: everything was exported when you
mentioned nothing and were just doing sketches; but as soon as you
mentioned exports, _only_ those things were exported.

This facility was removed when we switched to pub and priv, on the basis
that people complained about having to scroll up and down the screen
looking for the export list.

I think there is no perfect answer here. I'm sympathetic to your
concerns ('pub' was chosen as small as possible, to minimize these
costs) but I think that making everything public by default is a major
hazard for growing private-API dependencies, and would not want us to go
there.

-Graydon

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to