Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
What’s New in Swift 5.9? (hackingwithswift.com)
33 points by Someone on June 6, 2023 | hide | past | favorite | 10 comments


Its 2023 and the Swift compiler continues to be the only compiler I’ve ever used that times out (The compiler is unable to type-check this expression in reasonable time).

Some breaking changes need to happen to the type system.


Fulltime swift developer here : am i the only one that worries swift is evolving way too fast and adding way too many features, that make the language so bloated it’s going to reach C++ level of complexity in less than half the time ?


Because it avoided some of the bad choices made in programming languages in the past half century I don’t think it will reach C++ complexity. For example, it doesn’t have the C preprocessor, (unless I missed some developments) avoids some of the complexity of C++ public/protected/private inheritance, and makes it hard or even impossible to make some errors that are way too easy to make in C++, such as not following https://en.cppreference.com/w/cpp/language/rule_of_three.

They sure seem to be trying, though.

It does add such things as async and ownership, and those complicate the language, but IMO not programming in the language. It only makes issues explicit that C++ programmers also have to think about, but cannot clearly document in code.

I also think it’s starting to be two languages: the relatively simple high-level one that it started out as that has Unicode strings, reference counting, copy-on-write data structures, and makes multi-threading magically work through GCD and a low-level one that has byte arrays, ownership, allows implementers to implement data structures the way they want and has explicit locks, etc.


C++ has the fame, but isn't alone in that regard.

C# 12 with .NET 8 standard library, Java 21 with standard library, Python 3.11 with standard library, plus knowing key versions on their timeliness, and major third party libraries are just as complex.

So nope, it is impossible to know everything.

Even those that claim to fully understand "simple" languages like C, they actually master their own C compiler and are unaware of all variants and deviations of it.


Golang is my other language, and i must say it’s really one of my favorite, mainly due to all the things it chose not to do.


Just wait, generics weren't going to happen, and then they did.


took them 10 years though.

One major addition to the language every 10 years is a good rythm. Also, their addition of generics felt super natural and didn't change the general feeling of the language.

Compare that to swift that has added await async, macros, move semantics, actors, in just a few years, while keeping everything that was already there...

So now we have both gcd and actors, both macros and the hack they used for swift UI, and yet xcode integration is still awful, and there's still no decent story for cross-platform development (just compiling for android for example).

It's a mess..


I have the same feelings. It just makes me want to throw up now.


  > This is a really far-reaching change in Swift, and I’m certainly curious how it will be used. If the answer isn’t “Swift Data” I’ll be disappointed!
i think swift data uses classes, so i'd guess ~Copyable isn't for that at least on the surface...?

also the ~Copyable the examples there weren't very great imo, but i think something like a file handle might have been better. for example a file.close() being consuming, making sure you don't use it again after closing it.

also, wouldn't this new feature mean it might be possible to emulate type-states in swift now?


Coming from a Dart context here where that team is also looking at adding Macros to the language. It was really interesting to compare and contrast some of the approaches https://github.com/dart-lang/language/blob/main/working/macr...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: