Stories
Slash Boxes
Comments

SoylentNews is people

posted by martyb on Tuesday June 03 2014, @04:54PM   Printer-friendly
from the swift-language-but-not-so-swift-name dept.

Apple surprised the audience at its Worldwide Developers Conference in San Francisco on Monday with a tool that few attendees expected: a new programming language for iOS and OS X development called Swift (https://developer.apple.com/swift/). There already is a programming language called Swift (http://swift-lang.org/main/) that was developed by the National Science Foundation, some other government agencies, and the University of Chicago for use in parallel computing applications. This isn't that. What it is, is an entirely new syntax that -- in the words of Apple senior VP Craig Federighi, who unveiled it during the Monday morning WWDC keynote -- aims to be "Objective-C without the baggage of C."

Some of that "baggage" will already be familiar to developers who cut their teeth on C but later moved on to scripting languages such as Python (and Federighi compared Swift to Python several times during his presentation). Like scripting languages but unlike C, Swift lets you get straight to the point. The single line println("Hello, world") is a complete program in Swift. Note, also, that you don't even have to end the statement with a semicolon, as you do in C. Those are optional, unless you're combining multiple statements on a single line; i.e. a semi-colon is a statement separator rather than a statement terminator.

In addition to its online documentation, Apple has released an e-book, The Swift Programming Language, that's a free download (https://itunes.apple.com/us/book/the-swift-programming-language/id881256329) from the iBooks Store. To start working with the language itself, you'll need to download the beta release of XCode 6 (https://developer.apple.com/xcode/downloads/), which includes tutorials to get you going.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 3, Informative) by BasilBrush on Tuesday June 03 2014, @09:25PM

    by BasilBrush (3994) on Tuesday June 03 2014, @09:25PM (#50799)

    Swift, like xaml, is an "extra" language; aimed at the folks that are trying to get started programming. It won't be forced.

    I think you misjudge it. First of all it contains every feature that Objective-C has, plus others that Obj-C doesn't have. It's an upgrade not a simple thing for beginners. Plus Apple are claiming it is faster than Obj-C. Whilst the truth of that claim has yet to be tested, it does indicate that Apple expects Swift to be used as the first choice for apps in the future - once it gets past beta.

    I'm in the middle of a project now, and I expect to complete it using only Obj-C. But when I start on my next project, I expect to be using Swift, if it's considered solid enough by then.

    But yes I don't think it'll be forced. Obj-C will still be there, because existing projects need it, and not everyone will want to learn a new language.

    XAML is not relevant. Microsoft has come up with so many programming languages and API layers over the years. And XAML was a markup language for defining interfaces. Objective-C and the Cocoa (NextStep) APIs have been cnsistently the way to produce OSX (NextStep) apps since day one. Other than a half-hearted optional choice of Java for a while, this is the first change in primary language. And it's a general purpose language that supports everything that the proceeding language does. Which makes it different in every way from XAML.

    --
    Hurrah! Quoting works now!
    Starting Score:    1  point
    Moderation   +1  
       Informative=1, Total=1
    Extra 'Informative' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3  
  • (Score: 1) by mrMagoo on Tuesday June 03 2014, @10:04PM

    by mrMagoo (4165) on Tuesday June 03 2014, @10:04PM (#50806)

    Good points.

    Well, in any case, I'll be larnin' up on Swift, and I'm sure I'll be using it before long.

    From what I could see, it seems to be aimed only at iOS.

    I was also talking to one of my Windows chaps, and he said that XAML is not a lot more necessary for Metro stuff, so rumors of its death have been greatly exaggerated.

    --
    "Good judgment comes from experience. Experience comes from bad judgment." -Originally attributed to Nasrudin
    • (Score: 1) by mrMagoo on Tuesday June 03 2014, @10:27PM

      by mrMagoo (4165) on Tuesday June 03 2014, @10:27PM (#50819)

      XAML is not a lot more necessary

      Make that "NOW", not "NOT".

      --
      "Good judgment comes from experience. Experience comes from bad judgment." -Originally attributed to Nasrudin