首页
20 条评论
travisgriggs23 天前
Honest question. Not trying to troll. One of the pitches in the earlier days was “C/Objective-C OK, but you can’t write safe/next level code with it—-Swift will close that gap.”<p>N years later, it doesn’t feel like there has been a step change in Apple software quality; if anything Apple software feels less solid, and looks cool “look what I did” extension points. I mean, some of the tings you could do with runtime categories, and runtime prototypes were really cool. Now when I work on my 2 apps that originally happily port to Swift/UIKit, I’m just left confused with how to make things work. I’m happy when it finally works, and don’t ever try to improve the thing, it’s too much work.<p>There’s lots of different variables at play here; I’m not trying to stretch inference too much. Heck, it could have been that with adding Swift to the mix, the forces that have contributed to reduced quality in Apples stuff would be even worse.<p>I’m just frustrated. When I work in Elixir, I’m like this is cool. When I work in Kotlin, I don’t feel like “Apples got a language like this too, but it’s got that extra special zing that used to make stuff Apple touched cool.”
评论 #43942419 未加载
评论 #43944157 未加载
评论 #43942822 未加载
评论 #43943783 未加载
评论 #43944826 未加载
评论 #43944780 未加载
评论 #43944704 未加载
评论 #43943770 未加载
评论 #43942980 未加载
评论 #43943174 未加载
评论 #43943606 未加载
w10-123 天前
The article doesn’t give enough attention to the glacial but steady changes in the ownership model that will have great benefit in avoiding copies in value types, Swift’s strength and Achilles heel.<p>I have to say Paul Hudson has almost single-handedly taken over communicating the essentials of Swift to the world; he’s fantastically reliable, brief but enthusiastic, guiding people around the many pitfalls.
评论 #43943401 未加载
评论 #43941746 未加载
评论 #43942345 未加载
sedatk23 天前
Free-form identifiers are neat for test-case naming, but not for `HTTPStatus.`404``. I think having `HTTPStatus.Error404` was a bad idea to begin with. Just use semantic names like `HTTPStatus.NotFound` and you wouldn't have a problem in the first place. Now, a single character typo can easily make a 404, 403 and create a bug. It's less of a problem with semantic names.<p>If you want constrained numeric types in Swift, that's another problem to tackle. But `HTTPStatus.`404`` seems to be the least ideal way to go about it. It lets you do stuff like to declare `HttpStatus.`404`` with a value of 403 too.
评论 #43942643 未加载
评论 #43942815 未加载
评论 #43945640 未加载
评论 #43942524 未加载
评论 #43942861 未加载
finalfantasia23 天前
“Swift has turned into a gigantic, super complicated bag of special cases, special syntax, special stuff…”<p>— Chris Lattner, 2024<p><a href="https://blog.jacobstechtavern.com/p/apple-is-killing-swift" rel="nofollow">https://blog.jacobstechtavern.com/p/apple-is-killing-swift</a>
评论 #43945178 未加载
评论 #43944725 未加载
评论 #43944465 未加载
trevor-e23 天前
Lot of nice improvements here. I'm actually quite liking the async API after using it in a couple small apps and learning the fundamentals.<p>I really wish the entire Swift team would spend a quarter fixing bugs and improving the compiler speed, though. So many trivial SwiftUI cases trigger the "this is too complex for the compiler" errors which are so frustrating to fix.
catapps23 天前
I've been starting to use Swift again lately after like four years, and while the language is beautiful & the package management story is now a LOT better with SwiftPM, I found that none of it plays nicely with XCode, Simulator, or anything to do with iOS/macOS development -- its primary use-case!<p>I found myself awestruck that I *HAD* to use XCode or xcodebuild, and could not just run `swift build` and generate an iOS app.<p>In the end, I had to:<p>- compile the .app structure myself<p>- run codesign manually<p>- manage the simulator manually<p>- bundle xcAssets manually<p>- provide swift linker flags manually targeting the toolchain/sdk I needed<p>- manually copy an embedded.mobileprovision<p>It was a good learning experience, but what's the story here? Did Apple just give away Swift to the OSS community and then make no ongoing effort to integrate their platforms nicely into the non-xcode build tooling? Looking into <a href="https://github.com/stackotter/swift-bundler">https://github.com/stackotter/swift-bundler</a>
评论 #43942093 未加载
评论 #43945222 未加载
评论 #43943254 未加载
jmull23 天前
It sure feels like Swift governance is broken.<p>They're just shoveling stuff in to the language.<p>Individually, most items aren't so bad, but collectively they've got a mess and it's getting bigger fast.<p>None of the decision-makers seem to have the sense or incentive to say "no" to anything.<p>It's sad, because the language had such promise and there are some really nice things in there.<p>Well, at least it's relatively easy to avoid or ignore.
评论 #43946154 未加载
评论 #43945142 未加载
monkeyelite23 天前
> InlineArray does not conform to either Sequence or Collection<p>Why not? Does this mean I need to make a struct which wraps InlineArray and implements Collection? Why didn't they do that?<p>EDIT: found the answer (I still have concerns):<p>> While we could conform to these protocols when the element is copyable, InlineArray is unlike Array in that there are no copy-on-write semantics; it is eagerly copied. Conforming to these protocols would potentially open doors to lots of implicit copies of the underlying InlineArray instance which could be problematic given the prevalence of generic collection algorithms and slicing behavior. To avoid this potential performance pitfall, we're explicitly not opting into conforming this type to Sequence or Collection.
评论 #43942896 未加载
nhojb23 天前
Swift is collapsing under the weight of its increasing complexity. So many, many special cases & they keep adding more!<p>As a developer it becomes so very hard to reason about code behaviour. This is especially true with concurrency, which was meant to simplify concurrent operations, but in actual fact is a nasty can of worms. In an effort to "hide the complexity" it just introduces a huge amount of unexpected & hard to grok behaviour. The new "immediate" Task behaviour & non-isolated async behaviours are good examples of this.
评论 #43944754 未加载
viktorcode23 天前
Spans and inline arrays are the two missing pieces of performance puzzle Swift needed. I'm super hyped for the release!
amichail23 天前
Do you try to put everything on the main actor to dramatically reduce your debugging time?
评论 #43942315 未加载
评论 #43941057 未加载
评论 #43946159 未加载
评论 #43940864 未加载
bsaul23 天前
Coding in both swift and rust is really a funny experience. It's like two roads being built going toward the same city, but starting from widely different places.
评论 #43944377 未加载
Hashex12954223 天前
Mostly nonsense updates.<p>Swift was my favorite programming language after C++/Java since 2014. I've been faced major updates few times happily. It was one of the most easiest language. But now,<p>I tried to update a project from Swift 5.x to 6.x which has 150+ source files itself and no external libraries which is written by my own use and it has almost all swift 5.x features. They made up Swift as super hard. I decided not to use Swift 6 anymore and yes I don't need to reduce debugging time, Even though I don't have powerful computer and debugging time isn't matter to me & development time is actual matter to me.<p>The language itself becomes Rust (the programming language using by aliens). I Hope Swift language is upgrading itself for Aliens or the Swift team is filled with Aliens. Now, I feel ObjC is super easiest language than Swift.<p>PS: I understand Swift is Corporate Product & upgrading towards SwiftUI than general purpose programming language. I never gonna use Swift 6 even I do use ObjC for my projects.
评论 #43942389 未加载
评论 #43942644 未加载
评论 #43945270 未加载
synergy2023 天前
read news about rust and swift these days, it seems modern c++ might keep its dominance for the future
评论 #43945296 未加载
ardit3323 天前
Swift is amateur hour in action by academics that don't value practicality. The new Concurrency was ill thought, and done by people that just perhaps either don't have enough practical experience, or are so enamored with the actor paradigm (erlang) that they had to shove it down the throat in a ecosystem where it is not used that much. No one is really using Swift for distributed programing.<p>Glad they are backtracking on this, and I hope they start remove features and simplifying things. Swift's enemy is its own self and the people steering int into just an academic exercise, rather than a practical and performant language that can be used in many domains.
Server side Swift right now is dead due to all these insane changes.<p>Hopefully things get better on the server/other non ios domains, but the language needs to get simplified and become practical and fun to use.
评论 #43944394 未加载
评论 #43943529 未加载
评论 #43943020 未加载
评论 #43946379 未加载
xmorse23 天前
does it really matter if it takes 1 hour to compile?
DidYaWipe23 天前
"a new Observations struct that is created with a closure, and provides an AsyncSequence that emits new values whenever any any @Observable data changes"<p>Is this another asinine onChange()-style mechanism that actually means WILL change? In other words, it tells you BEFORE the value is set on the object, so you can't do jack squat with it much of the time.<p>That's the M.O. of onChange now, which is utterly brain-dead. Gee, I've been told that a value changed in this object, so let's recalculate some stuff. WHOOPS, nope, none of the other objects (or hell, even the affected object) can take action yet because they can't interrogate the object for its new contents.<p>Truly incredible that they not only defaulted, but LIMITED change-detection to WILL-change, the least useful of the two choices.
评论 #43945351 未加载
评论 #43946351 未加载
90s_dev23 天前
> So, rather than writing
>
> @Test("Strip HTML tags from string") func stripHTMLTagsFromString() {...}
>
> we can instead write
>
> @Test func `Strip HTML tags from string`() {...}<p>Maybe I'm just really new at programming, but this seems like an absolutely bad feature, and the example actually perfectly proves it:<p>You really want to name a function "Hello World!" instead of helloWorld, <i>just so your stack traces can pass a 5th grade English class exam</i>?
评论 #43940857 未加载
评论 #43940923 未加载
评论 #43940869 未加载
评论 #43940896 未加载
评论 #43941211 未加载
评论 #43942478 未加载
评论 #43942190 未加载
评论 #43941605 未加载
codr723 天前
There's a lot I love about Swift, but I fear it's quickly becoming too complicated for its own good.<p>There are just so many ways to solve a problem now that it's more or less impossible for someone to be familiar with all of them.
评论 #43941729 未加载
评论 #43941383 未加载
评论 #43942373 未加载
评论 #43941320 未加载
评论 #43941519 未加载
评论 #43941601 未加载
90s_dev23 天前
I have not looked at Swift since I last wrote some around maybe v3. I hear that it's generally not a competitor to Rust, and is only really useful within the Apple ecosystem. Why is it not more useful as a C++ alternative, since I think that's kind of what the initial goal was? Is it just that non-Apple support is new-ish and not yet matured? Or a more fundamental issue?
评论 #43941246 未加载
评论 #43940862 未加载
评论 #43940804 未加载
评论 #43941943 未加载
评论 #43940829 未加载
评论 #43945372 未加载
评论 #43941607 未加载
评论 #43942321 未加载
评论 #43941690 未加载