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, Interesting) by Sir Garlon on Tuesday June 03 2014, @06:42PM

    by Sir Garlon (1264) on Tuesday June 03 2014, @06:42PM (#50731)

    High-level languages are for humans, not computers. Therefore, programming languages can be designed to support a set of implementation patterns that are usable to a population of developers as they approach certain general classes of problems.

    It seems perfectly reasonable to me that a new language can be tailored to be efficient in a certain domain. Matlab springs to mind: its fundamental data structure is a matrix, and if you learn how to express your computational problems as matrix algebraic problems, Matlab is super fast and efficient to program in. It was mainly developed for electrical engineers, who work with matrices every day. Note the confluence here of a population (electrical engineers) and a dominant paradigm (matrix algebra).

    Is the problem really the existing languages, or is it laziness/insufficient education?

    I wouldn't say a new programming language is a solution to the problem of bad developers. Instead I would say a new programming language can be an optimized tool for building programs in a certain way. If you have a population of developers who are ready to think and solve problems in a certain way, then of course you can optimize a tool (really, a tool chain) to increase productivity and decrease error rates.

    In addition to the mental model that a language supports, there is also the question of how it fits into your tool chain. For example, Unicode support presumably matters a lot if you need to support internationalization to Asian countries. One of the most common criticisms of Python is that whitespace is significant. When I learned Python, I realized that is equivalent to saying "Python wants me to change editors." When I got over that, I made peace with the oddball requirement. Some people do not want to change their tools and for good reason; Python is probably not for them.

    In the case of Apple, Apple has long held the philosophy of vertically integrating the whole user experience. That includes the user experience of developers as well as end users. My experience is limited to dabbling with some iOS apps but it seems to me there is an "Apple way" to design a UI; there is a specific Apple IDE, XCode, that is pretty well mandatory. Under those circumstances it makes perfect sense for Apple to (re)design a programming language to optimally fit into that ecosystem.

    --
    [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
    Starting Score:    1  point
    Moderation   +1  
       Interesting=1, Total=1
    Extra 'Interesting' Modifier   0  
    Karma-Bonus Modifier   +1  

    Total Score:   3