Automate all the things with Swift Subprocess

https://news.ycombinator.com/rss Hits: 4
Summary

Swift. The general-purpose programming language designed for safety, performance, and ease of use. This was the sales pitch, but the language has consistently struggled to break out of the prison of the mobile niche, towards other mainstream workflows.Scripting is one of those use cases that has theoretically been possible in Swift since forever, but is so painful to work with, it’s functionally useless, even for trivial workloads.Until today. Kind of. Today we’re going to look at the brand-new, hot-off-the-press, seriously-it-only-got-released-this-Friday swift-subprocess. It’s a new package that promises to solve some of the chronic, incandescent pain points that Swifty scriptwriters were living with.Today, we’re going to look at the weird world of scripting:What is scripting? Why does Swift scripting suck?How can we use swift-subprocess to automate stuff in Swift?(because apparently I’m an influencer now) what do I really think?Subscribe to Jacob’s Tech Tavern for free to get ludicrously in-depth articles on iOS, Swift, tech, & indie projects in your inbox every week. Paid members get several benefits:If you’re not sure about upgrading yet, consider how much of your life you can automate if you got the hang of Swift scripts. Appraise the value of your time. Ponder whether you’ll save more than $12 worth of time in the first month. Perhaps the premium subscription will have already paid for itself!A script is just a text file that gets executed directly by an interpreter. They are perfect for creating “glue” code that stitches different operations and programs together.In UNIX systems, you’ll be familiar with tools like ls, cat, pwd, echo, and mv. These are actually tiny executable utilities installed on your system, such as /bin/ls.Bash scripts seamlessly interact with these utilities because the execution environment is specifically designed to orchestrate processes. In (massively over-) simplified terms, the UNIX shell is a loop that reads a command, spawns a p...

First seen: 2025-10-20 18:06

Last seen: 2025-10-20 21:06