Swift on Windows

I’m working with Swift again and decided this time I want to have some fun running Swift across platforms (macOS, Linux, and Windows). Windows is where always have the most doubt, so naturally, that’s where I started.

The good news is that tonight I was able to get the Swift toolchain setup to run the REPL and easily compile a project with the CLI. However, there are some issues to work around with the latest version (5.7).

You should know that you can use Python 3.10, even though the documentation states you should use 3.7.

It seems like using run command on a single Swift file is not supported, or a bug is preventing it in this release. So far, the only way I can compile/run is via a full project.

The REPL will probably not work after installation. This is a known issue and a workaround has been provided thanks to honzaskypala on GitHub.

I’ll be trying this on Linux next. 🙂

Want to connect? Follow me on Twitter and LinkedIn!

Take care.
Stay awesome.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s