[swift-evolution] Expanded support for numeric types in stdlib?
clattner at apple.com
Thu Dec 3 16:05:55 CST 2015
On Dec 3, 2015, at 1:14 PM, Austin Zheng <austinzheng at gmail.com> wrote:
> Hi all,
> There are quite a few programming languages that provide support for numeric types apart from the customary floating-point and fixed-width integer types. Prominent examples of additional numeric types include rational numbers, arbitrary-width integer types, and fixed-point numbers. Many of these numeric types are applicable to a wide variety of problem domains.
Hi Austin, great to hear from you:
It would be great to consider this. We’ve specifically recently discussed BigInt support, for example.
One of the things that we’d like to see for Swift 3 is a revised set of numerics protocols, to make it possible to write generic numeric algorithms. One concern I have with this is that abstracting over (e.g.) IEEE and rational numbers may overly complicate the protocols necessary to get simple things done.
That said, I’m not an expert on this area, so I’m cc’ing some people who are :-)
> Swift seems like it would be a good fit for stdlib implementation of some of these numeric types. Structs and value semantics, literal initialization, and operator overloading would allow such types to be treated as first-class citizens. Is the community amenable to such a proposal, which would entail the data structures themselves, arithmetic operations, and interoperation between different numeric types to form a numerical tower of sorts?
> Best regards,
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution