December 25, 2024

Apple Ports Its Swift Programming Language to Linux

Posted December 3, 2015 at 4:14pm by iClarified · 13539 views
Alongside its open sourcing of the Swift Programming Language earlier today, Apple has announced a port of Swift to Linux.

With the launch of the open source Swift project, we are also releasing a port that works with the Linux operating system! You can build it from the Swift sources or download pre-built binaries for Ubuntu. The port is still a work in progress but we’re happy to say that it is usable today for experimentation. Currently x86_64 is the only supported architecture on Linux.

What’s Working in the Port Today:
● Swift without the Objective-C Runtime: Swift on Linux does not depend on the Objective-C runtime nor includes it. While Swift was designed to interoperate closely with Objective-C when it is present, it was also designed to work in environments where the Objective-C runtime does not exist.

● The core Swift Language and Standard Library on Linux shares most of the same implementation and APIs as on Apple platforms. There are some slight differences of behavior because of the absence of the Objective-C runtime on Linux (noted below).

● The Glibc Module: Most of the Linux C standard library is available through this module similar to the Darwin module on Apple platforms. Some headers aren’t yet imported into the module, such as tgmath.h. To try it out, just import Glibc.

● Swift Core Libraries: The Core Libraries provide implementations of core APIs from Foundation and XCTest to be used on Linux without Objective-C . The intention is that these APIs are available in a cross-platform manner regardless of whether you are using Swift on Apple’s platforms or Swift on Linux.

● LLDB Swift debugging and the REPL: You can debug your Swift binaries and experiment in the REPL just like you do on OS X.

● The Swift Package Manager is a first class citizen as it is on Apple’s platforms.


More details on the Linux port and what's not working can be found at the link below...

Read More