You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
The text was updated successfully, but these errors were encountered:
It's debatable as to which scope should be moved to the CheckedArithmeticCore.
function definitions
fallback implementations with Any
implementations for Base types
implementations for "stdlib" types
I think 1. and 2. should be in CheckedArithmeticCore; 3. and 4. could be included as well, but I have some questions about the current implementations. For example:
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 likeFixedPointNumbers
. The dependency of a low-level package on a high-level package leads to roughly two problems.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 ofCheckedArithmetic
, even if they do not break the existing API.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 theCassette
'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 onCassette
.I would like to make the
CheckedArithmetic
support not onlychecked
arithmetic, but alsowrapping
andsaturating
arithmetic. (cf. JuliaMath/FixedPointNumbers.jl#152 (comment)) And in the future, I would like to integrate the features intoBase
(Base.Checked
). With this perspective, I think it would be beneficial to make the APIs and the implementations separate.The text was updated successfully, but these errors were encountered: