Why Apple Swift language will rapidly spread

Source: Internet
Author: User
Tags analysis apple apple products applications code company compiled developer

Intermediary trading SEO diagnostic Taobao guest hosting technology hall

REVIEW: According to foreign media reports, "Connection" magazine recently wrote an analysis of Apple's new programming language Swift many advantages. The article said that because the language is easy to use, absorbing the strengths of compiled and interpreted languages, and backed by many Apple products, the popularity of Swift makes other languages ​​unmatched.

According to foreign media reports, "Wired" magazine recently wrote an analysis of Apple's new programming language Swift many advantages. The article said that because the language is easy to use, absorbing the strengths of compiled and interpreted languages, and backed by many Apple products, the popularity of Swift makes other languages ​​unmatched.

The following is the "connection" "Apple Swift will quickly change the programming of the three major reasons" a text:

Chris Lattner spent a year and a half building a new programming language. He did not mention it to anyone, nor even his closest friends and colleagues.

He used the evening and weekend time to do this work, from the summer of 2010 until the end of the second year, the framework of this programming language to build structures, and then disclosed to the company executives secret. The project got the attention of executives, a few senior engineers joined in. After 18 months, the project became the main focus of the company and the project team expanded in size.

Ratner working company, is Apple.

This language is called "Swift." Apple sees it as a faster and more effective tool for developing software applications for iPhone, iPad and Mac. June 2 this year, Apple released to the outside programmers a test version. Even at this time, four years after Ratner first conceived the language, it only had an impact within Apple's internal circle. Ratner Vikram Adve, a graduate student mentor at the University of Illinois at Urbana-Champaign, helped him refine the foundations of the Swift language. Like others, Edfelt was surprised that his students had spent so much time creating a new programming language. "Apple has a very tight-knuckle tone, and Chris really does that," said Adolf with a smile. "I know he spent a lot of time on a project, nothing more."

In general, a new programming language like this usually takes many years to get massively adopted - even with tech giant support of this size. Google introduced a language called "Go" in 2009. Although the designer of this language is famous in the industry, it still has not become the mainstream in the world.

But Swift is another story. By the time it's officially released this fall, it's likely to gain programmers' favor sooner than it has ever seen, and may even surpass Sun's Java language and the limelight of Microsoft's C # language in the late 1990s and early 2000s .

Part of the advantage of Swift is that it's built for ordinary programmers. The language is designed to write the simplest mobile app and comes with a smart gadget that Apple calls Playground. This tool provides a fairly efficient "self-learning" programming approach.

In addition, there is a more straightforward reason why Swift may be swept up. Today, thousands of developers use a language called "Objective-C" to build applications for the iPhone and iPad, which programmers continue to develop in the light of the popularity of Apple devices. And compared to Objective-C, Swift provides major improvements in many areas, which means that the huge Apple developer community will certainly accept the new language in the coming months.

The Tiobe index, which is a measure of how popular the programming language is, wrote Paul Jansen, who has been programming languages ​​for nearly 15 years, said: "There's no real incentive for Google Go, Factor to use it, Swift can provide such an incentive. "

So far, even with a very limited number of users, there are more than 2,400 Swift-related projects on the popular programming site GitHub. And this month, Swift is ranked 16th on the Tiobe global programming language hot list. The situation was similar when Google Go was released in 2009, but the rankings have dropped a lot since then. But for Swift, Jensen's motivation will only push up his position.

Andrei Alexandrescu, the veteran Facebook developer, points out that given Swift's uniquely central position in the industry chain of Apple, "as long as we do not spoof," we certainly will not fail. Not to mention the language barrier is very low. "People are rushing to learn this new language because it becomes easy to use," Jensen said. "Programmers can use Objective-C or Swift, and most people are turning to Swift."

Not just a language

Ratna is responsible for overseeing all of Apple's development tools - these tools allow Apple engineers and external programmers to develop software for the company's computers, laptops, smartphones and tablets. Under Adolf's guidance, the graduate student at the University of Illinois at Urbana-Champaign designed a set of metaprogramming tools called LLVM. This tool is the foundation of Xcode, the main tool for Apple's software development, with the latest version having more than 14 million downloads. In short, LLVM is a way to build and run new applications that work with all programming languages.

Latina joined Apple in 2005. After that, Apple LLVM reshape the way developers use Objective-C to develop applications. Five years later, Ratner again used LLVM as the basis for Swift. Ratner rejected the media interview, but on his profile page there was a brief introduction to the Swift evolution. No matter how unusual this long-term project is, Swift is actually working with Apple's existing development tools - though it offers an alternative to Objective-C.

In other words, Swift is not just a programming language. It's all about what developers need to build their software. Not only does this mean the Integrated Development Environment (IDE), but also other tools like the debugger. Most of these tools are familiar to Apple developers. In other words, Swift is easy to use for thousands of programmers developing applications for the iPhone, iPad and Mac.

