Revisit big float support
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 346
- Forks
- 75
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 15
Description
Today Regorus defaults to big floats to pass the OPA test suite. However, this is not ideal for the following reasons
- Performance. Big floats are more expensive than u64, i64 or f64.
- OPA's big number support isn't well defined. See issue, issue etc.
- serde_yaml does not support arbitrary precision
- Policies that use big floats may be fewer than ones that don't.
- Using
arbitrary-precisionfeature in theserde-jsoncrate has repercussions on other uses of json in an application. See #199
For these reasons, it is better to
- Default to regular precision
- Implement an optimal Number representation that can handle u64, i64 and f64 and arithmetic between them
- Provide a way for users to opt into big float support.
Lack of support for big float by default will cause an incompatibility with OPA. But it is justified since big float support itself isn't that will defined in OPA, and users can always opt in explicitly if needed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name files or tests. Start by locating Regorus's number representation and its serde_json and serde_yaml integration, then review how arithmetic and defaults are tested. Done means regular precision is the default, u64/i64/f64 arithmetic is handled by an appropriate representation, and users can explicitly opt into big-float support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100