- Swift Game Development(Third Edition)
- Siddharth Shekar Stephen Haney
- 405字
- 2021-07-16 17:37:40
New in Swift 4.2
This year, we have the release of Swift version 4.2 with Xcode 10. Unlike previous years where we saw a full release of a Swift version, like Swift 3.0 and Swift 4.0, this year, we see the release of Version 4.2. Swift 5.0 has been moved to the sometime early next year in 2019.
Xcode 10 will be the last version to support Swift 3.0 Compatibility Mode. So, if your app uses Xcode version 3, the code needs to be migrated to at least 4.0 by next year.
Further refinements have also been introduced by Apple in Swift 4.2:
- Speedup Debug Builds: Code builds at least twice as fast compared to previous versions of Xcode. This will depend on the nature of the product and how much Swift code it uses. Compilation is optimized to reduce redundant work.
- Runtime Optimization: Swift 4.2 introduces a couple of under the hood runtime optimizations. For example, in 4.2, all intermediate retains and releases of objects are removed and the object only gets released once at the end, improving the runtime of the code. This also enables automatic code size optimization.
- Small String: String is now 16 bites as compared to 24 in the previous version. It also enables a small string memory optimization. If the string is within 15 bites, then the string is represented in the string type without requiring separate allocation to represent the string.
- Reduction in Code Size: There is a new optimization level which reduces the machine level code size generated from the compilation of the swift code. This optimization enables 10% to 30% reduction in code size with a 5% hit in runtime performance.
Swift has already made tremendous steps forward as a powerful, young language. Now, Apple is working on polishing Swift into a mature, production-ready tool. The overall developer experience improves with Swift 4.2.
With Swift 4.2, we are moving toward binary compatibility and with Swift 5.0 releasing in early 2019, this transition will be complete. With this, Apple will be able to ship the Swift runtime along with the OS itself and doesn't need to be included in the App bundle as it is currently. This will improve startup time and memory usage of the application itself. More information about binary compatibility/ abi-stability is available at swift.org/abi-stability.
Note
For a detailed look at what's new in Swift, I highly recommend watching the WWDC 2018 video:
- 普通高校中文學(xué)科基礎(chǔ)教材古典文獻(xiàn)學(xué)基礎(chǔ)
- Hands-On Concurrency with Rust
- 山東圖書館學(xué)史研究
- 醫(yī)藥信息處理與分析
- 李一氓文存(第二卷):存在集三編下冊
- Swift Game Development(Third Edition)
- Rust Programming By Example
- 移動(dòng)社交時(shí)代的電子閱讀
- 高校圖書館休閑功能開發(fā)研究
- 信息檢索與案例研究
- 圖書館服務(wù)均等化與資源共享(上冊)
- 專利計(jì)量與專利合作
- 枝葉情:哲學(xué)·文化·教育論
- 心智與閱讀
- 北京大學(xué)中國古文獻(xiàn)研究中心集刊·第十七輯