There are good reasons to get programmers to switch from Objective-C to Swift, after all, they've never used Swift in the past. "I am the first and only person with 4 years of Swift programming experience," Ratner wrote on Twitter. Learning such a language is a sacrifice of a certain amount of time, which is usually a big hurdle. Mike Ash, who has developed 15-year software products for Apple hardware, said: "Only a small number of languages ​​get enough attention, and most languages ​​are long-term users." Ash is now researching the company This new language.

Fortunately Ratna and Apple have given good reason. For its part, Swift has less appeal than programming languages ​​like C #, Ruby, Python, and others, but has made a big difference from Objective-C. The latter's history dates back to the mid 80s of the last century, and was less likely than the more modern programming languages ​​to be used. Ash said: "Many people gave up because of Objective-C and its less common grammar, and Swift's grammar is more standard and, more commonly, it helps to appeal to people who are interested."

For today's programmers, Swift is not only more familiar - it has a "generic" design that is a reusable base module - and it has tools to avoid programmer mistakes. It provides a feature called "speculative input," a programmer who does not have to spend too much time defining the type of variable used. Ash said: "It can provide a lot of help, you can better understand what you are doing, but also allow the computer to help you to think more clearly things.It allows programmers more efficiently and in less time to complete more Many things. "

And there's the "playground," and many, including Adolf, consider it the most interesting part of the language.

Playground

According to Ratna's personal homepage, "playgrounds" are meant to make programming "more interactive and intuitive." He explained that "playground" is heavily influenced by Apple designer Brett Victor Bret Victor) and an interactive programming system called Light Table. Like the Light Table, Swift's Playground lets users write code on the side of the screen and see the effects of the run on the other side.

In an introduction to Swift at the Apple Developers Conference in early June, Ratner demonstrated how to modify a game in real time using Playground. In short, the tool can add new code to the software without having to recompile or restart the entire program. Chris Granger, creator of Light Table, said: "It can inject changes into a running process - into the running process."

Not only does this make programming easier, but it also provides a better way to learn programming - letting everyone learn that skill. "Hopefully the more intuitive and fun programming endeavors will appeal to the next generation of programmers and redefine the teaching of computer science," Ratner wrote.

Light Table does something similar - and it can do this in multiple languages, such as Python, Clojure, and Javascript. But for the Grand Court, the "playground" is more practical because Swift specifically optimized for that. "Because they control the language - the language they create - and their goal is to do it, and they can do things we can not do in other languages," he said.

This is also an immediate motivating factor. A major factor that hinders the popularity of programming languages ​​is that programmers do not have time to learn. "Playground" has the ability to reduce learning time. According to Ash, "playground" is still buggy, but has the potential to make programming smoother. "In general, programming is time consuming - take the time to look at the feedback - figure out what you're doing, but the feedback provided by the 'playground' is real-time, which can appeal to a lot of new people."

speed

Another advantage of Swift is reflected in Playground, which is responsiveness. It compiles quickly, which means that the transition from source code to executable applications is very short; compiled applications run very fast, which means that programs can run at high speeds on a phone or tablet. This is also Swift and other programming languages ​​different places.

In the past, there was a difference between a compiled language like Objective-C and C ++ and an interpreted language like Python, Ruby, and PHP. After the compiled language has finished writing the code, it must wait for the compiler to translate it into executable software. However, once this work is done, executable software runs very fast. An interpreted language can test the program in near real time, but the finished product does not run as fast.

Swift. This new language does not sacrifice speed when it's developed and running. As Ash pointed out, Swift "is both programmer friendly and machine friendly." He said: "The specific effect of how to look at it again, but so far looks good."

This area is not the only apple. Facebook is also making similar attempts at using the "Hack" and "D" languages, while Google is the "Go" language and Firefox developer Mozilla uses "Rust." In some ways, these languages ​​have evolved faster than Swift. Facebook is already using "Hack" to rebuild its own large web service, while Google uses "Go" to improve its internal business.

More importantly, most of these languages ​​are open source. This means that the code behind them is freely available worldwide. In theory, they can more easily run on other company's devices or services. Swift is not open-source - at least not yet - and taking into account Apple's tight grip on the history of its hardware and software products naturally leaves room for concerns whether the company will limit the language's development. Ash said: "Some people worry that Apple will limit the direction of the language development - that is, whether to write cross-platform code and the like."

Even so, Swift's popularity is probably beyond the reach of other languages. Ash believes Apple will eventually open source Swift, and he also believes the language will grow beyond Apple's control - as the language developer, Latina, has deep open-source plots. "He is at the helm, I think he will make the right choice." Before developing Swift, Ratner had built a compiler called "Clang". Clang is open source and is now used by many companies, including Google.

Even if Swift is tightly controlled by Apple, it may outweigh the other languages ​​that have emerged in recent years, and its popularity may soon be faster than in all languages ​​of modern history. This is the advantage of owning iPhones, iPads and Macs.

Indeed, what Swift can do and many others do - some even better. Light Table even has a "playground" alternative.

But Swift is unique.

Related Article

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.