[swift-evolution] unums in Swift?

Stephen Canon scanon at apple.com
Mon May 9 10:44:22 CDT 2016


What do you find interesting about them?

I haven’t spent more than a few hours reading about them (and the definition of “unum” seems to be a moving target, so I’m not sure that it would have been useful to study them further), but my rough thoughts are:

- SORN are a cute alternative to intervals, but only feasible with *extremely* low precision formats.

- For very low precision needs, fixed point or indexed numbers or lossy compression seem like better options for most cases.

- For “typical” precision and dynamic range needs, hardware floating-point (possibly with a compressed storage format) is just as useful and orders of magnitude faster.

- For limited dynamic range applications, fixed-point formats seem like a much better option (there’s a good opportunity here for library work to make using fixed-point arithmetic less error prone).

- For very high dynamic range applications, fixed-point logarithms or level-index numbers seem like a better option.

Unums are a cute way to mostly unify these ideas into a single type, but that doesn’t actually seem like a good idea to me.  This is very much going to be a jack-of-all-trades, master-of-none situation.

That said, they are an *interesting* idea, so I wouldn’t discourage anyone from investigating them.

– Steve

> On May 7, 2016, at 3:08 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Unums sound very interesting (http://ubiquity.acm.org/article.cfm?id=2913029).  I'm wondering if anyone working on numerics in Swift has considered an implementation in the standard library.
> 
> Matthew
> 
> Sent from my iPad
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list