MuppetGate Posted June 5, 2014 Share Posted June 5, 2014 I've been reading through Apple's manual and I think Swift would make a pretty good scripting language. I don't know if Apple will allow Swift apps to be run from the command line: swift hello.swift "{query}" but would folk be interested in building workflows with it, if they did? Just curious. Link to comment Share on other sites More sharing options...
raguay.customct Posted June 5, 2014 Share Posted June 5, 2014 Swift is a compiler. You can run thing interpreted, but it is designed as a compiler. Therefore, if you create a workflow using it (like I do go), it would run a compiled program. Nothing special for Alfred to support. You can look at my Alfred Time Keeper and Title Case Server workflows to see how to use go in an Alfred workflow. The same procedure would work for Swift. I am currently learning Swift to use it like this. Watch out for future workflows from me that make use of a swift compiled program. Those interested: The minimal hello world program in go compiles to 2.1Mb. The same type of program is only 32K in swift!!!! Carlos-Sz and MuppetGate 2 Link to comment Share on other sites More sharing options...
vitor Posted June 5, 2014 Share Posted June 5, 2014 Swift can be run as a script, so there’s no reason for Alfred to not support it. Link to comment Share on other sites More sharing options...
raguay.customct Posted June 6, 2014 Share Posted June 6, 2014 Other than not everyone will install xcode 6. It is not a normal part of the OS, just an extra that has to be downloaded separately. No different than go, node, or any other alternative language. Link to comment Share on other sites More sharing options...
vitor Posted June 6, 2014 Share Posted June 6, 2014 Good point. Hadn’t remembered that you might only get it with Xcode. Are we sure that’ll still be the case when Yosemite launches, though? Link to comment Share on other sites More sharing options...
raguay.customct Posted June 6, 2014 Share Posted June 6, 2014 That is what the documents say. It is just a developers thing. Just like you have to download Xcode to get any compiling tools on your Mac right now. Link to comment Share on other sites More sharing options...
MuppetGate Posted June 6, 2014 Author Share Posted June 6, 2014 That's a shame. A command-line runtime would be brilliant. Link to comment Share on other sites More sharing options...
deanishe Posted June 6, 2014 Share Posted June 6, 2014 That is what the documents say. It is just a developers thing. Just like you have to download Xcode to get any compiling tools on your Mac right now. You can install Apple's Command Line Tools (free developer account needed) instead of Xcode for compiling code. They're sufficient for compiling most Homebrew libraries, for example, and will save you many gigabytes of disk space. But I'd be surprised if there's a Swift-enabled version version when Yosemite comes out. Link to comment Share on other sites More sharing options...
raguay.customct Posted June 7, 2014 Share Posted June 7, 2014 That's a shame. A command-line runtime would be brilliant. You can run in on the command line if you have Xcode installed: /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift Use the -i flag to interpret the code, no flag compiles it. Link to comment Share on other sites More sharing options...
MuppetGate Posted June 12, 2014 Author Share Posted June 12, 2014 You can run in on the command line if you have Xcode installed: /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift Use the -i flag to interpret the code, no flag compiles it. Fair enough, but it would be great if they baked the runtime hooks into the OS, as they seem to be doing with JavaScript. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now