On 11/04/2013 11:00 AM, Gaetan wrote:
hello

I'm new in the rust dev list, so sorry if the question has already been rised.

But what is the reason to have 2 libraries std/extra? why not gathering all in a single "std" library?

There are a few reasons for the split between std and extra.

In general, we think the correct strategy for organizing Rust code is to use many small crates; one of the main reasons for this is to avoid large compilation times, but there are arguable modularity benefits as well. Personally I'd like to avoid Java's situation where there is one very large monolithic standard library that we have to live with in its entirety forever. The 'vision' currently is to have a rich ecosystem of officially supported packages in addition to the monolithic standard library. Under this scheme libextra will not exist at all, and will instead be broken up into a bunch of individual packages in their own repositories. Packages can be developed and stabilized and deprecated by the larger community on their own schedules, and those that fall out of use can disappear gracefully.

The standard library though is monolithic because it has many complex interdependencies and wasn't developed with any intent to be more modular. In my opinion the definition of std is something like 'all the abstractions that depend on some interface to the compiler (this includes primitive types, the runtime, atomics), plus those that are so common that most moderate-sized software will need them (various data structures, algorithms and OS interfaces)'.

I don't actually recall the original motivation for the split, but this is my current thinking.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to