You are not logged in.

#1 2016-09-09 15:03:53

jdarnold
Member
From: Medford MA USA
Registered: 2009-12-15
Posts: 485
Website

Some problems with Swift programming on Arch

I installed the Swift package and am trying to do some Swift programming. Not my idea, but I got some Mac programming thrust upon me, along with a very very slow and old Mac laptop to do it on, so I'm looking for any alternative.

But I've run into a couple problems, one annoying and one deal breaking. The deal breaking problem is that I can't seem to import the Foundation classes:

import Foundation

// Make an URLComponents instance
let swifty = NSURLComponents(string: "https://swift.org")!

// Print something useful about the URL
print("\(swifty.host!)")

Just gives me:

$ swift test.swift 
test.swift:1:8: error: no such module 'Foundation'
import Foundation

Darn. Foundation classes, although still pretty early, would help a lot in my Swift progression.

The annoying thing comes up when using the Swift interpreter. After I enter the first line, the backspace key no longer works and all the command line echoing gets screwed up. I've tried a ton of different terminals, to no avail. I'm thinking an stty setting or a TERM setting or something might help. Backspace deletes just fine on the first line, but once it interprets a line, the readline seems to go kablam.

Any ideas on these?

Offline

#2 2016-09-13 10:48:18

basica
Member
From: Australia
Registered: 2012-10-31
Posts: 217

Re: Some problems with Swift programming on Arch

Might be a problem with the PKGBUILD building support for the foundation classes. I would see where the package files are stored and if they seem to exist by running a pacman -Ql against the package name to see the list of files. Lastly, have you tried manually compiling it to see if that works? This makes it seem pretty straightforward, but YMMV.

Offline

Board footer

Powered by FluxBB