Swift for Linux, on a Mac

This is what a computer linux hacker looks like

This is what a computer linux hacker looks like.

I’ve been working with Swift for Linux, as part of a bunch of teaching material, as well as some conference talks that we’re working on. It’s not super easy to figure out, from searching, the best way to install Swift and Linux, if you’re a Mac user who wants to have a go with it. Here’s what I’ve found.

As it turns out, after extensive research, my feeling is that the best way to run Swift on Linux (on a Mac) is using Vagrant and VirtualBox. I’ve looked at a variety of options, including setting it up manually in a VM, using Docker for Mac, and so on, but this turned out to be the easiest way to do it, and maintain it.

To get Swift on Linux running, on your Mac:

  1. Download and install VirtualBox.
  2. Download and install Vagrant.
  3. Make sure you have Git installed, and clone the following repository: https://github.com/IBM-Swift/vagrant-ubuntu-swift-dev.git
  4. Once you’ve cloned the repository, change directory into it: vagrant-ubuntu-swift-dev
  5. Run the command: vagrant up
  6. Wait. The vagrantfile included in the repository you cloned, which tells Vagrant what to do, downloads Ubuntu 15.10, the Swift prerequisites, the prerequisites for libdispatch, the Swift concurrency library, the Sphinx documentation system, and then clones the Swift repository and creates a script that allows you to build Swift. (This might take a while, and will download a few gigabytes of stuff.)
  7. Once Vagrant is done, you can run the following command to connect to the Linux installation: vagrant ssh
  8. Then, once in Linux, run the following script to build Swift: /vagrant/swift-dev/swift/utils/build-script (This might also take a while, depending on the speed/capabilities of your computer.)
  9. You can then run the following command to verify Swift is up and running: swift –version
  10. You can then create some .swift files, and compile them with the swiftc command.

Easy! Hope that was helpful to someone.

Building Swift Applications

We’re running online Swift programming training with our publisher, O’Reilly Media, in a week or two (July 20 and 21, US West Coast time). You can learn more and register over on the O’Reilly website. We’re really excited! Attendees will all receive an electronic copy of our new Swift programming book, Learning Swift.Building Swift Applications

/dev/world/2016

/dev/world/2016 tickets are now on sale! /dev/world is a fabulous iOS and OS X (and associated ecosystem) developer conference that played no small part in kickstarting many parts of my career, and for the last few years I’ve been helping to organise the event.

/dev/world/2016 runs in Melbourne on August 29-31, 2016. The conference covers developing on and for iOS and OS X, using Swift to Objective-C, and everything in between. We’re selling our best-priced early bird tickets right now over at devworld.com.au

We’ll be announcing more and more sessions, workshops, and feature presentations over the coming week. I’d love to see you in Melbourne! Let me know if you have any questions, or would like to sponsor the event.

/dev/world/2016

Online Swift Training + Book

Learning SwiftWe’re running iOS Development with Swift (programming) training online for O’Reilly Media in July. Registration is now open, and we’d love to have you aboard! Over two days, we’ll take you from no Swift to enough Swift for iOS apps, and an understanding of how to use the iOS frameworks. You can learn more, or register on the O’Reilly website. Attendees of the online training also receive a copy of new book, Learning Swift.

If you just want a discounted copy of our latest book, Learning Swift, you can currently buy the ebook at 50% off through O’Reilly’s Swift sale! Use the code WKLSWFT (works until 5 AM San Francisco time, on June 11).

iOS Developer Training in Melbourne

Secret Lab Developer TrainingHello! We’re running our famous iOS Developer Training again in Melbourne, on May 2 and May 3 this year. We’ll be teaching the latest iOS app development techniques, with Swift. We’re taking expressions of interest, which require no commitment, and will get you a discount code for when registrations actually open! If you have any questions, feel free to email me. Check it, and register your interest, over at the Secret Lab site: http://www.secretlab.com.au/training/ios-mel-2016

Swift is open source!

… and I’ll have more to say on that topic soon! In the mean time:Learning Swift

More soon!

Online Swift Training

This event has now passed! But there’ll be more in the future! If you want to learn Swift, check out our brand new book: Learning Swift.

Online Swift TrainingSuper awesome! Next week we’ll be running live online Swift programming training through O’Reilly Media. You can learn more and sign up over on the O’Reilly Media site.

The gist of it is: you’ll join us live online for a day of Swift programming, where we’ll teach you the language, how to use it for iOS (or OS X) programming, and where to learn more. Everyone will get a video of the training afterwards, as well as an ebook copy of our brand new Learning Swift book.

Two weird tricks to get free tickets to /dev/world/2015

I have the privilege of helping to organise /dev/world/2015, a conference for those developing for, and on, iOS and OS X. It’s a special privilege /dev/world/2015because our experiences with early /dev/world conferences back in 2008 helped us develop connections in the early iOS developer community, and ultimately start our company.

I therefore think that everyone should go to /dev/world, and there are two ways is one way to get there at no cost. Pretty exciting!

Option 1 is to submit a talk to /dev/world/2015. The deadline is 30 June. We’re welcoming to speakers of all levels of experience, public speaking experience, and any other attribute you might care to name. We’d love to have a talk from you! (submissions closed!)

Option 2 is to be a student at a University in Australia or New Zealand, and then join the AUC (it cost a mere $50). Once you’re a member of the AUC, in addition to getting access to discounted tickets to all our other events, you also get free admission to /dev/world/2015. Yep, totally free.

If you’re not a student, and don’t feel like presenting at /dev/world/2015, you can get a discounted Early Bird ticket until 3 August 2015. If you have a question, feel free to email me: paris AT paris.id.au