Swift 6
Hello, its been a while since I last posted an update, and that has been because I have been busy with uni. But I am back to announce one of the largest updates to the swift track to date, the Swift 6 update.
Some of you might remember me posting a blog post back in May saying I would step down as maintainer and that I said:
Late June - release of the final update
Late June rolled around with no updates, and we are now in December with no updates. So what happened? Well, WWDC24 came two weeks after my blog post with the announcement of Swift 6 and, more importantly, Swift-Testing, a brand-new testing framework.
I quite quickly decided that I couldn’t leave the track with an old testing framework and old Swift version for years if no new maintainers were coming to it, so I started experimenting with a new test runner but due to that the Swift experimental versions were quite a bit harder to work with and time constraint (Crystal Operation Selenite was also in the works under the Summer and was released in the end of summer) so did I not complete a new test runner before the end of the summer. However, in late November, I had a prototype ready.
But some content planned for the final update was released a few weeks ago, which included 2 new practice exercises:
- Dart
- Armstrong-Number
Swift Testing
So what is this swift testing I have been talking about? Well, it is Apple’s brand-new testing framework with all new features and API. If you want to read more you can here: Swift Testing - Xcode - Apple Developer. This will likely be the future of testing in Swift, thereby it is likely good that students get accustomed to this new API.
This framework also gives us more powerful tooling and fixes some of the issues that the last test runner had, this in turn should make the new test runner more stable and make it possible to update the Swift version. But it isn’t all good news, this update will be so big, that I have decided to remove some features from the test runner, like we are moving back to v2 and removing support for user output. I made this decision to be able to focus on delivering a stable launch rather than prioritizing new features.
XCTest?
Well for you who don’t know what XCTest is also a testing framework developed by Apple that was released in 2016 (which is what we currently use). To reduce the complexity of the test runner will the new test runner have no support at all for XCTest, this means that all test file has to be totally rewritten. And the new framework has no support at all for earlier versions than 6, which is also the latest.
But what if I want to continue using Swift 5.x or XCTest?
Well, we will make a branch on the GitHub named Swift 5.x which allows you to still use either Swift 5.x or XCTest or both for local development.
Will all my solutions break?
Nope, the majority of exercises will have the same testing interface and tests. There are some changes, but these are based on changes in problem spec mostly. We had around 80-90% of exercises being templated, on those exercises have there barely been any changes. However, the non-templated exercises will likely receive larger changes.
So far has this included:
- Linked-list
- List-ops
The only exercise I have found to break because of the changes is kindergarten-garden, but the fix there was to just switch from a struct to a class (for the last year has the stub given a class) but the majority of people have likely written a class and not a struct.
What about deprecated exercises?
Well, to start we are deprecating two new exercises:
- Scale generator
- Accumelate
All of the exercises out of scale generator will still have XCTest files meaning they will be broken, on the new test runner.
So when can we expect this update?
Because updates have been delayed so many times in the past don’t I want to give any exact time frame, but to understand that this is very much happening so are there around 30 draft prs on the Swift repo. My hope is that this update will be able to arrive 25H1, and if it happens after April, it will likely be shipped with Swift 6.1.
I also have a few goodies planned for this update, these will be posted in the insider channel on the Exercism discord (as some sneak peeks leading up to this blog post already have been posted) or if you are a bit hackier (and/or don’t want to get insider) you can check out the Swift repo on github.
My long-term goal is still to give up maintainership of the Swift track, so this might very well be the last update to the track from my side.
Crystal
What about Crystal you might ask? Well, the track was updated to Crystal 1.14 and I also delivered some smaller fixes to the track this fall.
And I am planning a similar size update in a month or so including Crystal 1.15. And then am I planning on skipping Crystal 1.16 and delivering a larger update in early 25H2 with Crystal 1.17.