On Apple Swift

Source: Internet
Author: User

Early this morning, Apple held the Wwdc14, and naturally became the headlines of the major websites. Although the use of Mac OS users for nearly 10 years, but Apple's development platform has not been understood, on the one hand because it does not recognize Apple's user philosophy, on the other hand because of the long-term development of C + +, the objective-c of the grammar of what is good, Even feel weird (personal feelings).

Afternoon browsing the news, but found that Wwdc14 did not release hardware products, but there is a new development language swift release, according to Apple's saying is "innovative new programming language", can't help the language has been curious. Roughly browse the official page

https://developer.apple.com/swift/, take the time to read the Swift tour and find that Swift is interesting, at least for me, much more appealing than objective-c. Here is a rough outline of the initial impression, which may have some mistaken understanding, I hope you correct me.

First, Swift is still a static language, although it incorporates some scripting language features such as:

    • Use.. And... To iterate over the collection
    • function as "First class type"
    • Automatic type deduction for collections
    • A function with multiple return values and a tuple returned
    • An interactive environment similar to the scripting language interpreter

But its essence is still a static language, and eventually it will be compiled into native code. As far as I am aware, this is a good thing, because the compile-time error checking and running performance of a static language is much better than the current dynamic language, especially if the performance/functionality of the mobile platform is more sensitive.

In fact, most of the above characteristics are similar to the nature of syntactic sugar, can reduce some tedious work, but is far from the "innovative." Personally, only the last interactive environment like the scripting language interpreter can be called innovative, which, of course, benefits from Apple's artifact LLVM. I first came into contact with LLVM when I was configuring the VIM C + + development environment, I learned the real-time code completion and error prompt plug-in ycm, the back end is the LLVM generated information called. For a specific introduction to LLVM, please see http://llvm.org/

With an interactive runtime environment, we can enter code like a scripting language and get running results in real time as we do IOS/OSX app development, whether it's learning about cocoa frameworks, learning about Swift syntax, and algorithm validation, Compared with the traditional static language has incomparable advantages. Think about validating a prototype, algorithm, or language feature before, you need to open the IDE, create a new project, enter code, build and run, these steps are often much longer than the encoding process. With this feature, you can just open the interpreter input code just like LUA or Python to see the results.

In general, Swift is still very interested in me, I must take the time to learn more about the relevant information, I hope that the opportunity to learn about the development of iOS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.