This looks great overall and resolves a real limitation for folks doing low-level numerics work. A couple questions about finer details:
The proposal states:
The implementation of init(integerLiteral:) must avoid calling APIs that may use Self -typed literals, which would trigger infinite recursion.
Can we detect this in the compiler and make it an error with an appropriate diagnostic like error: Using a literal of type $TYPE_NAME in its own literal initializer would cause infinite recursion?
/// Returns the given value unchanged.
public static prefix func + (_ rhs: Self) -> Self
Does this operator exist only to provide symmetry with negative literals, as pointed out by the inconsistency in the Future Directions section?
Just to clarify the behavior of this operator, since all the examples in its doc comment use UInt64:
public subscript<Element>(_ index: Int) -> Element
This isn't restricted to UInt64, right? If I coerced the results to UInt8, I'd get byte-sized slices of the integer, for example?
Should we change the signature of this to be:
public subscript<Element>(_ index: Int, as type: Element.Type = Element.self) -> Element
so that users have a choice in writing this instead?
let value: StaticBigInt = ...
_ = value[0] as UInt64
_ = value[0, as: UInt64.self]
AFAICT, it's more common in the standard library to not rely only on return type coercion but instead allow the option of feeding the type in as an optional argument (last time I checked, only numericCast didn't permit that).