I completely agree with this which is why I am happy to discuss such questions with you. But: I think I understand now everything in your post. However, do you understand why BigInt
are very slow
in Julia compared to the integers of other languages like Python, Ruby or Gap where all integers are “Big”
(I found instances where they are 50 times slower, see [A plea for int overflow checking as the default - #46 by Olof_Salberger])?
The reason is that their type BigInt
is a union of a BitsType Int and a Boxed type BigInt with automatic switch from one to the other depending when overflow or when the BigInt becomes small enough to be converted.
I hoped you were going to explain how to achieve this in Julia.
Similarly, I think a Union{Int, Rational{Int}}
where Rationals
with denominator 1 would be automatically converted to integers could be faster than Rationals