Apple's Swift iOS Programming Language Could Soon Be in Data Centers

Apple created the new Swift programming language as a better way of building apps for the iPhone. Now one company wants to put it on servers.
appleswiftlogoS
Apple

Apple created the new Swift programming language as a better way of building apps for the iPhone, and it was a welcomed thing. Today, about 18 months after it was first unveiled—much to the surprise of the digerati—the language is finding a home on real-world mobile devices.

Richard Plom, who oversees iPhone app development at Vine, says the company's six-second-video app now uses Swift, and other big names, such as LinkedIn and Yahoo, have embraced it as well. The Tiobe Index, a measure of coder mindshare, ranks Swift as one of the Internet's 15 most popular languages—notable heights for a language so young.

But Sean Stephens wants to take Swift further still. He wants to take it into the massive computer data centers that drive our mobile apps and websites across the Internet. This week, Stephens and his new company, PerfectlySoft, released a version of Swift that runs not just on the iPhone and other personal devices, but on the computer servers that deliver data and services to these devices.

This creation is called Perfect. The idea is that coders can now use Swift to build both a mobile app and the server code that drives the app from afar. "For anyone building an app, it's in their best interests to use one language—and the same code—on the front end and the back end," Stephens says.

It's an intriguing idea—though it's still a long way from fruition. Today, Perfect only runs on Apple's Mac OS X operating system, and although OS X is occasionally used on servers, this is far from the norm. But Apple has said it will soon open source Swift, freely sharing the underpinnings of the language with the world at large. Once that happens, Stephens and the rest of the developer community can port the language onto other operating systems, including Linux, which dominates the modern data center.

If nothing else, the Perfect project shows why an open source Swift is so meaningful. The language that drives most iPhone apps today—Objective C—is not open source, and for the most part, it remains limited to Apple devices. An open source Swift could grow to compete with other languages on other devices—and even inside data centers. That's good for the developer world, and well, it's good for Apple. It will bring more people to the language that drives apps on the iPhone. Open source had come to dominate the heart of the software universe, and if it hopes to keep pace with rivals, Apple must expand its thinking accordingly.

Building at Speed

With Perfect, Stephens and company have augmented Swift will the extra tools you need to deploy and run Swift software on the server. Many of these tools were previously built under the aegis of another company overseen by Stephens called Lassosoft. Lassosoft helps coders built applications in a language called Lasso—based on another project that originated inside Apple, back in the '90s—and Stephens has now applied this work to Swift.

This particular project is only just getting started—and it won't really get going until Apple open sources Swift. But one way or another, Swift will end up as a server-side language. That's the way the coding world is moving.

More and more, coders are using the same language on the server as they use on client. A tool called Node.js, for instance, lets you build server software in Javascript, the language originally designed for building applications inside web browsers. Java—not to be confused with Javascript—is the primary means of building apps on Android phones, and it has risen to new importance in data centers.

Meanwhile, in a larger sense, coders are increasingly using languages that let them not only build server software that can efficiently juggle myriad tasks at the same time, but build this software at a rapid pace. After all, that's what the Internet is all about: building apps that can handle lots o' traffic, and building them quickly. That's the only way to keep up with the competition. With this in mind, coders are turning to languages like Google Go and Erlang and Rust. With Erlang, the Facebook-owned WhatsApp serves over 900 million people with only 50 engineers.

According to Adam Jacob, chief technology officer at Chef, a company that helps businesses build and deploy data center software, a server-side Swift would play into this same trend. It's designed for building code at speed, and this code is suited to running modern online services. "This is super-interesting, from a language point of view," Jacob says. "Swift feels similar to Rust. They give you a pretty expressive foundation that compiles to pretty low-level code."

In other words, you can easily express what you want to do—easily build the app you want to build—and the software will operate at a level that is very close to the hardware, that provides extreme speed. Other languages—including Go and a language called D as well as Rust—give you much the same opportunity. But there are always trade-offs. Coders will find one language more comfortable than another. A server-side Swift can appeal to those who build Swift apps on the phone. And perhaps others.

That's why Stephens is building Perfect. Now, all we need is an open source Swift. And according to Chris Lattner—the man who dreamed up the language—that day is only weeks away.