On the road to Swift 6

will swift 6 have moveonly types, especially moveonly struct?
btw, will it have borrowing rules(either only one mut ref or any number of immut refs)?

6 Likes

It would be great to have namespaces in Swift, or something similar to Java / Kotlin packages. They help a lot to structure code in big frameworks.

There are also some other wishes:

  • automatically remove unneeded imports
  • handling of unused code (like in AppCode & Android Studio)
  • improve autocomplete when we want to import not the whole module, but only some concrete Types, like 'import enum Alamofire.Result'
  • add to the application only the code from the libraries that is actually used, like in Kotlin. For example, if the full framework size is 20 Mb, but you use only about 10 classes or functions from it, then only these concrete functions will be added to the final binary. Thus, instead of adding all of 20 Mb, only 1 Mb that is used will be added.
13 Likes

Swift 5 is really astonishing. I think that the focus is on the right things. It would be amazing to be able to write cross platform at full speed. I would also really like Swift used for embedded development. Modelling concurrency at the language level would greatly improve the readability of code and reaffirm one of Swift's core tenets "clarity at the point of use". Protocol oriented programming restrictions could be relaxed with the emphasis on existentials and making a better use of the where keyword. Standard library use can be further simplified e.g. Decodable heterogeneous arrays. The Swift ecosystem would do well by adopting functional programming libraries under it's umbrella such as Prelude. Documentation should be improved with new language features, explaining their use. I'd like to see that for SE-0267. Obviously the autocomplete speed improvement would go a long way. All of this, and much much more is what I'm looking forward to in Swift 6!

5 Likes

Looks like there are updates for that in this section on contextual where clauses.

As more focus is going towards a decentralized web, it makes sense to have Swift and SwiftUI ported to Android and Linux. The idea is that sites will no longer require a browser, and should be self contained applications. This will enable apps to enter a new level of ubiquity, and eventually expand the ecosystem to single app devices, similar to Watch OS (multiple apps, but really just a single app with nested packages) or the iPod nano, where only a single app is launched for that device. The future will be these specific use devices, and it would be fantastic if these neutrino devices were powered by Apple. In addition, compiling swift natively on the client will enable a whole new installation experience for apps, signed by the Apple App Store.

Rather than visiting an app in the browser, URLS, such as classify.app, will automatically install the signed Mac app, in a sandboxed state. If hardware access is required, of course permissions will be requested as is the case today. This will create seamless experiences for users who will enjoy rich, stateful, and occasionally connected, transactional, and secure apps, which only require online capabilities to synchronize data or communicate with a blockchain type, decentralized infrastructure.

6 Likes

I agree. Being able to easily deploy a Swift app, or at least have a decently doable workflow to deploy an Android app, will really seek to establish Swift's as a important tool in a developer's toolbelt. With this, it would mitigate a lot of qualms with picking up Swift, namely that at the moment it can only be used for the apple ecosystem. There aren't many practical ways to use Swift outside of the ecosystem. While you can make executables for Windows or make a web server, there's really no reason to go do that. This is partly because of the high cost of entrance. It's not that great of an experience, there's no IDEs or tools to help development. It feels like a bit of the wild west compared to some of the more established languages. There's little support, and the documentation as it is could use work.

Something you talk about, Cyclic, is that you see Swift as being used as always tied to Apple, but I think that Swift needs to move away from being tied so closely to Apple. I'm sure everyone is happy to have the support of Apple, but having Apple more in the background and having Swift to stand for itself would be a tremendous improvement to the appearance of the language and frameworks. Swift, SwiftUI, and other frameworks and technologies should be able to stand alone, and not need any Apple servers to run. Android apps that are made using Swift should not be signed and checked on Apple servers. If an app isn't running on Apple hardware, not using the apple app store to distribute, there is no reason to be tied to any Apple App Store signing. When Mojang develops Minecraft using Java, they don't ask Oracle to code-sign Minecraft and then check Minecraft against Oracle servers. If I make an Android app using Swift, I want to be able to distribute my app without having Apple App Store touching it.

Swift should not be a tool to expand the Apple ecosystem. It is a programming language. And a programming language is a tool to build with, much like a woodworker uses a hammer.

3 Likes

For "open-sourcing" SwiftUI and Combine, I’ve changed my mind after the huge Concurrency roadmap. I believe it would be easier and most time-efficient to develop the open-source version of Combine and SwiftUI with a full set of concurrency features including async-await and Actors. SwiftUI on Apple platforms may also get new set of APIs using Swift’s concurrency (possibly after WWDC21).

Taking these into consideration, I don’t think it’s the proper time for the community to work on these two projects now. We need to get all the concurrency stuff done first, and wait for SwiftUI to get mature and fit into Swift’s development roadmap.

P.S. Considering that Swift Concurrency is largely pushed by Apple, it may be the key of a huge update to SwiftUI 3. So let’s wait and see what’s going on in WWDC.

6 Likes
Terms of Service

Privacy Policy

Cookie Policy