On 11/11/2013 03:52 PM, Gaetan wrote:
Can we have Two rust?

The first one would be easy to learn, easy to read, and do most of ones
would expect: on demand garbage collector, traits, Owned pointers,...
>
The second one would include all advanced feature we actually don t
need everyday

This is a special case of the general design principle: push policy
choices up, implementation details down.

There's no need to choose between M:N vs. 1:1 threading, or contiguous
vs. segmented stacks, at the language design level.  It just takes
different kinds of spawn(). The default chosen is whatever works most
transparently.  Similarly, a thread with a tiny or segmented stack is
not what we usually want, but when we (as users) determine we can live
with its limitations and costs -- including expensive call/return
across segment boundaries, and special ffi protocol -- there's no
fundamental reason not to support it.

There are practical reasons, though.  Each choice offered adds to the
complexity of the implementation, and multiplies the testing needed.
We don't want it to be very expensive to port the rust runtime to a
new platform, so these special modes should be limited in number, and
optional.  Ideally a program could try to use one and, when it fails,
fall back to the default mode. There is no need to make this falling-
back invisible, but there are good reasons not to.

Making the choice of default mode depend on the platform (1:1 here, M:N
there) might force complexity on users not necessarily equipped to cope
with it, so it is best to make the defaults the same in all
environments, wherever practical.

(Graydon et al. understand all this, but it might not be obvious to all
of the rapidly growing readership here.)

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

Reply via email to