Browsing posts in: mac

Using Swift REPL from Sublime Text

Sublime Text is by far my favorite text editor. In its rich ecosystem of plugins you can find some absolute gems, and one of those is SublimeREPL which adds support for REPLs of various programming languages directly into your Sublime Text.

Swift is missing from there – but let’s add support for it!

Continue Reading

Using Swift As General Purpose Scripting Language

One of the big advantages of Swift is that it gives you access to all Cocoa APIs and lets you use them in some very flexible ways.

One of those is the possibility to use Swift as a general OS “scripting” language – instead of bash, PyObjC or C or any other option that you might have opted for in the past. Moreover, you can do that entirely from outside of XCode – so write your Swift program in any editor and then simply use Terminal to execute it, as if it was pure script.

The obvious advantage of such approach is that you now have the same single language to handle iOS programming, OS X app programming and generic system/automation tasks that you might want to perform from the command line.

Let’s have a look.

Continue Reading