Apple's Swift programming language translated to Mandarin Chinese thanks to open source project

Posted:
in iPhone edited August 2015
Coding for Apple devices just got a little easier for thousands of developers in China, as a group of more than 100 programmers recently wrapped up an open source Mandarin Chinese translation of Apple's Swift programming language.



Project creator Jie Liang, currently a student at BeiHang University in Beijing, said in a blog post that the Swift translation was finished last month after a year's worth of open source development, Bloomberg reported on Thursday. Over its lifespan, the translated version has been accessed more than two million times on GitHub, the publication said.

Liang started the enterprise to "synchronize China and the world," alluding to both the current state of modern coding, which is dominated by English-based natural language programming protocols, and the proliferation of Apple's iOS operating system. Code suites based on languages other than English exist, including the Mandarin-friendly Easy Programming Language, but their utility is questionable.

Developers who can't speak English are at somewhat of a disadvantage, as code written in other languages are more difficult to market. English has therefore become the de facto standard of the global coding community. Given Apple's commanding presence in the mobile app marketplace, and its popularity with Chinese users, Liang's Swift translation could open the door to a huge number of iOS and OS X programmers.

Apple's unveiling of Swift in June 2014 came as a surprise to many. The coding language was designed with Cocoa and Cocoa Touch in mind, but also works well with Objective-C, allowing developers to interchange languages.

At its Worldwide Developers Conference in June, Apple surprised developers once again by announcing plans to open source Swift for iOS, OS X and Linux. The company also announced Swift 2, which comes with a number of efficiency tweaks and new features.

Comments

  • Reply 1 of 9
    brakkenbrakken Posts: 687member
    So if this means Linux has potential software and games that function across distros, who needs Chrome or Windows?
  • Reply 2 of 9
    brakken wrote: »
    So if this means Linux has potential software and games that function across distros, who needs Chrome or Windows?

    This isn't all the APIs and Frameworks that make iOS and Mac OSX great. This is just the language. So you cannot just run an iOS game on Linux. You could program a game for Linux in Swift.
  • Reply 3 of 9
    brakkenbrakken Posts: 687member
    This isn't all the APIs and Frameworks that make iOS and Mac OSX great. This is just the language. So you cannot just run an iOS game on Linux. You could program a game for Linux in Swift.

    So even if software is written for iOS, it would still need to be changed significantly to work on Linux hardware systems?

    Thanks for helping me understand.
  • Reply 4 of 9
    konqerrorkonqerror Posts: 685member
    Quote:
    Originally Posted by Brakken View Post





    So even if software is written for iOS, it would still need to be changed significantly to work on Linux hardware systems?



    Thanks for helping me understand.



    Yes, unless somebody reimplemented Apple's libraries/frameworks for Linux. It actually has been done (partially) under the GNUStep project.

     

    This is also what Microsoft is doing with iOS on Windows 10. The Oracle v Google Java lawsuit was whether somebody can legally do that under copyright law, and the answer is yes.

  • Reply 5 of 9
    Here's the github page that this was talking about:

    https://github.com/numbbbbb/the-swift-programming-language-in-chinese

    It looks like this is a translation of the book describing the Swift language, not a translation of the language itself, which is what the article seemed to be implying (and which was surprising me, since AFAIK the source code to Swift hasn't been released yet).

    Also, it took a while to find the github page in question, since the article didn't seem to link to it anywhere. What a great article!
    brakken wrote: »
    So even if software is written for iOS, it would still need to be changed significantly to work on Linux hardware systems?

    Thanks for helping me understand.
    Lots of languages are available cross-platform. C, C++, Objective-C, C#, Java, Python, Ruby, Perl, Haskell, Scala, BASIC, Pascal, x86 assembler, and plenty of other languages can all be used on Mac, Windows, and other platforms. The language doesn't really matter as much here, though; what matters for cross-compatibility is the APIs you use. An API set is like a series of commands that a program can send to the OS to tell it to do things like create a file, open a window, or what have you. Each OS tends to have its own API set, and that means that you can't typically just write native code for one OS and have it magically work on the other.

    What we call a computer "language" is really more analogous to the grammar of a natural spoken language, whereas the API is more analogous to the vocabulary. Say you invented a language whose grammar was identical to that of French, with the same rules for pronunciation, conjugation, etc. as French, but in which the words themselves were all different. You could try speaking to a French speaker in this new language, but the two of you wouldn't understand each other.

    What you can do in C, C++, Objective-C, and Swift (once the open-source code for it is released) is to write all your back-end code that's not dependent on any operating system in that language, and then just write separate versions of the front-end code for each operating system. Another thing that you can do is to use a cross-platform library that basically does this for you, providing a platform-neutral API, that translates to the proper API calls for each operating system. Plenty of these exist; popular ones include wxWindows, Qt, Tk, and the Java JRE. There have also been open-source projects to reimplement the APIs from one operating system on another such as .NET (Mono), Win32 (WINE), and Apple's Cocoa (GNUStep, Cocotron). Many users complain that apps written for cross-platform frameworks tend to have a "non-native" feel to them, however, compared to software written directly for the OS's native API set.

    Fun fact: The predecessor of Cocoa, OpenStep, was actually a cross-platform API toolkit, as it was ported to Windows NT, allowing apps written for NeXT to be effortlessly ported to that platform. Apple at one point was planning to extend this ability to Cocoa under the name "Yellow Box", but this was dropped by the time OS X 10.0 was released.
  • Reply 6 of 9
    knowitallknowitall Posts: 1,648member
    Translating a programming language is insane and would be incomplete without translation all the APIs (which is more than insane).
    It would also create all kinds of incompatibilities.
    Thanks durandal1707 for finding out that the translation is about the swift programming language book not about the language itself.
  • Reply 7 of 9
    Mandarin is a SPOKEN dialect of Chinese, not a written version. There are two written versions of Chinese - the "traditional" and the "simplified"
  • Reply 8 of 9
    john.bjohn.b Posts: 2,742member
    Quote:

    Originally Posted by travelin jack View Post



    Mandarin is a SPOKEN dialect of Chinese, not a written version. There are two written versions of Chinese - the "traditional" and the "simplified"

     

    I logged in to post this.  Mandarin and Cantonese are separate spoken languages, but share the same written language.

  • Reply 9 of 9
    knowitall wrote: »
    Translating a programming language is insane and would be incomplete without translation all the APIs (which is more than insane).
    It would also create all kinds of incompatibilities.
    Thanks durandal1707 for finding out that the translation is about the swift programming language book not about the language itself.
    The title of the book is The Swift Programming Language, so I think what happened is that someone looked at the github project, which is titled "The Swift Programming Language in Chinese", misread that as just "The Swift programming language in Chinese", and then ran with that (without bothering to look at the actual github project at all, of course).
Sign In or Register to comment.