Apple's Swift 4.0 Includes A Compatibility Mode For 'The Majority' Of Swift 3.x Code (infoworld.com)
An anonymous reader quotes InfoWorld:
Swift 4.0 is now available. It's a major upgrade to Apple's Swift, the three-year old successor to the Objective-C language used for MacOS and iOS application development. The Swift 4 upgrade enhances the Swift Package Manager and provides new compatibility modes for developers. Apple said Swift 4 also makes Swift more stable and improves its standard library. Swift 4 is largely source-compatible with Swift 3 and ships as part of Apple's Xcode 9 IDE...
Swift 4's new compatibility modes could save you from having to modify code to be able to use the new version of the compiler. Two modes are supported, including the Swift 3.2 mode, which accepts most source files built with Swift 3.x compilers, and the Swift 4.0 mode, which includes Swift 4 and API changes. Apple said that some source migration will be needed for many projects, but the number of source changes are "quite modest" compared to many previous major changes between Swift releases.
Apple calls Swift 4.0 "a major language release" that also includes new language changes and updates that came through the Swift Evolution process.
Swift 4's new compatibility modes could save you from having to modify code to be able to use the new version of the compiler. Two modes are supported, including the Swift 3.2 mode, which accepts most source files built with Swift 3.x compilers, and the Swift 4.0 mode, which includes Swift 4 and API changes. Apple said that some source migration will be needed for many projects, but the number of source changes are "quite modest" compared to many previous major changes between Swift releases.
Apple calls Swift 4.0 "a major language release" that also includes new language changes and updates that came through the Swift Evolution process.
- Emphasizes compile time & native code much like C++
- More powerful type system
- Safer language by design
- Native string type built into the language that is Unicode compliant (not a library like C++)
- No header files
- Large standard library (Foundation) being made cross-platform with built-in things like networking, date handling, file system abstractions, regex
- Features to replace the runtime things that GUI programmers found useful in Obj-C/Cocoa, but doing them at compile time and with stronger type safety
- Syntax is not constrained by C legacy compatibility
- Will eventually have stable ABI so you can share binary libraries
This doesn't break shipped apps. Any app using Swift right now deliberately has everything compiled and bundled to be self-contained. Changes to Swift have no impact on shipped binaries.