Live data from Hacker News

Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

infoq.com

101–110 of 308 posts

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#101
post #91

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

That's a big if. From what I've read, SwiftUI isn't even a great Mac/iOS GUI framework yet. And Windows and Linux are drastically more different than those two.

I really enjoy swiftUI. It appears like it tried to emulate react and succeeded on a few fronts, is better in a few fronts (child modifying parent variable), and worse in a few fronts (side effects).

That being said, my experience with SwiftUI users is that they don't like it because it is so different from the standard Mac experience (props and re-renders and state...). And the documentation is poor (IMO has been Apple standard from MapkitJS to iOS Swift documentation to SwiftUI) which leads to a negative dev experience. Try finding what causes a component to re-render in SwiftUI vs React. If you find it great and please post it, but it's not easy to find in my simple research.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#102
post #85

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

> Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework. I wouldn't. I don't like Swift's syntax. The ecosystem would likely not be mature enough either.

Best part about maturity. It matures. I would jump ship in a heartbeat to Swift. I don't use it because I can't use it in most places, and I am slowly learning to choose what I become an expert in. It sure isn't everything.

But when I did use it, I loved it. I've written in quite a few languages, and it is my favorite, but not my go-to because of its limited environment.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#103
post #97
post #40

> It is not clear at the moment if Apple has any plans to port Swift UI to Windows and/or Linux It seems pretty clear they have 0 plans on doing that. They could've open sourced it in the first place, along with Combine. Not open sourcing Combine seems like a pretty short sighted decision to me.

hard to open source it when its implementation is tied to the XNU kernel

XNU is one of the few parts of macOS that is actually open source. I’d be pretty surprised though if swiftUI were deeply dependent on the kernel itself, rather than on some graphics toolkit within macOS

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#104

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

Creating a good cross-platform GUI framework is probably harder than creating a good cross-platform language.

Embarcadero was able to do it with Delphi. Android, iOS, macOS, Windows, and Linux. Single codebase single UI.

It looks like the bear is in keeping up with all the platform updates all the time though.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#105
post #48

Earlier quoted context omitted.

It isn't just that. The scrolling in macOS is 2D (you can scroll a small rectangle inside a large one in any direction) and has position, velocity, acceleration, and a bounce effect on the boundaries of the content area. Additionally, you can pinch to zoom (in and out) and the zooming is smooth and continuous centred on the cursor location. There are also various 3-finger swipe gestures, and force touch lets you clic…

Two-axis scrolling isn't unique to macOS. The way that scrolling has traditionally been implemented on Linux (as mouse buttons 4 and 5) makes it difficult to implement any kind of continuous scrolling, but once you have one axis working, a second one isn't much harder. The velocity and bounce effects on scrolling are implemented at the application layer. They don't depend on any unique features of the trackpad hardwa…

The Force Touch trackpad was introduced in 2015. My 2015 MacBook Pro has one. I rarely use the “harder press” feature, but I love the adjustable click pressure (lightest setting for me), and how the same pressure anywhere on the trackpad works (as opposed to hinged models). I’m ruined for any other laptop just due to the excellent trackpad.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#106

Whenever I've looked at examples on Swift on Linux in the past, the code always started with (hazy memory here) `use glibc` or similar, whereas the macOS version used a different library. So for example even just to produce a random number you had to use two completely different library functions imported with completely different names. All that to say: it's always felt to me like "cross-platform" for Swift means "t…

It depends on what you're doing. Swift Foundation is cross platform for Windows/Linux/macOS and exposes apis for things like file systems, paths, process creation with the caveat that what a "Thread" is or what it means if a file is executable is a little different between platforms. If you're writing a cli tool you should be able stay mostly within the Swift stdlib and Foundation and that'll work on all platforms. As more libraries are ported to Windows (e.g. hopefully swift-nio), that should become more and more the case.

Where this isn't the case would be if performance mattered, some of Foundation system api implementations (at least, the Windows ones) can be a little inefficient since the Foundation api model and the Windows way of doing things doesn't always match and the Windows implementation has to do extra work to match the semantics.

Another would be UI wise, I haven't heard of plans for Apple to open source SwiftUI. Though since Swift can call into the native platform apis, it's quite possible to write a (perhaps not as slick) alternative.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#107
post #66

Off-topic, but I read the title as "Supported on Linux distributions including but not limited to Windows". Microsoft, you know what we want.

Windows switching to the Linux kernel would be wild, but I think we all know it's coming.

I don't know how they can pull that off.

They would need to support customers who need that compatibility. So either they start being major contributors to WINE or something like it ... But then what about people who need a propriatary driver? Maybe a VM with hardware passthrough....

But they already have WSL for compatibility in the other direction. Not good enough?

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#108

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

If that were true wouldn't we be seeing a big increase in Dart adoption because of Flutter as well? I'm not seeing it.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#109
post #108

> . It is hard to think that any Windows programmer would prefer Swift as a language over .NET languages, as many commenters pointed out on Reddit, but a port of Swift UI on Windows could be a game changer. Everybody would jump to Swift [for new projects] if it meant a cross-platform GUI framework.

If that were true wouldn't we be seeing a big increase in Dart adoption because of Flutter as well? I'm not seeing it.

Although it technically has cross platform GUI, Flutter has actually reimplemented all the native OS widgets. As soon as the OS changes some look and feel your app will look out of date.

Re: Swift 5.3 Will Be Supported on Windows and Additional Linux Distributions

#110
post #91

Earlier quoted context omitted.

That's a big if. From what I've read, SwiftUI isn't even a great Mac/iOS GUI framework yet. And Windows and Linux are drastically more different than those two.

I really enjoy swiftUI. It appears like it tried to emulate react and succeeded on a few fronts, is better in a few fronts (child modifying parent variable), and worse in a few fronts (side effects). That being said, my experience with SwiftUI users is that they don't like it because it is so different from the standard Mac experience (props and re-renders and state...). And the documentation is poor (IMO has been Ap…

Curious to hear more about what SwiftUI does better than React… any place I can read more?
Post reply on HN