I have been interested in arbitrary precision math for some years but have dabbled in languages other than Swift (Livecode, C++ , Xojo ...). I decided a few months back to finally learn swift and I located the BigInteger library:
I had completed my own Swift module and though it was going well but the above library was much better coded and had much better performance. So I moved my high level code to that library. My main interest is number theory and in particular factorization. I found the multiple polynomial quadratic sieve prime factorization python code below.
and migrated it to Swift. It worked great but I had hoped for better performance. I compared the performance of the code running in Python 3.8 versus Swift and found that Python was about twice as fast. Running the code in Python using the PyPy JIT compiler made the Python code about 12x as fast. Code that I had profiled before in Sage ran about 100x as fast as Swift code.
A few observations: I made a modular inverse function that uses shifts and it made the Swift code about 20% faster but made the Python code considerably slower. I believe that this indicates that the BigInt library has a much slower big integer divide function than Python.
I have also discovered that Sage which depends on sympy is moving to symengine which is a C++ wrapper around the boost C++ library.
My final thoughts are that Swift is never going to have fast numerics until it wraps very good numerics code such as boost. Libraries (modules) written in pure Swift will continue to be too slow to be competitive. My two cents.