Swift (programming language)

Swift
Logo
ParadigmMulti-paradigm: protocol-oriented, object-oriented, functional, imperative, block structured, declarative, concurrent
Designed byChris Lattner, Doug Gregor, John McCall, Ted Kremenek, Joe Groff, and Apple Inc.[1]
DeveloperApple Inc. and open-source contributors
First appearedJune 2, 2014 (2014-06-02)[2]
Stable release
5.9[3] Edit this on Wikidata / 18 September 2023 (18 September 2023)
Preview release
5.9
Typing disciplineStatic, strong, inferred
Memory managementAutomatic Reference Counting
OSApple's operating systems (Darwin, iOS, iPadOS, macOS, tvOS, watchOS), Linux, Windows 10, Android
LicenseApache 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]
Preview warning: Page using Template:Infobox programming language with unknown parameter "{ break } name"

Swift is a high-level general-purpose, multi-paradigm, compiled programming language developed by Apple Inc. and the open-source community. First released in June 2014,[10] Swift was developed as a replacement for Apple's earlier programming language Objective-C, as it had been largely unchanged since the early 1980s and lacked modern language features. Swift works with Apple's Cocoa and Cocoa Touch frameworks, and a key aspect of Swift's design was the ability to interoperate with the huge body of existing Objective-C code developed for Apple products over the previous decades. It was built with the open source LLVM compiler framework and has been included in Xcode since version 6, released in 2014. On Apple platforms,[11] it uses the Objective-C runtime library, which allows C, Objective-C, C++ and Swift code to run within one program.[12]

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"[13] (similar to traits and type classes).[14]

Swift was introduced at Apple's 2014 Worldwide Developers Conference (WWDC).[15] It underwent an upgrade to version 1.2 during 2014 and a major upgrade to Swift 2 at WWDC 2015. Initially a proprietary language, version 2.2 was made open-source software under the Apache License 2.0 on December 3, 2015, for Apple's platforms and Linux.[16][17]

Through version 3.0 the syntax of Swift went through significant evolution, with the core team making source stability a focus in later versions.[18][19] In the first quarter of 2018 Swift surpassed Objective-C in measured popularity.[20]

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.[21]

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.[22]

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.[23]

  1. ^ U.S. patent no. 9329844
  2. ^ "Swift Has Reached 1.0". Apple. September 9, 2014. Retrieved March 8, 2015.
  3. ^ "Release 5.9". September 18, 2023. Retrieved September 18, 2023.
  4. ^ "Swift, Objectively". Swift is proprietary and closed: It is entirely controlled by Apple and there is no open source implementation.
  5. ^ Lattner, Chris (June 11, 2014). "Re: [LLVMdev] [cfe-dev] [Advertisement] open positions in Apple's Swift compiler team". Archived from the original on July 14, 2014. Retrieved June 12, 2014. 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.
  6. ^ Lattner, Chris (June 3, 2014). "Chris Lattner's Homepage". Chris Lattner. Retrieved June 3, 2014. 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.
  7. ^ Lattner, Chris (June 3, 2014). "Chris Lattner's Homepage". Chris Lattner. Retrieved June 3, 2014. 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.
  8. ^ "Building assert() in Swift, Part 2: __FILE__ and __LINE__". Retrieved September 25, 2014.
  9. ^ "Influences - The Rust Reference". doc.rust-lang.org. Retrieved May 2, 2020.
  10. ^ Lardinois, Frederic (June 2, 2014). "Apple Launches Swift, A New Programming Language For Writing iOS And OS X Apps". TechCrunch. Retrieved September 7, 2022.
  11. ^ "The Swift Linux Port". Swift.org. Apple Inc. December 3, 2015. Retrieved August 3, 2016.
  12. ^ Timmer, John (June 5, 2014). "A fast look at Swift, Apple's new programming language". Ars Technica. Condé Nast. Retrieved June 6, 2014.
  13. ^ Protocol-oriented Programming in Swift. Apple Inc. YouTube.
  14. ^ "Concepts are similar to Rust Traits".
  15. ^ Williams, Owen (June 2, 2014). "Tim Berners-Lee's sixtieth birthday Apple announces Swift, a new programming language for iOS". The Next Web. Retrieved June 2, 2014.
  16. ^ "Apple's new programming language Swift is now open source". The Verge. December 3, 2015. Retrieved December 5, 2015.
  17. ^ "Apple Open Sources Swift in Latest Pitch to the Enterprise". CIO Journal. The Wall Street Journal Blogs. December 3, 2015. Retrieved December 5, 2015.
  18. ^ "Looking back on Swift 3 and ahead to Swift 4". Swift Forums. July 29, 2016. Retrieved November 19, 2018.
  19. ^ "Swift-Evolution". Swift Evolution. Retrieved November 19, 2018.
  20. ^ "The RedMonk Programming Language Rankings: January 2018 – tecosystems". redmonk.com. March 7, 2018. Retrieved November 20, 2018.
  21. ^ Kremenek, Ted (March 25, 2019). "Swift 5 Released!".
  22. ^ Kremenek, Ted (September 20, 2019). "Swift 5.1 Released!". Archived from the original on February 26, 2022. Retrieved October 28, 2019.
  23. ^ Hudson, Paul (June 6, 2021). "What's new in Swift 5.5?". HackingWithSwift.com. Hacking with Swift. Retrieved June 8, 2021.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne