Swift 程式設計語言學習——Swift簡介

來源:互聯網
上載者:User

有的時候,覺得看英文文檔有些費時,看中文文檔怕翻譯不準,有些地方確實不需要摳字眼,當有些地方如果翻譯不精準會產生歧義,所以用這樣對照的方式,順便學習一下Swift。

Swift is a new programming language for iOS and OS X apps that builds on the best of C and Objective-C, without the constraints of C compatibility. Swift adopts safe programming patterns and adds modern features to make programming easier, more flexible, and more fun. Swift’s clean slate, backed by the mature and much-loved Cocoa and Cocoa Touch frameworks, is an opportunity to reimagine how software development works.

Swift 是一種全新的程式設計語言,用於編寫 iOS 和 OS X 應用。Swift 結合了 C 和 Objective-C 的優點,並且沒有C相容性的限制。Swift 採用安全的編程模式並添加了很多新特性,這將使編程更簡單,更靈活,也更有趣。Swift 是基於成熟而且受歡迎的 Cocoa 和 Cocoa Touch 架構,試一次重新構想軟體開發的全新革命。

Swift has been years in the making. Apple laid the foundation for Swift by advancing our existing compiler, debugger,and framework infrastructure. We simplified memory management with Automatic Reference Counting (ARC). Ourframework stack, built on the solid base of Foundation and Cocoa, has been modernized and standardized throughout. Objective-C itself has evolved to support blocks, collection literals, and modules, enabling framework adoption of modern language technologies without disruption. Thanks to this groundwork, we can now introduce a new language for the future of Apple software development.

Swift的開發醞釀很久。為了給 Swift 提供支援,蘋果公司改進了編譯器,調試器和架構結構。我們使用自動引用計數(Automatic Reference Counting, ARC)來簡化記憶體管理。我們在 Foundation 和 Cocoa的基礎上構建架構棧並將其標準化。Objective-C 本身支援塊、集合文法和模組,所以架構可以輕鬆支援現代程式設計語言技術。正是得益於這些基礎工作,我們現在才能發布這樣一個用於未來蘋果軟體開發的新語言。

Swift feels familiar to Objective-C developers. It adopts the readability of Objective-C’s named parameters and the power of Objective-C’s dynamic object model. It provides seamless access to existing Cocoa frameworks and mixand-match interoperability with Objective-C code. Building from this common ground, Swift introduces many new features and unifies the procedural and object-oriented portions of the language.

Objective-C 開發人員對 Swift 並不會感到陌生。它採用了 Objective-C 的具名引數以及動態物件模型,可以無縫對接到現有的 Cocoa 架構,並且可以相容 Objective-C 代碼。在此基礎之上,Swift 還有許多新特性並且支援過程式編程和物件導向編程。

Swift is friendly to new programmers. It is the first industrial-quality systems programming language that is as expressive and enjoyable as a scripting language. It supports playgrounds, an innovative feature that allows programmers to experiment with Swift code and see the results immediately, without the overhead of building and running an app.

Swift 對於初學者來說也很友好。它是第一個既滿足工業標準又像指令碼語言一樣充滿表現力和趣味的程式設計語言。它支援代碼預覽,這個革命性的特性可以允許程式員在不編譯和運行應用程式的前提下運行 Swift 代碼並即時查看結果。

Swift combines the best in modern language thinking with wisdom from the wider Apple engineering culture. The compiler is optimized for performance, and the language is optimized for development, without compromising on either. It’s designed to scale from “hello, world” to an entire operating system. All this makes Swift a sound future investment for developers and for Apple.

Swift 將現代程式設計語言的精華和蘋果工程師文化的智慧結合了起來。編譯器對效能進行了最佳化,程式設計語言對開發進行了最佳化,兩者互不干擾,魚與熊掌兼得。Swift 即可以用於開發“hello, world”這樣的小程式,也可以用於開發一套完整的作業系統。所有的這些特性讓 Swift 對於開發人員和蘋果來說都是一項值得的投資。

Swift is a fantastic way to write iOS and OS X apps, and will continue to evolve with new features and capabilities. Our goals for Swift are ambitious. We can’t wait to see what you create with it.

用 Swift 編寫 iOS 和 OS X 應用將是一個出色的體驗,Swift 之後也會不斷開發新特性和相容性。我們對 Swift 充滿信心,已經迫不及待的想要看到Swift開發出的應用。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.