Paradigm | Multi-paradigm: protocol-oriented, object-oriented, functional, imperative, block structured, declarative, concurrent |
---|---|
Designed by | Chris Lattner, Doug Gregor, John McCall, Ted Kremenek, Joe Groff, and Apple Inc.[1] |
Developer | Apple Inc. and open-source contributors |
First appeared | June 2, 2014[2] |
Stable release | 6.0.1[3]
/ 27 September 2024 |
Preview release | 6.0
|
Typing discipline | Static, strong, inferred |
Memory management | Automatic Reference Counting |
OS | Apple's operating systems (Darwin, iOS, iPadOS, macOS, tvOS, visionOS, watchOS), Linux, Windows, Android, z/OS |
License | Apache License 2.0 (Swift 2.2 and later) Proprietary (up to Swift 2.2)[4][5] |
Filename extensions | .swift, .SWIFT |
Website | |
Influenced by | |
Objective-C,[6] Rust, Haskell, Ruby, Python, C#, CLU,[7] D[8] | |
Influenced | |
Rust,[9] V (Vlang)[10] |
Swift is a high-level general-purpose, multi-paradigm, compiled programming language created by Chris Lattner in 2010 for Apple Inc. and maintained by the open-source community. Swift compiles to machine code and uses an LLVM-based compiler. Swift was first released in June 2014[11] and the Swift toolchain has shipped in Xcode since Xcode version 6, released in September 2014.
Apple intended Swift to support many core concepts associated with Objective-C, notably dynamic dispatch, widespread late binding, extensible programming, and similar features, but in a "safer" way, making it easier to catch software bugs; Swift has features addressing some common programming errors like null pointer dereferencing and provides syntactic sugar to help avoid the pyramid of doom. Swift supports the concept of protocol extensibility, an extensibility system that can be applied to types, structs and classes, which Apple promotes as a real change in programming paradigms they term "protocol-oriented programming"[12] (similar to traits and type classes).[13]
Swift was introduced at Apple's 2014 Worldwide Developers Conference (WWDC).[14] It underwent an upgrade to version 1.2 during 2014 and a major upgrade to Swift 2 at WWDC 2015. It was initially a proprietary language, but version 2.2 was made open-source software under the Apache License 2.0 on December 3, 2015, for Apple's platforms and Linux.[15][16]
Through version 3.0 the syntax of Swift went through significant evolution, with the core team making source stability a focus in later versions.[17][18] In the first quarter of 2018 Swift surpassed Objective-C in measured popularity.[19]
Swift 4.0, released in 2017, introduced several changes to some built-in classes and structures. Code written with previous versions of Swift can be updated using the migration functionality built into Xcode. Swift 5, released in March 2019, introduced a stable binary interface on Apple platforms, allowing the Swift runtime to be incorporated into Apple operating systems. It is source compatible with Swift 4.[20]
Swift 5.1 was officially released in September 2019. Swift 5.1 builds on the previous version of Swift 5 by extending the stable features of the language to compile-time with the introduction of module stability. The introduction of module stability makes it possible to create and share binary frameworks that will work with future releases of Swift.[21]
Swift 5.5, officially announced by Apple at the 2021 WWDC, significantly expands language support for concurrency and asynchronous code, notably introducing a unique version of the actor model.[22]
Swift 5.9, was released in September 2023 and includes a macro system, generic parameter packs, and ownership features like the new consume
operator.[23]
Swift 5.10, was released in March 2024. This version improves the language's concurrency model, allowing for full data isolation to prevent data races. It is also the last release before Swift 6.[24] Version 5.10 is currently available for macOS, Windows and for Linux.[25]
Swift 6 was released in September 2024.[26]
{{cite web}}
: Missing or empty |title=
(help)
Swift is proprietary and closed: It is entirely controlled by Apple and there is no open source implementation.
You can imagine that many of us want it to be open source and part of LLVM, but the discussion hasn't happened yet, and won't for some time.
The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
I started work on the Swift Programming Language in July of 2010. I implemented much of the basic language structure, with only a few people knowing of its existence. A few other (amazing) people started contributing in earnest late in 2011, and it became a major focus for the Apple Developer Tools group in July 2013 [...] drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
{{cite web}}
: |last=
has generic name (help)