Swift for Linux
latest

Contents:

  • Installing Swift
  • Navigating the Ecosystem
    • Pure Swift
    • Libraries
      • Web
      • CLI
      • GUI
      • Parsing
      • Miscellaneous
      • Submitting
  • Distributing Swift Applications
  • Extra Credit: Swift on Other Distros
Swift for Linux
  • Docs »
  • Navigating the Ecosystem
  • Edit on GitHub

Navigating the Ecosystem¶

Now that Swift is installed, there’s still a major problem: the ecosystem. Many Swift libraries are designed with macOS and/or iOS in mind, meaning they rely (either intentionally or accidentally) on Cocoa APIs and Darwin C library bindings.

Pure Swift¶

The best indicator that a library will work on Linux is if it mentions pure Swift somewhere in the name. This term basically means that it likely won’t depend on any Cococa APIs, at minimum.

In addition, the presence of a Package.swift file, used by the Swift package manager, means that it doesn’t require something like CocoaPods to build.

Note that when I say pure Swift, I’m not referring to this GitHub organization. Although they create pure Swift libraries, that’s about it.

Libraries¶

Here are some awesome libraries that work on Linux:

Web¶

  • Vapor: A popular backend web framework. The developers also maintain the PPA mentioned in Installing Swift.
  • Kitura: A web framework by IBM. Note that, although they have Linux support, the documentation is very macOS-centric. It tends to assume you develop on macOS and deploy to Linux.

CLI¶

  • Console: A fantastic CLI library that’s part of the Vapor project.
  • Progress.swift: Progress bars.

GUI¶

  • SwiftGtk: GTK+ bindings. These seem to be rather complete and are auto-generated.
  • Qlift: Qt bindings. Not sure how complete these are.
  • Cacao: A UIKit implementation that works on macOS and Linux. No commits since late 2017, and there are open bugs related to building it.

Parsing¶

  • Kanna: HTML parsing.
  • SwiftSoup: HTML parsing.
  • Yams: YAML parsing.

Miscellaneous¶

  • Regex: Regular expressions.

Submitting¶

Feel free to submit more libraries!

Next Previous

© Copyright 2018, Ryan Gonzalez. Revision 666d8274.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
Downloads
pdf
htmlzip
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.