Skip to content

Separation to CheckedArithmeticCore #6

Closed
@kimikage

Description

@kimikage

From the beginning of this package, I have believed that the dependencies on this package would bring in trouble. (cf. JuliaMath/FixedPointNumbers.jl#146 (comment))

The "features" provided by CheckedArithmetic are on a higher level than packages that provide types like FixedPointNumbers. The dependency of a low-level package on a high-level package leads to roughly two problems.

  1. Keeping up with compatibility
    Until CheckedArithmetic reaches v1.0, packages that provide numeric types are implicitly required to keep up with the new version when there are changes to the implementation or functionality of CheckedArithmetic, even if they do not break the existing API.

  2. Weight limit of CheckedArithmetic
    If CheckedArithmetic is "heavy", it affects all users of the package which (indirectly) depend on the package providing the numeric types. Therefore, CheckedArithmetic is implicitly required to be lightweight. I suspect that the Cassette's injection feature could be useful in "end-user" code, but I don't think it is a good idea for packages which provide numeric types to be dependent on Cassette.

I would like to make the CheckedArithmetic support not only checked arithmetic, but also wrapping and saturating arithmetic. (cf. JuliaMath/FixedPointNumbers.jl#152 (comment)) And in the future, I would like to integrate the features into Base(Base.Checked). With this perspective, I think it would be beneficial to make the APIs and the implementations separate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions