Skip to content
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

Version 2 Roadmap planning #354

Open
8 tasks
paupino opened this issue Apr 23, 2021 · 1 comment
Open
8 tasks

Version 2 Roadmap planning #354

paupino opened this issue Apr 23, 2021 · 1 comment

Comments

@paupino
Copy link
Owner

paupino commented Apr 23, 2021

Some thoughts for version 2 of the Decimal library. Issue numbers will be added as they are created.

  • Define updated rust minimum version.
  • Remove deprecated functions/features.
  • Disable all features by default - make opt in. std is only required by default IF it is required.
  • Review API design. It is a little inconsistent in places - it'd be nice to make this more consistent and extensible. Some guidelines for API design may be useful. Related to Review error handling within Decimal #49.
  • Investigate u128 optimizations when performing 96 bit operations. The hypothesis is that I can squeeze further performance from more complex numbers. Related to i128/u128 based implementation #135.
  • Investigate configurable precision decimals, perhaps leveraging constant generics. Reduced precision is easy, however greater precision is an interesting challenge since current optimizations won't hold true. This requires some experimentation to figure out if anything makes sense within this library or whether it's a variation. Related to i128/u128 based implementation #135 and Plans for const generics? #310.
  • Remove From support for Decimal. Decimal::from((u128|i128)::MAX) panics at runtime, TryFrom looks like the only reasonable approach. (excerpt: "Note: This trait must not fail. The From trait is intended for perfect conversions. If the conversion can fail or is not perfect, use TryFrom").
  • "Strict" mode. This will allow for explicit underflow handling (e.g. return an error instead of rounding).
@paupino
Copy link
Owner Author

paupino commented Mar 4, 2022

Brainstorming thread:

Lazily evaluated rational numbers? i.e. maintain precision until absolutely necessary. Could be a different type using decimal as a subset.
Const generics - should this be the underlying type (e.g. u32 vs u64 vs u128) or the size of the words (e.g. 4, 8, 16 etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant