While progress with Swift on ARM has been very encouraging, there have been a few reports of people having trouble with it. This post is intended to be a step-by-step, starting with a brand-new Raspberry Pi version 2 and a freshly-made Raspian image (note that other distributions might work, I've only verified raspian).
Setup the raspberry pi
I expect that you can ssh to your raspberry pi (hereto referred to as raspi), and that you've run the raspi-config utility.
First, you need to expand the range of debian repositories in order to access the required prerequisites. To do that, edit /etc/apt/sources.list:
and uncomment the last line in the file, which should look like this:
Then, you'll need to update your repositories.
Install prerequisite software
Once that's complete, install clang
Option 1: install from tarball
A tar of the swift installation (usually more up to date) is available from my website. You can install this in either your system root, or into another directory. I do all of my testing with it installed in the system root, and therefore things are more likely to work. However, you're putting your system at more risk by doing that. Keep in mind, though, that you're playing around with alpha-level software on your <$100 computer... YOLO.
Option 2: install with Joe Bell's repo
Joe @iachievedit did a fantastic job creating a debian repository for the swift compiler and tools, and he's hosting it in an amazon aws instance. Taking this route has some huge advantages. First among them is that they're only updated when things are stable-ish. The version hosted at my website can change frequently, and it might even be completely broken!
Now, assuming that everything went according to plan, you should be able to compile programs written in swift. Also, you should be able to use glibc andFoundation.
Not so fast
Ok, so there are some caveats. For one, it seems like the REPL is kinda broken on the Raspi v.2. Joe noticed this, too. I'm not sure what the root cause is for this one. It works on the original raspberry pi (armv6), and it works on the Beaglebone Black and Nvidia Tegra (armv7).
Also, things are very alpha-level, so expect the unexpected.