back to article Apple: We'll tailor Swift to be a fast new programming language

Apple stunned the audience at its Worldwide Developers Conference in San Francisco on Monday with a tool few expected: a new programming language for iOS and OS X software called Swift. There already is a programming language called Swift that was developed by the University of Chicago and Argonne National Laboratory for use …

COMMENTS

This topic is closed for new posts.
        1. SuccessCase

          Re: Just what the world needs

          Yes C# is one of the few developments to come out of Microsoft having a high degree of intellectual purity and rigour. It was designed by one of the best in the business and is IMO a very, very good language. And I'm saying that as someone who detests most things Microsoft.

        2. Charlie Clark Silver badge

          Re: Just what the world needs

          A few users is not a success. Where is Go in real-world use, something like 0.01% of developers? I bet there are more active Haskell developers

          No idea and no idea how anyone can reliably collect such statistics: what about all the shell and embedded stuff that never appears online?

          There probably are more people involved with Haskell than Go, though probably has a lot to do with the fact that it's taught at quite a lot of universities. The most recent Go conference managed to garner some 700 participants and I assume some of the sponsors are using it; we know Google and Canonical are.

    1. Mage Silver badge

      Re: Just what the world needs

      And C# is really MS concept of Java, derived from J++

      It's not that bad and does have Mono to run it outside .Net

    2. Greg J Preece

      Re: Just what the world needs

      MS have gained traction with C# but that's really the stand-out counter-example in terms of a new "next best thing" language that has been adopted into the mainstream.

      And let's be honest, while C# is a good language, that's also partly down to what came before it being so hideous.

  1. Snowy Silver badge

    The name...

    Would be good if they used a new name for their new programming language rather than one used by someone else's programming language. No one check the name to see if it was already in use?

    1. Anonymous Coward
      Anonymous Coward

      Re: The name...

      The other lot can just change their name. It's no big deal.

      Yours, S. Jobs

    2. Jordan Davenport

      Re: The name...

      The name's being in use already for similar products didn't seem to stop them with the iPhone or IOS...

    3. Jolyon Smith

      Re: The name...

      Yet another link with remobjects (of Oxygene/Hydrogene fame)...

      When Google decided they wanted to call their browser "Chrome" they had to ask RemObjects to change the name of their programming language (I believe they were compensated for doing so, but even so, it didn't seem to occur to Google to simply change the name of their browser (before it was released)). :)

    4. Anonymous Coward
      Anonymous Coward

      Re: The name...

      What, like Google did with Go? Oh...

      http://en.wikipedia.org/wiki/Go!_(programming_language)#Conflict_with_Google

    5. Adam T

      Re: The name...

      They did the same thing to Versions (the SVN client), when they implemented their fuck-me-where-is-Save As?? feature.. Nobody batted an eyelid.

      Long shadows cover a lot of indiscretions.

  2. Dan 55 Silver badge
    Meh

    No need to be so special, Apple

    The use case they give for Swift is quick game development, but that's already been done elsewhere (Lua), and for everything else there's a proper language like C++. If Apple had made them both first-class languages on XCode everybody would have been happy.

    Oh, and the last time someone decided to make semicolons optional, it didn't work out too well (JavaScript).

    1. JLV

      Re: No need to be so special, Apple

      Lua is a scripting language. Not the same thing at all, re. speed.

      1. Dan 55 Silver badge

        Re: No need to be so special, Apple

        That doesn't really matter with LLVM, Lua and other scripting languages can be compiled.

        1. John Gamble

          Re: No need to be so special, Apple

          Yes, the LLVM aspect caught my attention too. But there are multiple languages now that can use LLVM (including C), so while it's a nice feature in a new language, it's not trend-setting.

          Name-collision problem aside, it looks nice, but so do Google's and Microsoft's offerings, and that's just the corporate side -- the independents' languages are also going strong (yes, even the ones with the scary punctuation marks).

    2. Nigel 11

      Re: No need to be so special, Apple

      Oh, and the last time someone decided to make semicolons optional, it didn't work out too well (JavaScript).

      Works out pretty well in Python. Given tuple assignment you don't often need semicolons, but you can put multiple statements on a line if you want to.

      As for Swift, I lost interest the moment I noticed that variable names are unicode strings not ASCII-alphanumeric strings. Bleugh. Immediate fragmentation of the programming world into human-written-language-script communities. I can process code written by (say) a Frenchman or a Finn. The variable names may be less helpful than ones created by a Canadian or an Ozzie, but at least the necessary processing skill is there in my visual cortex. Which it is not, for a string of Chinese, Japanese, Korean, Tamil, or umpteen other possibilities.

      To say nothing of the fact that there are multiple unicode strings that generate the same visual representation (such as an e with an acute accent). It's bad enough dealing with O and 0, 1 and l and I. FAlL.

      1. Psmo
        Headmaster

        Re: No need to be so special, Apple

        Python v3 integrates unicode identifiers too. Here's the official rationale :

        <PEP_3131>Python code is written by many people in the world who are not familiar with the English language, or even well-acquainted with the Latin writing system. Such developers often desire to define classes and functions with names in their native languages, rather than having to come up with an (often incorrect) English translation of the concept they want to name. By using identifiers in their native language, code clarity and maintainability of the code among speakers of that language improves.

        For some languages, common transliteration systems exist (in particular, for the Latin-based writing systems). For other languages, users have larger difficulties to use Latin to write their native words.</PEP_3131>

        1. Nigel 11

          Re: No need to be so special, Apple

          I think it's a mistake.

          Dealing with a small set of foreign glyphs that are universal in a global programming community, is far better than the fragmentation that arises if every programmer uses their own script for their variables. It'll compile elsewhere, but it might as well be object code for all the use that the source will be outside that linguistic domain. I'll add, anyone who studies mathematics, gets to learn the Greek alphabet, and a few letters from the Hebrew one, and a handful of symbols not taken from any alphabet (eg union, infinity, ...). It doesn't give Greeks or Israelis any mathematical edge.

          I can imagine an alternative universe in which North America was settled by Russians. In that universe, the Cyrillic alphabet might be used globally by programmers. I'd be able to go along with that: learning to recognise a handful of new glyphs isn't hard.

          But learning 6000+ traditional Chinese glyphs in order to code: no way. I'd rebel and create a programming language based on the Latin alphabet. As for those in the far East ... well, China, Japan and Korea have all chosen to map their languages onto the Latin alphabet. Because we got to IT first, or because there are intrinsic advantages to our small alphabet over their huge ones? Don't know, but in China, this happened under Mao when the West was the Enemy, and before IT arrived there.

          1. Horridbloke
            Boffin

            Re: No need to be so special, Apple

            <PEDANT>

            Don't lump all those "far east" languages together...The Korean Hangul alphabet is small and reasonably phonetic.

            </PEDANT>

          2. Anonymous Coward
            Anonymous Coward

            @Nigel11 Re: No need to be so special, Apple

            wow, racism disguised as an argument about programming languages

            1. Anonymous Coward
              Anonymous Coward

              Re: @Nigel11 No need to be so special, Apple

              Racism? I see no racism in that post.

              Please explain.

            2. Anonymous Coward
              Anonymous Coward

              Re: @Nigel11 No need to be so special, Apple

              "wow, racism disguised as an argument about programming languages"

              Grow up you silly student.

          3. Ken Hagan Gold badge

            Re: No need to be so special, Apple

            "Don't know, but in China, this happened under Mao when the West was the Enemy, and before IT arrived there."

            Back in 1949, I don't think the West was the enemy. Japan and the Nationalists were the enemy. Marxism was openly acknowledged as a European idea, which is why Mao spoke of "socialism with Chinese characteristics". Mao was also friendly with Soviet Russia, which *we* might not think of as a western nation but the Chinese certainly do.

            Consequently, 1949 saw the adoption of the Gregorian calendar and the creation of "simplified Chinese" (as distinct from the "traditional Chinese" still used elsewhere). These were presented as good ideas from the West at a time in history when it was still possible to give credit where it was due.

          4. Anonymous Coward
            Anonymous Coward

            Re: No need to be so special, Apple

            > I think it's a mistake.

            Don't worry - Google will soon extend Google Translate to translate the code into English (or whatever) for you.

      2. Gary Bickford

        Programming languages could support internationalization

        Internationalization of programming languages should be fairly easy to do.

        I thought about doing the following for PHP a number of years ago. Have as an optional first line, an instruction saying what language the file is written in. Provide support in the parser the use of an internationalization table, like what is presently common in web pages, frameworks, and many software packages.

        This would require two sets of tables, one for the language's reserved words, and one for variable names defined by the programmer. The first would be essential, the second useful. For full support, it would also be useful to have either an identifier tag in every comment pointing to its translation, or to inline multiple languages in the comment.

        That's really all it would take, and then a code file could be managed simultaneiously by developers in different languages. A good IDE could even make a stab at translating variables and comments on the fly. (I know, hilarity would ensue - but that would make programming more fun!)

        This is so simple, it's rather interesting/odd that it hasn't been done already (AFAIK).

      3. JLV
        Thumb Down

        Re: No need to be so special, Apple

        >Immediate fragmentation of the programming world into human-written-language-script communities

        I fail to understand your point.

        Both of us would hate to read code written with Mandarin characters. So?

        Don't write your code with Mandarin characters. Avoid third party and OSS code using Mandarin characters.

        How is this radically different from avoiding ASCII-only programs written in languages other than English, unless that other language is one you are familiar with? How many German proggies on GitHub? I personally avoid programs written in French as well, though I am bilingual - makes it harder to collaborate with others.

        Giving Chinese coders freedom to write things the way they prefer in no way takes away any of your freedoms. Doesn't mean I am forced to pay or use any Chinese proggies myself, does it?

        It's a big world. Live and let live.

    3. Ian Joyner Bronze badge

      Re: No need to be so special, Apple

      Semicolons were introduced in ALGOL to make multiline statements possible.

      JavaScript might have made a mess of removing them, but it is entirely possible to have such a regular syntax in a language that they are not needed.

      Look at Eiffel for a decent language where semicolons are not needed.

  3. h3

    What about just straight C ?

    1. stucs201
      Coat

      re: straight C

      Huh? Look at it. Definately a curved letter. Nothing straight about it at all.

    2. Destroy All Monsters Silver badge
      Holmes

      What about just straight C ?

      Frankly, you are part of the problem.

      C was something like a cutter from a gore flick in the 80's. It is so now.

      The only good thing about it is brevity of the manual. Which is, of course, very important.

      1. Anonymous Coward
        Anonymous Coward

        @Destroy All Monsters

        I'm wondering what C did to you to cause you to be so bitter about it.

        1. Anonymous Coward
          Anonymous Coward

          @Daniel Palmer

          It's too difficult for him to learn. Poor baby.

          1. Psmo

            No one really recovers from their first unexplained segfault on a progamming assignment, do they?

            1. Anonymous Coward
              Anonymous Coward

              >No one really recovers from their first unexplained segfault

              > on a programming assignment, do they?

              If you are taught C but not taught on how to use a debugger then you need a better teacher I guess.

              C doesn't have super fancy exception handling and most of the time it's up to the OS to catch your mistakes but you can make the same mistakes in almost any language. Your first segfault should serve to teach you how to find your mistake with a debugger (or the raw address and addr2line), what you did wrong and why not to do what you did again in the future.

              I actually like turning up weird issues like compiler optimization errors.. like GCC breaking alignment rules for floats on some ARM machines. Issues like that have taught me a fair bit and earned me some cash in the process.

          2. JDX Gold badge

            re:It's too difficult for him to learn. Poor baby.

            Considering C is easier to learn than C++, or Java, that seems a rather weak attempt at an arrogant put-down. C is one of the easier languages because there is so little to it IMO. I learned C after BASIC and found it easy enough, learning C++ was a bigger jump.

            1. John Gamble

              Re: re:It's too difficult for him to learn. Poor baby.

              "Considering C is easier to learn than C++, or Java, ..."

              Hmm, agree with you on C++, but not on Java, which is pretty easy to learn (note that this says nothing about the relative merits of the languages). The only stumbling block I had was with the memory model, and it's a block that lasted all of five minutes before I got it sorted out.

              And I'm not sure that "easy to learn" should be a deciding factor in language use anyway.

            2. Fibbles

              Re: re:It's too difficult for him to learn. Poor baby.

              "Considering C is easier to learn than C++"

              I'd say C++11 is easier than straight C.

              "Wrap that in a smart pointer" is far easier than "malloc and for the love of god remember to free".

              Still wouldn't teach it as a first language though.

      2. Nigel 11

        C

        C is one of a small set of languages in which it's possible to write a useful operating system kernel. Don't knock it. But also don't use it, if you're not writing something that requires OS-like control over the fine detail of the generated code. And for heaven's sake don't teach it as a first language.

    3. lurker

      The main thing wrong with C is that life's simply too short. Operating systems written in C - great. Fart apps? Overkill really. Just not the right tool for the job.

    4. Ian Joyner Bronze badge

      C is an old language with holes so big you can drive a truck through them. C was developed on the very limited PDP8 architecture and it shows. Time to move on folks.

  4. stucs201
    Joke

    Is it a proper programming language?

    Its said its possible to write FORTRAN in any language. So: can you? If not its no good.

    1. Jordan Davenport
      Joke

      Re: Is it a proper programming language?

      println("FORTRAN")

      1. Nigel 11

        Re: Is it a proper programming language?

        PRINT*,"Swift"

  5. Anonymous Coward
    Anonymous Coward

    "Cupertino spent years developing Swift as a 21st-century language that's suitable for everything from short programs to entire operating systems."

    How on earth do Apple keep initiatives like this from leaking to the press for such a long period of time ?

    1. ThomH

      There were quite a lot of speculation around 2010 of a full-scale switch to Ruby; I guess Apple ended up deciding that they liked the idea but wanted a bit more control and a completely native coupling to the existing runtime?

      1. Charlie Clark Silver badge

        I don't think there was ever a real chance for that to happen and the fact that the presentation makes no reference to Ruby says a lot.

        Much as I like Python as a language I also have to admit that it isn't always the best choice. Google still makes extensive use of it internally but developed Go for the heavy lifting systems work. But having a simpler syntax for app development (assumes the runtime can handles most of the necessary magic) might work quite nicely.

      2. hammarbtyp

        "but wanted a bit more control"

        Ha Ha Ha Ha Ha ...Oh sorry that wasn't an attempt at irony

    2. TheOtherHobbes

      >How on earth do Apple keep initiatives like this from leaking to the press for such a long period of time ?

      Apple pretty much owns the LLVM team, which is not big anyway.

      The only possible leaks would have come from the third-party game houses, and I doubt they had many people working on this.

      So probably only 20-30 people were in on the secret.

      It's also why Apple dumped gcc. (That and crap performance.) With LLVM as the back-end, it's easy(ish) to put a new parser on the front-end without alarming anyone loud.

    3. Anonymous Coward
      Anonymous Coward

      another brick in the wall ?

      The press are also behind that Great Wall of China.

      Time for a cuppa.

  6. tempemeaty

    Interesting how this creates another advantage for Apple

    It looks to me like a good way to get programs running faster on Apple hardware in a way that Microsoft can't follow on their own. I doubt Microsoft has the ability to create a good faster language of it's own like this.

    1. JLV

      Re: Interesting how this creates another advantage for Apple

      >a good faster language

      Hold your horses. This is at a big step beyond slideware, true, and it looks interesting. But let's see how it performs in real life first, before endorsing it as a good language.

      Does it actually work as claimed? Will coders be productive in it? Will there be sufficient libraries and batteries provided? Will Apple support it sufficiently? Will you be able to get 3rd party tools & libraries? Will it be used on a large scale?

      Time will tell.

      Besides D, Go is also similar, but doesn't seem to be getting much traction either yet. To an extent, I guess that's because when we interact with Google's ecosystem we can mosty do it in javascript, other scripting languages or even Java. So the use case for Go is not as clear cut.

      Finally, MS's C# is not that bad a language from what I've seen. Syntactically at least, irrespective of reliance on MS libraries, shifting APIs, Visual Studio shenanigans and other aggravations.

This topic is closed for new posts.

Other stories you might like