Swift as a cross-platform language and Windows support

Probably just that Rust has UI frameworks for Windows and we don’t?

Can you provide a confirmation that apps written in Swift aren't allowed on Windows Store because of this? Or, just plainly, a confirmation that apps written in Swift aren't allowed at all?

What I'm seeing so far doesn't confirm either of those. Certainly "only apps written in C/C++ or .NET are allowed" is not true, as shown by that app written in Rust and staying published on the store.

Something to note: the article linked by @Haddock is from 2013, before Swift was open-sourced. It wouldn't have been able to evaluate Swift as something safe to put on the MS app store.

Writing UI applications on Windows is absolutely possible. GitHub - compnerd/swift-win32: A Windows application framework for Swift demonstrates a UI application on Windows and is more of a framework rather thana one-off application.

10 Likes

I think your assertion should be tailored more as

'probably just that rust has ui frameworks for windows that I can easily find by googling, that other people are using and feel like they have more exposure because of their usage in demo projects, and I don't feel the same way about the swift environment'.

Thanks to the work of contributors like @compnerd as well as the work of other people who are taking the time to expand the swift ecosystem with cross platform gui building capabilities (like this one too GitHub - stackotter/swift-cross-ui: A cross-platform SwiftUI-like UI framework built on SwiftGtk.), swift technically has everything it needs to be used in the same capacity as rust gui toolkits.

it's a matter of continuing adoption through community contribution and exposure, which will happen in time.

4 Likes

That is exactly what I meant and I meant no disrespect to the great work @compnerd is doing.

1 Like

I believe that Swift is progressing well towards a multi-platform general-purpose language.

Thanks to Saleem Abdulrasool - we can now compile a Swift app on Windows in addition to macOS and Linux.

I am also very interested by the work of people working on a cross-platform compilation solution.

I started successfully testing the use of mickeyl's cross-compilation toolchain. My workflow, which consisted of editing with Xcode and then compiling separately on masOS, then on Linux and then on Windows, can be simplified at least for cross-compilation with macOS and Linux targets. I don't know if mickeyl plan to add Windows as a target to the toolchain? That would be fantastic!

Now, my short wish list:

1- Minimum strandardized support for UDP and TCP/IP network communication for all three platforms.

Unlike Python, Go, C#. NET Core, we do not yet have this kind of solution.

Swift-NIO is not yet well integrated on Windows, also Swift-NIO is overkill for UDP / TCP basic communications. As for Apple's Network framework, it just runs on the Apple platform.

For simple UPD / TCP exchanges between machines I use BlueSocket on macOS and Linux. On Windows we can build our own Socket module on a Swift-C interface using WinSock, a long road. I took the path of adapting BlueSocket to support Windows after long hours of work I finally arrive at a Socket solution rolling on the three platefromes. Many of us are probably taking this kind of difficult path to be able to run an app as simple as Swift Echo Server on Windows.

In short, although there is always the possibility that each programmer builds his own cross-platform solution, I would like to spend more time coding the useful side of my applications rather than spending long hours / days coding C-library support modules of the different OSes.

I would like the Swift team to provide us with a simple cross-platform Socket module.

2- Bonjour support (Zero Config) standardized for all three platforms.

On macOS we have NSNetServices and Network, on Linux we have Bouke/NetService who did a good job of having the NetService API on libavahi.

On Windows although Apple provides us with a Bonjour SDK, it dates from 2004 and supports C and... C#. No Swift solution. So for my Windows apps where I need Hello I code in C#! I would like to be able to make these apps in Swift!

I would like the Swift team to provide us with a cross-platform Bonjour / Zero-Config module.

3 - Swift support on Windows on par with macOS and Linux

Saleem Abdulrasool is doing a collosal job to bring Swift to Windows. To ensure consistency between macOS, Linux and Windows this work could surely be better supervised by the Swift team and more resources allocated to help Saleem.

For example, in 2020 Saleem worked very hard to port Swift-NIO to Windows and achieved a usable result. But the Swift team seems to have worked on evolutions of Swift-NIO that over time have quite significantly broken the state of Swit-NIO on Windows. Now in 2022, Swift-NIO seems a very good package on macOS and Linux but not yet usable on Windows.

I would like the Swift team to find resources and assign them to the Windows team and systematically integrate the Windows platform at the same level as Linux and macOS.

4- Xcode on Windows

Let's look at Microsoft and their multi-platfromes support: We have Visual Studio for Mac (Progression of Mono / Xamarin Studio) which allows us to code simple multi-platforms command line apps while coding on our Mac machines. The editor works well, the use to compile / debug is simple, code completion works. Visual Studio for Mac is an excellent IDE dedicated to C# on Mac that allows me to do everything from my Mac for C# projects.

Apple is certainly able to do the same for Swift. Just have the will and you'll get there!

Today either I edit on Xcode that I love, transport the source to Windows and then build.

I then miss the code competition for Windows-specific stuff and constantly switching from one OS to another by carrying the source code is not very productive. Maybe Apple could add stuff to Xcode to support compilation / debug on Windows remotely ? Or...

It would be fantastic if Apple had brought a version of Xcode to Windows allowing us to edit a Swift project, have the completion of the code for everything specific to Windows, run and debug as simply as in Xcode on Mac.

Yes, I use VSCode on Windows and Linux. The Swift Server Work Group team has done an excellent job of providing us with a VSCode extension that allows us to be more productive but I much prefer to use Xcode.

I would like the Swift team with Apple to provide us with an Xcode version for Windows.

5- Easy installation of Swift on Linux and Windows

I look forward to the Swift team providing us with a simplified installation on Ubuntu Linux.

Now the installation on Windows consists of several steps and dependencies on Visual Studio things etc.

I would like the Swift team to provide us with an installation method on each platform as simple as installing Golang.

Ouff, well, I'll stop here for now.

Thank you to everyone who helps make Swift a multi-platform general-purpose language and allows us Swift users and myself to focus on the essentials of the apps we want to build.

+1

+1

Won‘t happen, I guess, and is not of the same importance of the other points (VS Code and CLion 2022.2 are good alternatives).