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.
.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).
WPF, unlike WinForms, is ostensibly fully separate from Win32 and so should be possible to port it to non-Windows platforms.
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).
Be careful not to confuse Swift with SwiftUI. SwiftUI is just a UI framework. It's the one Apple is pushing right now, but it doesn't really have any bearing on the cross-platform story for Swift. (I doubt it ever will -- I don't think Apple particularly wants to take it outside the Apple ecosystem, and it would be very high effort to do in any case.)
Swift is first and foremost Apple's own language for Apple's own frameworks. The frameworks aren't layered on top of an immutable language. The language is evolved to serve the frameworks' needs. This has already started with Objective-C 2.0, but with Swift it's even more obvious.
Yes, but that's neither here nor there. The changes in Swift to make SwiftUI easier can be used by others to implement their own (Windows, Linux, whatever) Swift UI frameworks as well.
Obviously Apple, as the core devs of Swift and sole devs of SwiftUI would have more influence on Swift direction.
It's an open project, but not some "community designed" language. On that regard, not very different from C#, Java, etc.
It's shocking how mismanaged the SDK development at Apple is.
edit: and most of the useful additions are tied with iOS14 (lazy lists), so even if we were able to bump our min support to iOS13 it would be _years_ before we could do 14.
Knowing why Apple is doing this is important to understand why this will never happen.
Apparently the feature they are using is function builders (1) and its already working on the current versions of Swift. So at least now, nothing is preventing other people to try to replicate in a open source manner those features.
By the way, there are some projects on Github that already implements the same functionalities.
Don't wait for Apple to open source this kind of stuff, because one way to enforce lock in, is through API. And Apple is far away from being a benevolent big other as some people might naively assume.
1 - https://www.swiftbysundell.com/articles/the-swift-51-feature...
That is, "So at least now, nothing is preventing other people to try to replicate in a open source manner those features." was always the intent
Similar to rust implementing magic features and APIs, and macros, in nightly, before the API is verified and the implementation is ready.
In which case, you'd expect all of SwiftUI to be eventually possible by anyone else.
Function builders are still not a public feature, and therefore subject to breaking revisions without warning.
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?
And the number of people still on 12 is significant.
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.
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.
As mentioned above this is not true. On Android developers can ship the latest and greatest to devices 4-5 years old because the first party libraries are distributed in such a way to enable that.
SwiftUI/Combine are bundled with OS versions.
I'm not quite sure I understand your point. Are you saying Swift has no value outside of SwiftUI? It's a pretty nice general purpose language.
Bugs in Apple's internal variant are tied to OS releases, whereas bugs in the open source variant are tied to someone getting around to fixing it.
If Apple went all in on open source like Rust, or all in on proprietary/closed, then it would have more consistent messaging about what the language is for.
Is the situation that different from C# and windows API's?
https://github.com/dotnet/roslyn (c#)
https://github.com/dotnet/winforms (UI) https://github.com/dotnet/wpf (UI) https://github.com/dotnet/core (Foundation)
I don't consider the Win32 API itself part of .NET or C# as they've existed long before either.
> I don't consider the Win32 API itself part of .NET or C#
SwiftUI isn’t “part” of Swift either, it’s a proprietary application of Swift, and it’s fucking amazing, I don’t want to work with any other framework now.
The main purpose seems to be to enable developing back end server code in the same language and using the same service APIs as the client code on mobile and desktop.
SwiftUI (or even UIKit/AppKit) are not the point of Swift.
Same way Windows Forms or QT are not the point of C++.
So there's that...
Keep in mind, the UI code will be completely custom for Windows though.
So Swift programs on Windows will actually look and feel like a Windows program? Good.
> After an extensive discussion, we ended up with Electron as the front-end part of future Spark for Windows.
Apparently they use a Swift plugin for Nodejs
It has a runtime API that should work with different versions of the OS. There were changes to the compiler that they didn't talk about until after the fact though. After SwiftUI was announced they did run those through swift-evolution.
SwiftUI for the most part is just a runtime library, the compiler changes made things a bit nicer, but most of it could be achieved without compiler changes.
My clients app requires supporting iOS 11, but I’d love to start mixing in sone SwiftUI.
That's like how Catalysts runtime wasn't backported to older versions of macOS.
They could decouple those frameworks from the OS, but that adds other headaches and you eventually gotta draw the line somewhere so they tend to only add new frameworks with major OS updates.
So, just like Android?
Nominally open, but closed source and proprietary APIs needed for modern apps are installed with the Play Store ?
https://arstechnica.com/gadgets/2018/07/googles-iron-grip-on...
It's half the functionality that makes an Android device work for an unsophisticated user. To the point that people have to write shims just to get basic apps to run without it.
And the amount of functionality Google has moved into GPS has only grown over the years mind you, from things like Doze and its interaction with GPS, to installation processes that hook into it for verification...
If Android didn't have Google Play Services, it wouldn't be anything more than what Linux on smartphones is... a toy for geeks, nothing competitive with offerings like the iPhone.
And how easy/worthwhile is it to use Rust for building GUI applications or games on Windows?
DirectX is closed source too, and I don’t even know what UI framework Microsoft is currently championing.
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.
Which parts of the generics manifesto are "properly fixing generics" in your opinion?
Also, there are some annoying restrictions around existentials, and documentation of Generics and other advanced type machinery could be a lot better in general.
That's one of the reasons AMD pushed Mantle, then pushed Vulkan and DX12 and dropped Mantle. The shape of the API better fits their model for driver development than OpenGL or DX prior to 11, and they're happy for their competitors to help build an ecosystem that works better on their products than the alternatives at the time.
IMO, this is the best model for library/API development if you can pull it off.
Very powerful, fast and close to the metal, but with uglier* syntax and not as productive as the next family of languages. Which are:
Java, C# and Swift (unlike C++ and Rust) for me are pointing into solving a very hot spot of programming, with the balance of power, being more pleasant to program in and feeling more productive.
Your code will be almost as fast as a C++ program, but you dont need to feel (that much) miserable writing stuff into it. (And i say this as someone that likes C++, but knows its not the most productive and pleasant experience)
It remedy some pain points of programming, that in my point of view at least, Rust didnt addressed the same sweet spot as Swift does.
Theres also some good things about Swift right in the corner, that is support to C++ bindings and a more fine-grained control of memory.
Once the memory ownership changes, than we will also be able to consider Swift for the same things as C, C++, Rust and Zig can right now.
Also i would say that dinamic calls while embedding script languages and function builders are very strong points that the language is becoming more powerful with each release.
Also some things like binary stability that Swift have that Rust doesnt are thing to take into account for, giving there are a lot of cases were shipping just the binaries and know they will still work is something very important for projects that cant afford to be open source.
I would consider to use Rust whenever C++ would also fit, but if i can use Swift i would not consider using Rust, because at least for me is a much better language to code.
I think people from the Rust community dont need to fear, because Rust have a strong community right now, and in that particular topic, is Swift that need to catch up and shake up this feeling of being a "apple owned language".
So i dont think they are aiming for the same thing, and therefore they dont need to be compared in a us vs. them basis, giving you can code on both, and i think it could be great if you do it.
Theres a false adage that you need to pick just one language, and having used a lot of languages and platforms over the years, im pretty happy now that i know that such thing doesnt exist.
You are better picking from 2 to 3 languages and use them according the goals of what you are building.
For me, my three languages are: C++, Swift and Python.
C++ for hardcore stuff, Swift for everything that a language like Java or C# could be considered and Python for the more relaxed (and now also expert) stuff.
You can replace Python with Ruby, Lua, etc.. replace Swift with C#, Kotlin, Java, Go, Scala, etc.. and replace C++ with Rust, Zig or C.
But if you mix the families, i say you will have a hard time using Python or C++ in the wrong places.
And this rule is also valid for Rust unfortunately.
* Note: i know this is subjective and a lot of people would find it more beautiful than Swift instead. Its ok and even good that we dont all have the same tastes.
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?!