Hacker News new | comments | ask | show | jobs | submit login

Wonders about the state of Swift on Linux? Was expecting this to be timed with the open source announcement.



"OS X, Ubuntu Linux LTS, and the latest Ubuntu Linux release are the current supported host development operating systems." (https://github.com/apple/swift/tree/master/apinotes)


Looks like they have builds for Ubuntu 14.04 and 15.10. I expect they would work on other debian-based linuxes (linuces?) but haven't tried.


Here are my results on a Debian jessie box:

If you just want to play with the REPL (usr/bin/swift in the Ubuntu 14.04 snapshot), all you have to do is:

  apt-get install python-dev
If you want to actually compile swift files (usr/bin/swiftc in the Ubuntu 14.04 snapshot), it appears extremely basic programs will compile with jessie's clang-3.5, so all you have to do is:

  apt-get install clang
Note that the swift.org instructions claim you need clang-3.6, and you probably do for more complex programs. For that, you'll need to temporarily add a sid/unstable source and upgrade clang:

  echo 'deb http://ftp.us.debian.org/debian/ unstable main' >> /etc/apt/sources.list
  apt-get update
  apt-get install clang
(don't forget to remove the unstable line afterwards).


so actually I'm running into the following error anytime I try to compile something using swiftc with clang-3.6 installed:

  <unknown>:0: error: opening import file for module 'SwiftShims': No such file or directory


And slightly more specific, Swift on Android :) LLVM compiles some code I'm working on to be part of an Android app; so it should not be too hard (as LLVM is Swift compiler backend).


There was a blog post about porting it to Linux before the site went down, so it looks like they're supporting it with this release.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: