[swift-evolution] Make generics covariant and add generics to protocols
panajev at gmail.com
Thu Jan 14 03:04:50 CST 2016
To be fair this is not the first nor the last time people wonder if static typing gives an overvalued sense of security while making prototyping and gluing different part of the app together more difficult (https://channel9.msdn.com/Blogs/Charles/JAOO-2007-Bob-Martin-and-Chad-Fowler-Debating-Static-versus-Dynamic-Typing), if the language/compiler should protect you from yourself and if so just how much. Also, still in the interest of fairness, type safety is one of the many things you need when trying to deterministically ensure program safety (Midori post mortem): http://joeduffyblog.com/2015/11/03/a-tale-of-three-safeties/
Still, the ship with Swift has clearly sailed towards static typing with Swift, I think we should work on the other two categories of safety. Waiting next year to deal with concurrency makes sense as we do not want to rush things, but it probably w much hotter topic than static typing in a lot of fields today and if you compare what C++ has available from developers (see Intel Threading Building Blocks for example) shows that there is plenty of exciting stuff ahead :).
Sent from my iPhone
On 14 Jan 2016, at 08:39, Brent Royal-Gordon via swift-evolution <swift-evolution at swift.org> wrote:
>> It doesn't make the type system unsound; the types are mostly checked at compile time but some are runtime checked, either way the types are checked and therefore the type system is sound.
> Runtime type checking is not an adequate replacement for compile-time type checking. Runtime type checking ensures your code does not continue to run if it encounters a type error; compile-time type checking ensures your code is *incapable of encountering* a type error. This is a bit like saying that it's okay to drive drunk because seatbelts and airbags will mitigate the injuries caused if you crash.
> Swift has a lovely property where, if your code is typed strongly enough and compiles without errors, it's probably pretty close to working. I would hate to see that watered down.
> Brent Royal-Gordon
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution