-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split num into several crates #102
Comments
The traits are probably the most used part and still the most lightweight, they should definitely be their own crate. |
I think we should create a new crate for the traits and the fractions (and maybe for |
I agree these would be better separate. Really the only reason they're bundled is that In defense of bigint, I think it's nice to have a library that's stable, universal, and pure-rust. Whereas rust-gmp depends on gmp, and ramp uses nightly features and arch-specific asm. It's ok with me that those are better than bigint in other ways, perhaps especially performance. |
I'd like to see the traits in their own crate as well. |
To move this forward, we could extract the traits and publish a |
This commit moves the traits module into its own crate. The new crate is publicly imported so that downstream code will work without changes. New code can choose to only depend on the traits crate. Refs rust-num#102
Move segments of library to separate crates Issue #102 - [x] traits - [x] bigint - [x] integer - [x] complex - [x] iter - [x] rational
This seems to be mostly done! The following function could still be moved to a sub crate crate: |
|
Still, I they could be moved to |
Sure, if you want to move them and re-export at the top, that should be
fine.
|
Where should |
Well
|
Move functions remaining in num to num-traits Fixes #102.
Since new functions have been added to |
New functions are generally not a breaking change on their own. Can you
demonstrate a way that this could break someone's code?
|
I thought 0.1 -> 0.2 is for new functions, not for breaking changes. The problem is that to use the new functions in num_traits, you would have to specify 0.1.34 (whatever version when they were moved from num) in the Cargo.toml, which seems counterintuitive, because that's not how it is usually done. 0.2 suggests that new functions were added. |
Cargo's semver has special treatment for leading zeros. 1.x to 1.y would be a compatible upgrade, usually just with added functionality like you say, but 0.x to 0.y is not considered compatible. |
I see. I still think having to depend on 0.1.34 is confusing, but I guess it's ok if it adheres to Cargo's definition. |
Currently
num
mixes functionality that IMHO should be separate:One
,Zero
,FromPrimitive
,ToPrimitive
, ...)range*
The biggest offender are bigints, which are implemented very inefficiently. Real-world programs would probably rather use GMP or
ramp
.The best plan of action would probably be creating the smaller crates and deprecating
num
?The text was updated successfully, but these errors were encountered: