Hacker News new | ask | show | jobs
by titouanch 385 days ago
Maybe a dumb question, but can this be used to make games for other platforms than MacOS & iOS?

My (limited) understanding is that Swift is mostly used to make iOS apps.

2 comments

Yep, I've been meaning to get a Swift + SDL project working.

The language itself is not limited to Apple platforms, and there are compilers for many others, but until now all the surrounding tooling (IDEs, Swift Package Manager, build toolchain(s), C/C++ interop) has been less than ideal for all non-Apple platforms. Arguably less than ideal on Apple platforms too in some cases ;)

There is still a big difference between "I have Xcode" and "I have VSCode + a large manual toolchain", but the gap is closing. CMake can also generate Xcode projects which is a nice touch when bringing cross-platform code back to Apple platforms.

https://github.com/KevinVitale/SwiftSDL is a good starting point and already supports macOS and Linux out of the box.
https://www.swift.org/install

macOS, Linux, Windoze

Thanks. It looks like CMake + SDL2(3) would add some gaming platforms like Nintendo, etc. (if that's important to you).