What is the difference between swift-sh and Command Line Tool?

Is the only difference between the two is that swift-sh can include external dependencies? (link to swift-sh)

What does swift-sh mean for Swift?

It's just a tool for you to run swift code like command line.

Actually, you can write swift code and run the code using command line tool. The swift-sh makes it easier to finish this process.

One big difference is that in swift-sh, you can use external dependencies. AFAIK, that’s not possible when running it like /usr/bin/swift foo.swift.

Actually, clicking the link you posted and reading the first sentences of the README explains just that.

It does so by building a package that is then run. This recent article on NSHipster also gives a nice overview of what it does.

1 Like