I know that SwiftUI isn't part of the Open Source Swift Project and therefore can't be really influenced by the Swift community, but during the related WWDC sessions I couldn't stop thinking that the new declarative and abstract way of specifying UI is the perfect way to enable Swift applications on non-Apple platforms like the Web, Windows and Linux. While the current goal of Apple is to make it possible to write code once and deploy on all Apple platforms (or "learn once and apply anywhere" to use their words), why stop there? Declaring
VStack etc. applies to all kinds of UIs and therefore could be also implemented for Windows, Android or even the Web.
Regarding how this could be tackled, I have no idea. The best way would be if Apple would be behind this itself (although I'm not sure how they could profit from it). But if the goal to make Swift a general purpose language is taken seriously, I think adding support for other platforms within SwiftUI would be a game-changer regarding Swift adoption. Just imagine how great it would be if the code you have written for your iOS/macOS apps could be mostly reused both on the Web and also on Windows and Android devices. Swift is already one of the most popular languages amongst developers and it could beat out all the other languages easily in my opinion if it just would be more useful on more platforms.
To be a little more realistic, I think the most pragmatic way how this could come to life is if Apple open sourced just the basic algorithms and the "API" of SwiftUI and the discussion around it so other platforms could adopt changes early on. Then open source projects (like Vapor for the Web) or even companies like Microsoft (for Windows) and Canonical (for Ubuntu) could do the heavy lifting of actually implementing the UI for their platforms. And Apple could provide some intermediate layer which contains the algorithms to infer the final UI representation from all the declarative code, including the logic to update the UI based on data which they should have already implemented anyways.
I know all this sounds like too good to ever happen, but sometimes one has to dream big and SwiftUI itself is proof that some dreams actually do come true. What do you guys think? Did anyone else had the same thoughts? Maybe it's even their long-term plan, who knows?