$ whois swift
Swift
first released in 2014 · by Chris Lattner, Doug Gregor, John McCall, Ted Kremenek, Joe Groff
$ guessprog --inspect swift
- year
- 2014
- paradigm
- multi paradigm
- family
- c like
- memory
- automatic gc
- binding
- static
- safety
- strong
SWIFT(7)
- AUTHORS
- Chris Lattner, Doug Gregor, John McCall, Ted Kremenek, Joe Groff
- HISTORY
- Chris Lattner, who had earlier created the LLVM compiler infrastructure, started working on Swift in secret at Apple in 2010, later joined by a growing team of engineers. Apple unveiled it as a surprise at its WWDC conference in June 2014, as a safer and more modern replacement for Objective-C. Swift was open-sourced in December 2015 and has since been ported to Linux and Windows.
- USAGE
- The main language for developing apps on Apple platforms (iOS, macOS, watchOS and more), used by a very large community of mobile developers. Server-side and embedded use exists but remains small compared to its Apple ecosystem.
- SEE ALSO
- Swift on Wikipedia ↗
struct Point { var x = 0.0, y = 0.0 }
extension Point {
static func + (a: Point, b: Point) -> Point {
Point(x: a.x + b.x, y: a.y + b.y)
}
}
let path: [Point?] = [Point(x: 1), nil, Point(y: 2)]
let end = path.compactMap { $0 }.reduce(Point(), +)
if let first = path.first ?? nil {
print("from \(first) to \(end)")
}