news.ycombinator.com

What's the general sentiment on Swift? It's 11-years old ...

4/25/2025Updated 10/26/2025

Excerpt

It's not perfect, but nothing else comes as close. One of the most prominent complaints - compile time explosion - really only happens in contrived examples where you're using a bunch of literals in one expression, which isn't realistic. However, it's stuck in a single ecosystem. And let's not talk about some of the newer frameworks. Oh, and Xcode is a joke. … TS to me is just an awkward patch on top of JS. It's really great! But only compared to JS. The mental model of its type system is difficult to form completely. But yes, Swift's tooling doesn't compare. Zanfa 6 months ago I know you should have defined validators for every single external API, library and database, but at some level it feels silly to do all of this extra work. … Right, but that's the problem - it's the only language I've used where this is something you have to worry about, and it's not like the type system is more powerful. And often, the issues stem from external libraries outside my control. Better compiler errors would help mitigate the issue. There's a lot to like about Swift, but I also think it's productive to identify the parts that compare unfavorably to other languages. ... "Why are tuple not Hashable ?!" Which means that you cannot have a tuple of Int `(1, 1)` as a key in a dict, and you have to make a struct that implement Hashable instead. And "Why do they not have a `.sum()` and I have to do `.reduce(0, +)` every time instead." … It's paradoxically high level with its syntax and ergonomics but is tied down to the same cross platform headaches like in low level languages (e.g. cpp). Linking across cross platforms requires lots of careful thought and testing. Unlike cpp, it's not super portable. It requires a hefty 30 MB runtime for some features of the language to work. Try static executable hello world.

Source URL

https://news.ycombinator.com/item?id=43789821

Related Pain Points