Swift (programming language)

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.10.1[3] Edit this on Wikidata / 5 June 2024 (5 June 2024)
Preview release
Typing disciplineStatic, strong, inferred
Memory managementAutomatic Reference Counting
OSApple's operating systems (Darwin, iOS, iPadOS, macOS, tvOS, visionOS, watchOS), Linux, Windows, Android, z/OS
LicenseApache License 2.0 (Swift 2.2 and later)
Proprietary (up to Swift 2.2)[4][5]
Filename extensions.swift, .SWIFT
Influenced by
Objective-C,[6] Rust, Haskell, Ruby, Python, C#, CLU,[7] D[8]
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, as it is an LLVM-based compiler. Swift was first released in June 2014,[11] and the Swift toolchain has shipped in Xcode since version 6, released in 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]

The current version, 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, in experimental use, for Linux.[25]

  1. ^ U.S. patent no. 9329844
  2. ^ "Swift Has Reached 1.0". Apple. September 9, 2014. Retrieved March 8, 2015.
  3. ^ . June 5, 2024 https://github.com/apple/swift/releases/tag/swift-5.10.1-RELEASE. {{cite web}}: Missing or empty |title= (help)
  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. ^ "Chris Lattner's Homepage". Chris Lattner. June 3, 2014. 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. ^ "influenced by - V documentation". github.com. Retrieved November 3, 2023.
  11. ^ Lardinois, Frederic (June 2, 2014). "Apple Launches Swift, A New Programming Language For Writing iOS And OS X Apps". TechCrunch. Retrieved September 7, 2022.
  12. ^ Protocol-oriented Programming in Swift. Apple Inc. YouTube.
  13. ^ "Concepts are similar to Rust Traits".
  14. ^ 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.
  15. ^ "Apple's new programming language Swift is now open source". The Verge. December 3, 2015. Retrieved December 5, 2015.
  16. ^ "Apple Open Sources Swift in Latest Pitch to the Enterprise". CIO Journal. The Wall Street Journal Blogs. December 3, 2015. Retrieved December 5, 2015.
  17. ^ "Looking back on Swift 3 and ahead to Swift 4". Swift Forums. July 29, 2016. Retrieved November 19, 2018.
  18. ^ "Swift-Evolution". Swift Evolution. Retrieved November 19, 2018.
  19. ^ "The RedMonk Programming Language Rankings: January 2018 – tecosystems". redmonk.com. March 7, 2018. Retrieved November 20, 2018.
  20. ^ Kremenek, Ted (March 25, 2019). "Swift 5 Released!".
  21. ^ Kremenek, Ted (September 20, 2019). "Swift 5.1 Released!". Archived from the original on February 26, 2022. Retrieved October 28, 2019.
  22. ^ Hudson, Paul (June 6, 2021). "What's new in Swift 5.5?". HackingWithSwift.com. Hacking with Swift. Retrieved June 8, 2021.
  23. ^ "Swift 5.9 Released". Swift.org. September 18, 2023. Retrieved October 9, 2023.
  24. ^ Borla, Holly (March 5, 2024). "Swift 5.10 Released". Swift.org. Retrieved March 13, 2024.
  25. ^ "Swift.org". Swift.org. March 2014. Retrieved April 28, 2024.

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne