Alexito's World

A world of coding 💻, by Alejandro Martinez

Scripting helpers for Swift

One of the most exciting things in Swift is the possibility to write and run scripts. It turns out that writing scripts is one of the best ways to learn a new language, that's how most people learn Ruby or Javascript (since node.js).

Swift has a lot of power to become a really good scripting language so I started translating some scripts that I had to Swift. Soon I found that I could write some little helper functions to make things easier while surfing my computer.

Foundation is a really good API, and this give us a loot of power to make cool things in our Scripts. We have all the power that our Applicatoins have, and this is huge. I writed a helper class and it's now in GitHub, CommandLineHelper. It just conatins some functions to deal with directories and files hiding the Foundation API.

One of the things that I still miss is a really good HTML scraping library like other languages have. I hope that soon we start seeing libraries that not only help us develop cool applications but also write great scripts.

I would love to se Swift not only as a big scripting language but also as a big server side langauge.

If you liked this article please consider supporting me