2 ms·
In my own experiments Swift is a fairly "modern" statically typed, functional language with enough ObjC bolted on and mixed in to serve as a suitable replacemen
by tel 12y ago
In my own experiments Swift is a fairly "modern" statically typed, functional language with enough ObjC bolted on and mixed in to serve as a suitable replacement for ObjC.
You can do fairly ridiculous things in the functional fragment of Swift [0][1] which match the expressive power of languages like Haskell/ML/Scala. You also gain the standard complement of
* Immutability all over
* Actually decent type inference
* Optional types
* Anonymous functions all over
* Pattern matching
* Real tuples
* Real sum types
On the OO side you've got powerful generics, classes open to explicit extensions, and protocols (traits, typeclasses, etc) along with a pretty firm commitment to ARC. From my understanding of ObjC there's not a whole lot gained in the OO side of Swift.
* Clear reference/value differences
* No pointers
* No NULL
[0] http://tel.github.io/2014/07/27/calkin-wilf-in-swift/ http://tel.github.io/2014/07/27/calkin-wilf-in-swift/
[1] http://tel.github.io/2014/07/30/immutable_enumeration_in_swift/ http://tel.github.io/2014/07/30/immutable_enumeration_in_swi...