News for hackers. Stuff that matters.
Re:Scripting in Swift by lmedinas on Sunday July 05, 2015 @05:50PM (#9835175)
Why?
Re:Scripting in Swift by MrGando on Sunday July 05, 2015 @09:46PM (#9836157)
Because if you're scripting something out, it's very possible that you'll need to run it outside of a Mac in no time.

Plus, there's no decent dependency management yet and you can't compare the amount of external libraries commonly used for scripting with languages like Python or Ruby.

Scripting out with Swift sounds to me like the usual "Playing with new & Shiny". Which can be OK if you're just playing around, but I wouldn't do it with anything related to a production environment yet.

Re:Scripting in Swift by dottrap on Monday July 06, 2015 @06:11AM (#9837988)

  Because if you're scripting something out, it's very possible that you'll need to run it outside of a Mac in no time.
Yes, it's still early, but with Swift becoming open source, the portability problem will probably become less of an issue.

  Plus, there's no decent dependency management yet and you can't compare the amount of external libraries commonly used for scripting with languages like Python or Ruby.
Thinking about this, I wonder if it is actually as big of a problem as some may think. Swift has built-in automatic bridging capabilities to both C and Objective-C. Assuming this works the same in the REPL/command line (I haven't verified this), then you can directly call every system library on your platform that is written in C or Obj-C (which is all of them). The need to download external modules like in Python or Ruby seems greatly diminished.

And to the portability question, on a Unix platform in general, the majority of libraries available for the platform are C libraries with all the capabilities you normally would have to get as a separate module for Python or Ruby. Since this is all directly available without separate modules, when you do need a feature not installed on your system, you would simply install a C library with that capability through your system's normal packaging management system or build/compile it yourself.

Re:Scripting in Swift by lazerwalker on Sunday July 05, 2015 @11:37PM (#9836605)
> there's no decent dependency management yet

What's wrong with CocoaPods?

Re:Scripting in Swift by MrGando on Sunday July 05, 2015 @11:50PM (#9836642)
Well that depends on the point of view, if you're okay with Cocoapods being designed to modify your Xcode project, etc etc. That should be fine. Again, all of this is a pretty big overhead to just 'script out' something.
Re:Scripting in Swift by K0nserv on Monday July 06, 2015 @07:20AM (#9838241)
The Xcode project integration is optional and can be disabled by passing --no-integrate to the install. Like so

pod install --no-integrate

Re:Scripting in Swift by andreamazz on Monday July 06, 2015 @03:54AM (#9837505)
Nothing. Neither with Carthage. The problem is that they rely on the project configuration (Cocoapods requires also an xcode workspace on top of that). It's a bit overkill for just a script.
Re:Scripting in Swift by andreamazz on Monday July 06, 2015 @06:00AM (#9837941)
Oh, I just reached the point where Ayaka talks about Carthage. That's a pretty straightforward solution, nice.