[swift-evolution] Epic: Typesafe calculations

Tino Heth 2th at gmx.de
Tue Jan 12 08:22:26 CST 2016


Hi there!

I hope there's still some interest in the topic (or in the cartwheels-video Matt promised ;-) and just finished the draft for a first proposal.
Instead of trying to turn typealias into some sort of newtype, which leaves a lot more questions open as I thought originally, I started with "compile-time parameters":
The name of the feature can be discussed (as well as its details), but it would not only add typesafety to matrix, vector, tensor and other entities, but also offer a simple way to handle computations with physical quantities (three of those should be sufficient in most cases, so the idea mentioned by Thorsten should work fine).

I still haven't taken the time to take a detailed look at boost units, but I would be glad if someone with practical experience could contribute to the proposal — the same is true for all other parts, as I'd happily turn the document into a joint paper (I'm not sure, but maybe it could even become the first multi-author submission :)

To make this easier, I created a wiki-page; this should be editable without forking a repository (I haven't figured out if a can give write permissions to everyone, so it might be necessary to click somewhere to request permissions).
The URL is
https://github.com/SwiftTypesafeCalculations/Home/wiki/Compile-time-parameters

Happy collaboration!
Tino


More information about the swift-evolution mailing list