Live data from Hacker News

Swift on Windows

swift.org

181–190 of 209 posts

Re: Swift on Windows

#181
It's great to see more languages supported across more operating systems, though outside of iOS app development I am exceedingly dubious of the usefulness of Swift.

Re: Swift on Windows

#182

Earlier quoted context omitted.

> Apple behaves as if every user is immediately on the latest version iOS 14 Adoption Surpasses 25% Across iPhone and iPad Five Days After Release https://old.reddit.com/r/apple/comments/ix3gve/ios_14_adopti... How long does it usually take on Android?

Nobody was talking about Android. And the number of people still on 12 is significant.

> Nobody was talking about Android.

It matters in the current context. Developers have a much easier time targeting the latest and hottest on iOS, compared to the only other alternative.

> And the number of people still on 12 is significant.

Not for long if 14 is already 25% in less than a week, and most users upgrade to the latest versions soon enough.

Re: Swift on Windows

#183
post #65

Earlier quoted context omitted.

I suppose if Swift can only interoperate with C APIs, Win32 would be the only option.

Well, Swift uses LLVM, so it's possible to link it to C++ code with extern "C" declarations.

According to this document, direct C++ interop will soon be done without the need of extern "C" wrappers. [0]

[0] https://github.com/apple/swift/blob/master/docs/CppInteroper...

Re: Swift on Windows

#185

Earlier quoted context omitted.

Nobody was talking about Android. And the number of people still on 12 is significant.

> Nobody was talking about Android. It matters in the current context. Developers have a much easier time targeting the latest and hottest on iOS, compared to the only other alternative. > And the number of people still on 12 is significant. Not for long if 14 is already 25% in less than a week , and most users upgrade to the latest versions soon enough.

> compared to the only other alternative

Nobody was doing comparisons either. But for this topic shouldn't we be comparing to windows programming tools too? And those generally get to update their language runtimes all on their own, without waiting for the OS at all.

> Not for long if 14 is already 25% in less than a week

I don't understand that logic. I didn't say 13, I said 12. The release of 14 isn't going to suddenly get a significant number of people off 12.

The number of users on 12 is going to drop over time but 12 is locked in as the final version for multiple percent of iphone owners in the US. It could be two more years before most companies are comfortable breaking compatibility with that to get some coding conveniences.

Re: Swift on Windows

#186
post #62
post #51

Earlier quoted context omitted.

The docs are very incomplete and common third party dependencies are missing. I know it’s a chicken and egg type situation but vapor is not an appealing option for backend unless you really want/need to use Swift.

I am curious, what did you find missing or unachievable using Vapor?

Swift has no concept of fault tolerance. If you by mistake make an illegal array access, multiply two numbers that are too big or overflow your stack (which is limited to ridiculous 512KB on secondary threads), your app crashes and that's that. Apart from a horrible user experience (you don't even get a "nice" customised 500 error page, just a "Gateway timeout" or similar), your app is now offline for everyone.

What other backend language doesn't allow you to recover from errors? It is my understanding that even Haskell allows you to catch "error".

I developed a Swift server-side app (not with Vapor, but with Kitura - but the point still stands) for two years and this was one of the biggest issues, and despite ongoing discussions, it just has never been fixed.

Re: Swift on Windows

#187
post #170

Earlier quoted context omitted.

Is it just a hobby project, or actually sponsored by Google? They are trying to push Swift for Tensorflow [1], so proper upstream cross-platform capability would probably be important to them. [1] https://www.tensorflow.org/swift

It's pretty clear that since Chris Lattner left Google the Swift Tensorflow version isn't really going anywhere.

They are still paying a bunch of expensive devs to work on it, so maybe not.

Re: Swift on Windows

#188

Swift has this weird sort of ecosystem where Apple builds much of the platform in a very secret (most of the roadmap isn't shared), closed-source variant for its own OS. Then it has this open source version, with a very public compiler (roadmap IS shared) that allows cross platform toolchains like this one to exist. I call it out as weird because take SwiftUI for example, the main excuse Apple engineers gave for why…

Swift manages to be technically open-source while not really being true to the idea of open-source. To me, it always seems as if somebody at Apple saw that companies like Microsoft going open source was good publicity and decided that they should do it now too, without really understanding what "open source" means.

Some examples of this IMHO include:

- While Swift itself is open-source, "Foundation" (which is something of a stdlib of Swift and provides many key pieces of functionality) is not open source - at least on macOS. There is a reimplementation of Foundation for Linux which is open source but, surprise, surprise, the two sometimes have different behaviour...

- Swift releases are weirdly coupled to XCode releases, a closed-source IDE. Moreover, while technically possible, most people on macOS don't install Swift on its own, but always through XCode, and the two are quite tightly coupled (you can technically change the toolchain, but it's quite an opaque setting IMHO). This leads to a lot of "I updated XCode and now the code is not working anymore" issues, especially with more junior developers.

- Tooling outside of XCode (itself not the greatest of IDE of all times...) is extremely ... limited. For example, XCTest's (the test framework's) console output is almost unreadable and there are actually (half-abandoned) third-party tools that try to parse it and format it nicely (while introducing tons of weird bugs), something that test frameworks for other languages can just do for free. The package manager has, I think, one maintainer, and is so underpowered that most iOS developers don't really use it yet (despite it now being a couple of years old). And in terms of editor/IDE support there is now technically a LSP implementation, but last I tried, I couldn't even manage to set it up properly.

- There is no clear roadmap or even mission statement for Swift. Many other languages try to be clear about where they're headed and also what kinds of things they don't want to support, but Swift development is this weird mixture between a) a "community process" that often just leads to very different parties bringing their own very special concepts, syntax sugar, etc. into the language development without there seeming to be any overarching idea of where this all is headed, and b) some things just seemingly being implemented because it's useful for some shiny Apple feature ("function builders" which is mainly meant to support SwiftUI and which many people have been very skeptical about). Meanwhile long-standing proposals like properly fixing generics ("Generics Manifesto") are being pushed back indefinitely. It seems to me sometimes that Swift developers are willing to let the community bikeshed on trivial matters (e.g. syntax sugar), but when it comes to more important, long-term concerns (should we implement function builders or rather invest in some more generally reusable macro-like / code generation feature), are being unilaterally decided without really consulting the community.

Re: Swift on Windows

#189

Earlier quoted context omitted.

SwiftUI is designed such that a port to another platform would not be as awful as a clone of the Mac UI.

I speculated when it first came out that internally they have a port for either Windows or Android or both, if for no other reason than to discover any architectural limitations that would preclude such a thing. But I also think it's very unlikely that SwiftUI will ever be released for any non-Apple platforms.

They already have a port of some of the core platform GUI elements to windows. It's used in the Windows version of iTunes. It's probably quite minimal though.

Re: Swift on Windows

#190

Earlier quoted context omitted.

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

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.

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.
Post reply on HN