Embedded Swift in a script. That seems like a useful concept for small scripts on macOS. I will definitely steal this idea.
Swift also has an interpreted mode, you can just
#!/usr/bin/evn swift import Foundation print("Hello, world")
Instead of doing swift in bash and calling swiftc, you can always shell out to Process() from inside a Swift script instead.
Swift also has an interpreted mode, you can just
and chmod +x hello.swift and execute it.Instead of doing swift in bash and calling swiftc, you can always shell out to Process() from inside a Swift script instead.