Advent of Swift
26 points by hoistbypetard
26 points by hoistbypetard
I did AoC in swift too, and second a lot of these points.
Regarding Regex, swift has a theoretically very nice library called Regex Builder, which should let you make some fairly complicated parsers really easily and in a composable fashion, but… emphasis on should.
The API is fairly nice, but it just doesn’t work! There’s tons of bugs and seemingly no one from apple who is interested in fixing them. It’s a shame and meant that things as simple as a capture inside a repeated element just don’t work (crashes at runtime). Thankfully AoC this year wasn’t very parser-heavy, but there were a few puzzles where I had to make a slightly wonkier parser than I’d have to if I wasn’t trying to work around bugs in RegexBuilder.
Some parts of the language still feel unfinished or unpolished, in spite of being around for quite some time.
It's difficult to advocate for using Swift seriously for anything outside of the Apple ecosystem.
Why's that?
Five years ago, I was involved in a project using Swift in Docker (Balena, actually) on Raspberry Pi Compute Module boards to operate smart EV charging kiosks. Aside from some small parts that I wrote in Python to interact with the OCPP bits (due to available libraries), the Swift parts worked quite well.
The speed of development as mentioned by OP is very slow and specific. It's all towards what Apple needs, wants and allows. That's not really a good base to build anything on.
If anything, I think the feeling in the community has tended toward too much changing too fast. (I don't generally hold this feeling myself, but it's quite common.)
It's also feeling much less Apple-dominated these days, with most of the biggest news lately being around expansion to other platforms, bridging to other languages (C++, Java), and a focus on embedded systems.
I'd agree with this. Just look at any SO answer regarding Swift. You'll almost unfailingly find a veritable switch statement of conditions for Swift 2, 3, 4, 5, or 6 as to how to do a thing.