Example of a Cross-Platform macOS/Windows Application Developed Using Swift 6

Hey there,

This is the source code and documentation for a cross-platform macOS/Windows application implemented in Swift 6. It’s an LLM client. I’ve been playing with it for some time in my spare time and I’m happy to share it publicly now!
https://github.com/fbarbat/fellmonger

My main goal was to learn about architectural patterns and developer experience for cross-platform Swift. I found some really cool pointers from The Browser Company and @compnerd about how that was possible and how to get started but I still felt like I needed deeper hands-on experience.

How would “real life” Swift Windows code look like? How would the developer experience be? What would be shareable and what wouldn't? How would be a Swift Windows app be released and packaged? What would be the major trade offs when following this approach? How would Swift 6 fit in all of this?

I tried to condense down everything I learned about cross-platform Swift in this GitHub repo. If you have questions please let me know! Happy to improve it so we can all have more learning resources in the Swift community about how to follow this cool approach. Let me know if you have any thoughts about it!

14 Likes

I would love to give this a try but it's exposing how outdated my Windows skills are :sweat_smile:

I've got a Windows machine with Swift 5.10 (which I believe I installed via winget, if that matters) but I've seen your Package.swift files are tools-version: 6.0.

So I downloaded Swift 6 and ran the installer - but I'm not sure how to actually switch Swift versions on Windows! When I run swift --version in a shell it still reports 5.10.

On macOS I use Xcodes or xcode-select - or even just env DEVELOPER_DIR=... xcrun swift but I don't even know where things get installed on Windows.

What's the recommended way to deal with multiple Swift versions on Windows?

I haven't tried having multiple versions of Swift at the same time in Windows. The easiest thing to do is to make sure you uninstall them all (be it from an uninstaller and/or winget) and only install the most recent one for Swift 6, which is this one as of now. Note I stuck to the Browser Company toolchain of Swift since that’s why they suggested in their examples. It might work with the official one but I haven tried it yet.
If you really need to keep more than one installation, you could write a batch script that changes the path accordingly but probably not worth if you are just testing out this tech.
You should verify the PATH in the environment variables is pointing to the right directory.