News for hackers. Stuff that matters.
Re:Swift on Windows by zapzupnz on Tuesday September 22, 2020 @08:53PM (#24561779)
> I call it out as weird because take SwiftUI for example, the main excuse Apple engineers gave for why SwiftUI itself is closed-source is because a lot of important code lives inside of UIKit/AppKit. Huh?!

SwiftUI is just a closed source framework. What's so confusing here? We don't expect Microsoft to develop its proprietary APIs out in the open despite it having a large presence in the open source world, why would we of Apple?

> On the other, I'm not entirely sure what the point of this effort is for?!

To develop using Swift on Windows. It's not terribly difficult to imagine that people might enjoy using their preferred language on other platforms — you mentioned Rust, after all, and that's on practically everything.

I think the confusion you have is not understanding the boundaries between Swift (the open language) and SwiftUI (the closed framework) — which, honestly, given the names, I can completely understand.

Re:Swift on Windows by DaiPlusPlus on Tuesday September 22, 2020 @10:24PM (#24562308)
> We don't expect Microsoft to develop its proprietary APIs out in the open despite it having a large presence in the open source world, why would we of Apple?

.NET is fully open-source now and it is developed in the open. And not just the BCL, but also platform UI/UX libraries like [WinForms](https://github.com/dotnet/winforms) and WPF.

(Yeah I was taken aback too: if you told myself from 10-15 years ago that WinForms would be open-sourced under the MIT license I'd think you were mad - or that Microsoft went out of business after the Year of the Linux Desktop really happened and open-sourcing everything was their swansong).

Re:Swift on Windows by pkphilip on Wednesday September 23, 2020 @01:02AM (#24563163)
WinForms is just a wrapper around Win32 API - which is closed, and so won't run on other platforms. So in many ways very similar to Apple's position on Swift and SwiftUI
Re:Swift on Windows by DaiPlusPlus on Wednesday September 23, 2020 @01:39AM (#24563361)
Yes, but even-so it's now far easier to make an alternative WinForms implementation for non-Windows platforms. Mono had their own workable WinForms implementation a while ago (which was a clean-room implementation, IIRC), but now that isn't necessary.

WPF, unlike WinForms, is ostensibly fully separate from Win32 and so should be possible to port it to non-Windows platforms.

Re:Swift on Windows by colejohnson66 on Wednesday September 23, 2020 @09:22AM (#24566713)
I wrote a project about a decade ago that used WPF and was disappointed to hear later that Mono wouldn’t be implementing a clone. They actually recommended Silverlight if one wanted cross-platform WPF. But WPF is just so much better than WinForms IMO, and Silverlight was on its way out then.
Re:Swift on Windows by simonh on Wednesday September 23, 2020 @02:03AM (#24563507)
Mono reimplemented WinForms from scratch, and any port of WPF would also have to be a from scratch reimplementation. Same for SwiftUI.
Re:Swift on Windows by DaiPlusPlus on Wednesday September 23, 2020 @02:27AM (#24563631)
But they don't need to reimplement it entirely from scratch or as a clean-room implementation because:

1. WPF is now MIT-licensed.

2. Unlike WinForms, the bulk of WPF is managed-code, not a thin-wrapper over Win32.

Therefore anyone can now port WPF to Linux, macOS, etc - and they only need to port the "PresentationCore" part of WPF (i.e. the native parts that expose Direct3D drawing surfaces to WPF).

Re:Swift on Windows by tasogare on Wednesday September 23, 2020 @09:41AM (#24566930)
The opening of those libraries are really recent and they were not developed as open source.