-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Labels
enhancementNew feature or requestNew feature or request
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 Enabling inregorusthearbitrary_precisionfeature by default onserde_jsoncan impact projects that depend onregorus. #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.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request