Home why Swift
Post
Cancel

why Swift

Why did Apple introduce new programming language Swift instead of embracing an existing one like Java, Python, C++ one that already has community, exiting developers, and lots of resources?

First of all, Apple is very much notorious for ignoring what everyone else is doing, and heading off in their own direction if they think it’s the best solution.

Objectives:

  • To update Objective-C so that we can have a faster, easier, safer language without destroying Cocoa?
  • To take advantage of the headway they have made with compiler technology.
  • To achieve low level work, all the way down to the kernel if needed.
  • Watch kit development.
  • Last but not least, most important goal is interoperation, any replacement would have to work naturally with the existing frameworks.

Currently on plate:

  • Java belongs to someone else and needs a virtual machine.
  • Apple already support C++ to some extent. Including making a connection between C++ and Cocoa. But replacing one complicated C-based language with an even more complicated C-based language would not result in progress.
  • Ruby 2.1, on the other hand, does support keyword arguments that would work with Objective-C. In fact, Apple wrote this at one point—it was called MacRuby. Apple abandoned MacRuby, though, so apparently they weren’t happy with it.
  • Neither Python or Ruby are compiled which rules them out.

So they created Swift, which not only replaces Objective-C but also works with all existing frameworks naturally. And it isn’t particularly hard to learn. By creating their own language from the ground up, Apple is constrained by nothing but their own requirements and resources. Since their requirements are rather specific and their resources include one of the world’s best compiler teams, that’s a pretty good place to be.

How swift is swift?

  1. Static Typing
  2. Value Types
  3. No pointer aliasing
  4. Constants
  5. Copy on write
https://developer.apple.com/swift/
This post is licensed under CC BY 4.0 by the author.