On 11-12-24 02:03 AM, Rust wrote:
Hi,
I've opened pull request #1382 to add is_lower/uppercase() to "char".
I wonder if and how we will be implementing to_lower/uppercase()
1) without including libicu in libcore
2) without replicating libicu functionality
My aim at the moment is to make a version of libcore that can do
"reasonable" versions of "basic" operations on unicode str and char
types, without requiring that a very-large and complete implementation
of unicode such as libicu accompany all rust programs. So that would be
a violation of your #2 point: we're duplicating *some* (minimal, modest)
libicu functionality in libcore.
I would then like to provide a binding to libicu -- either in std or as
a separately-packaged crate -- that exposes the "full" set of unicode
operations (regular expressions, date/time formatting, locale-specific
collation, etc. etc.)
Can you point me to a specification of libcore's aim and scope?
https://mail.mozilla.org/pipermail/rust-dev/2011-December/001037.html
I don't yet see why we need to have the modules "char" and "str" in
there at all.
Because they are support modules corresponding to built-in types in the
language. Some operations on them will be much more common than others.
The decision of what is "common" or "basic" is, I admit, a matter of
taste, influenced by many factors. Code-footprint of the logic is one of
them.
I start to think we should have only one correct and complete char/str
implementation and that would be ontop of libicu in libstd.
I disagree. This is analogous to saying that the math library in libcore
(or even libstd) ought to do everything GSL[1] does because that's what
a "real" math library does. It's certainly *nice* to provide such a
"full" library, but it's also nice to provide a more-common subset that
can be shipped without imposing the same code-footprint costs.
(Example: people will likely be shipping rust code on phones. We'd like
them to be able to make a rust program that can be redistributed in a
download size that's less than 16mb, which is how big libicu is.)
-Graydon
[1] http://www.gnu.org/software/gsl/
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev