Sunday 7 June 2015

Why Google and Apple made their own programming languages

Apple reveals Swift at WWDC 2014

At its Worldwide Developer Conference next week, Apple is going to share a success story that a lot of people don't know about.
Almost exactly one year ago, Apple released Swift, a new programming language promised to make it easier to build iPhone and Mac apps than ever before. Developers cheered from the stands.
The vision behind Swift is right in the name. Apple promises Swift is faster to write, and results in faster applications.
That vision resonated: Topcoder, a site where developers go online to complete challenges for cash, says it has 3,700 registered developers interested in Swift, and hopes to build a 20,000-strong community by the end of the year, a spokesperson says.
And Swift frequently tops developer surveys as the language developers are the most interested in by online coder hangouts like Stack Exchange. Last November, a man made $66,000 in a month just by teaching other developers how to use Swift, so strong is the interest.
But Apple isn't the first big tech company to release its own programming language - not by a long shot.
Back in 1991, Microsoft released Visual Basic as a way to streamline the development of Basic, one of the earliest popular programming languages with a graphical user interface (GUI).
More recently, circa 2009, Google released Go, its own programming language.
Programming languages are a matter of religion for so many developers. For Apple, Google, and even Microsoft way back when to release a new programming language means an uphill battle against the habits and routines of developers, who are set in their ways.
So there must be a carefully considered business case for this, right? Apple and Google must make money from this, right?
Except that they don't. Not really.

The tower of babel





Google
One of Google's massive data centers.
The two languages have a lot in common. Both Google's Go and Apple's Swift were designed to fix the problems that developers were having with older programming languages.
Swift is enough like Objective-C, the programming language that dominates iOS coding, that developers picked it up quickly - in fact, it's similar enough that Objective-C and Swift code can be used side-by-side in the same app.
But Objective-C is over 30 years old at this point, and Swift is an effort to modernize it to make apps easier to write and run faster.
Similarly, Go was designed to make it easier to build complex systems. The old workhorses of the networked software programming industry, C++ and Python, just couldn't keep up with the demands that Google was placing on it.
"Go was born out of frustration with existing languages and environments for systems programming," says the official Go FAQ.
Hence, Go was born. It's made to be easier for coders to pick up, but still fixing a lot of the speed and performance problems of its forebears in the era of the gigantic data centers that we call "the cloud." As an open source project, developers all over the world are contributing to Go and making it better.
One fringe benefit for Google and Apple is that making your own programming language makes recruitment easier - for instance, since it builds a lot of its own server applications in Go, Google is more likely to hire a developer who's already proficient in the language since she would need less training.
Plus, any cool problems that developers in the wild solve with languages like Swift or Go, Apple and Google can adopt for their own businesses.
But for the most part, these languages are released into the world for the sole purpose of helping developers build better software.

Swift grows swiftly




Apple
One of Apple's huge data centers.
"The promise of [Swift] is, of course, apps will become more stable," says Jonathan Karon, Senior Software Engineering Manager at New Relic, which makes tools to help devlelopers monitor and debug their software.
More stable software means a better app experience, which makes Apple developers look good, and the iPhone look good by comparison.
Swift has had some early success, but it still needs some work, given that it is only a year old - its horsepower requirements mean that it's hard to write Swift code on a lower-end Macbook, it's still missing a lot of features, and there are ongoing debates in the developer community on whether or not Swift is actually faster than Objective-C.
But developers are bullish on Swift's future.
On the enterprise side, Kuron says that he's finding that an increasing number of New Relic customers are keeping their existing back-end software in place, but that they're using Swift to build the apps that people actually use on their smartphones.
For consumer apps, language-learning app Duolingo is an early adopter of Swift, using it to build its Test Center app. So is Lyft, which builds pieces of its ride-hailing car app on Swift. Streaming service Meerkat is a big fan of Swift, too.
"We love Swift," Meerkat CEO Ben Rubin told Business Insider recently. "And we realize that since it's still a young technology there are gaps left to be filled, so we are looking forward to seeing improvements on the development experience."
Some Internet commenters have wondered aloud if Swift exists because Apple is just trying to build a programming language for iPhones and iPads that makes it harder to bring apps to Android, which might well be so.
But that's probably only part of the reason. Despite its carefully manicured public image, Apple engineers are just as nerdy and excited about solving problems as the next Silicon Valley engineer, and the company's developers likely jumped at the chance to release what it sees as a better solution unto the world.
If you're comfortable using Objective-C, Apple isn't stopping you. It just offers up Swift as an option.
"They treat Objective-C and Swift as equal languages in the documentation," says Sergio Prado, CEO of BodBot, a fitness app for iPhone and Apple Watch. "They're never forward about using Swift."
That said, Prado says that none of BodBot is built on Swift currently since it's just not something he's experienced with. But he says he's watching the language's development with interest.
Apple is expected to announce some of those hoped-for updates to Swift at Monday's WWDC keynote.

Go to go


Wikimedia Commons
The Google Go gopher mascot.
Go hasn't seen the explosive growth of Swift - not least because it targets more complex, so-called "system level" programming.
The Go project has described itself as "designed by Google to help solve Google's problems, and Google has big problems." You can use Go for a mobile app if you really want, but it's not what the language is best at.
Red-hot container startup Docker uses Go for some of its internal projects, as does growing cloud hosting service DigitalOcean. If Swift is for making iPhone apps, Go is for the servers that hold that app's data.
"From our point of view, the language is easy to pick up and performant in production, so we will continue to explore the possibilities," says DigitalOcean software engineer Brian Liles.
But in general, it hasn't taken off yet.
"We're not seeing a lot of Go usage from our enterprise customers yet, outside of some early experimentation in their labs," says Dan Turkenkopf, the Senior Director of Strategic Research of Apprenda, a platform that helps businesses build applications in the cloud.
A major reason for that, says New Relic's Karon, is that Google has a lot of programming intiatives in play. Google has Google Dart, another, far less popular programming language. Google also has experimental new software compilers for Android apps in the works, code-named "Jack and Jill," that may or may not change the way developers have to build their apps.
In other words, Google has a lot of balls in the air, and developers find their attentions drawn in different ways.
"I don't think they have a singular vision for the future," Kuron says.

You can't fix stupid

The final word here is that Google and Apple are both pushing programming languages because new advances in technology are being underserved by existing languages and techniques. It's a way to advance their own agendas, even if it's to get more people interested in what Google and Apple are doing.
But as New Relic's Kuron points out, faster, less buggy code doesn't automatically make your app worth using. Languages like Swift and Go aren't silver bullets that make an app useful or fun to use. You need good design and good features, too.
"Code is not really the part that gates performance on mobile," Kuron says.




No comments:

Post a Comment