Most of the math/bits package is recognized by the compiler and intrinsified down into 1 or a few CPU instructions (not function calls) on almost all architectures.
In a git checkout of Go, look at e.g. `git grep Div64 src/cmd/compile`.
However, based on this comment [0], it looks like Go does use Knuth's algorithm when dividing arbitrary-precision integers.
[0] https://github.com/golang/go/blob/2e94401277128f9e08e3319903...
IIRC, both (well, CPython and MRI) internally use distinct “small integer” and “big integer" representations, but that is transparent to the user. I'd imagine that they different low-level operations are involved depending on the internal type.
I think, on 32bit platforms (though we're about 10 years removed from actual expirence) they'd go int -> long -> bignum as needed.
https://github.com/micropython/micropython/blob/4fc2866f4569...
This seems to be correct for MRI. Before Ruby 2.4, both `Fixnum` and `Bignum` were exposed to the programmer. In 2016 these were unified into `Integer` from the programmer's point of view, but with "no internal representation change" [0].
> "Normal" ints in Python are certainly native. You don't get bignums until you need them.
However, I don't think this is true for current versions of Python. As part of the 2.x => 3.0 transition, Python underwent a similar unification of integer types. Python 2.x exposes both `int` and `long`, and Python 3.x has only `int`. However, internally, 3.x's `int` is represented by `PyLongObject` and the old `PyIntObject` has been removed. Even the small integer cache (which holds the values -5 to 256) was changed from holding `PyIntObject`s in 2.x [1] to hold `PyLongObject`s [2].
So it looks like in Python 3.x, all integers are arbitrary-precision. I believe this was a significant contributor to early versions of Python 3.x being slower than 2.x.
[0] https://rubykaigi.org/2016/presentations/tanaka_akr.html
[1] https://github.com/python/cpython/blob/8d21aa21f2cbc6d50aab3...
[2] https://github.com/python/cpython/blob/39f643614d03748a5fad4...