Live data from Hacker News

Swift on Windows

swift.org

31–40 of 209 posts

Re: Swift on Windows

#31
post #20

I haven't done Windows development in over 10 years, but I really wasn't expecting to see what appears to be a stripped down implementation of AppKit wrapped around the old Win32 APIs, like it's 1999. (Nor Hungarian Notation). I thought WPF or WinRT or UWP was supposed to have replaced Win32 by now.

I don't do any desktop development or use Windows much for that matter, but it looks like as of today, there are at least 4 ways [0] to build Windows desktop apps. No wonder the UX feels far less consistent and enjoyable than macOS. [0] - https://docs.microsoft.com/en-us/windows/apps/desktop/

Microsoft wanted to take developers in a direction they didn't want to go. They seemed to have realized their mistake and trying to unify this mess. In the recent past, you wouldn't find WPF and Windows Forms mentioned in the same article as UWP.

Apple had their own problems with this (Carbon vs Cocoa) but that legacy has been shaken off.

Re: Swift on Windows

#32

This is really cool. I have been watching Swift with interest mainly because it is an answer to the question: How would a bunch of C++ experts (for example Doug Gregor and David Abrahams) design a language if they could do it all over again? Before, the lack of a good cross-platform story kept me away. Now, I think this gives me an excuse to play around with Swift.

It's a really nice language. IMO the main limitations currently are:

1. version/dependency management is a bit of a pain. Every time there's a major language update I have to do surgery on my larger swift projects

2. ARC-based memory managements has some serious pitfalls in terms of worst-case performance characteristics.

But in terms of syntax and general philosophy, I have never found a language more pleasant to work with than Swift

Re: Swift on Windows

#33

I haven't done Windows development in over 10 years, but I really wasn't expecting to see what appears to be a stripped down implementation of AppKit wrapped around the old Win32 APIs, like it's 1999. (Nor Hungarian Notation). I thought WPF or WinRT or UWP was supposed to have replaced Win32 by now.

I hope WinForms never dies, it is the OG Windows "look" and much less amenable to all the web-app looking BS that permeates desktop apps today

Re: Swift on Windows

#34

Earlier quoted context omitted.

Ehh, kotlin MPP isn't far enough along for me yet. I'm biased against JS-based approaches. Xamarin is the best current option in my (very biased) opinion EDIT: but kotlin MPP is my long term hope. Once they iron out the kinks (e.g. ios coroutines)

I was skeptical of React native especially having tried it a few years ago, but new versions are incredibly nice. Plus, it’s running JS off thread. Performance has been fantastic. I rewrote recently an app in SwiftUI - the React Native app was faster and easier to write. Which was a surprise to me because I like the SwiftUI components more, but in the end the far superior hot reloading and far better dev tools, along…

Yeah my one time getting into react native was not good. Ran into several show stopping bugs with the build tooling basically immediately. Hot reload is absolutely a killer feature though and I wish I could have stuck with it for that alone.

My issue with JS isn't the fact that its on/off the main thread, its that it is _necessarily async_ due to the bridge. That is _really_ limiting to design around.

Thats why Xamarin is in many ways the best of both worlds for mobile dev. If WASM/client-side-blazor take off then it can also target web.

Re: Swift on Windows

#35
post #14
post #6

Swift for Android would be a real milestone. There are not so many mainstream cross mobile development platforms.

I think Kotlin is ahead enough in this area that it'll win. Plus it's much easier to compile Kotlin to native and use that from Swift than to use native from Java/Kotlin

Yeah it just reached alpha. I’m using Kotlin to power a side project on iOS with a SwiftUI view layer. I’ve yet to actually implement the Android version though.

Re: Swift on Windows

#36

Earlier quoted context omitted.

Ehh, kotlin MPP isn't far enough along for me yet. I'm biased against JS-based approaches. Xamarin is the best current option in my (very biased) opinion EDIT: but kotlin MPP is my long term hope. Once they iron out the kinks (e.g. ios coroutines)

I was skeptical of React native especially having tried it a few years ago, but new versions are incredibly nice. Plus, it’s running JS off thread. Performance has been fantastic. I rewrote recently an app in SwiftUI - the React Native app was faster and easier to write. Which was a surprise to me because I like the SwiftUI components more, but in the end the far superior hot reloading and far better dev tools, along…

I like SwiftUI but it’s indeed slow and leaking a bunch of memory as of iOS14

Re: Swift on Windows

#37
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 SwiftUI itself is closed-source is because a lot of important code lives inside of UIKit/AppKit. Huh?! Apple being Apple, each revision of SwiftUI is now glued to a singular release of a major revision of the OS. Instead, if Apple decided to built SwiftUI entirely in the open, then the foundational APIs that are closed-source would have to co-exist with the open source versions in order to work.

This is in contrast to Rust, another LLVM language ported to Windows. Every part of Rust is open source and is built to work with open roadmaps and very thoroughly documented standard libraries.

So on the one hand, if you're a fan of Swift, you have yourself a nice hobby language you can play with on the weekend on your gaming PC. On the other, I'm not entirely sure what the point of this effort is for?!

Re: Swift on Windows

#38
post #9
post #6

Swift for Android would be a real milestone. There are not so many mainstream cross mobile development platforms.

Kotlin, Flutter, Any JS framework, QT, Xamarin.

Flutter is probably the best candidate. It's a shame Google is giving priority to Flutter for Web instead of desktop though. As discussed previously here on HN, Flutter for Web will always result in bloated web apps as they are reimplementing everything through canvas (eg: text editing, layouts, styling, etc).

Re: Swift on Windows

#39

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…

This is a good example of the point for this effort:

https://sparkmailapp.com/blog/swift-windows

Re: Swift on Windows

#40

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…

This is a good example of the point for this effort: https://sparkmailapp.com/blog/swift-windows

Sure, I guess if they feel the open source versions of Swift's standard library are functional enough to release production quality software.

Keep in mind, the UI code will be completely custom for Windows though.

Post reply on HN