re the reference cycle concern – the questioner sounds like they were using Swift when the main way to do async stuff was with callbacks and delegates, which force you to rely heavily on weak references in lots of places to avoid cycles. transitioning to async/await and structured concurrency makes this much better. you still need weak references occasionally, like for some data structures, but that's much more "this is the right tool for the job” kind of thing.
@wikipedia@Gargron god bless Wikipedia. I thought “Last? Says who, it could happen again!” and then went to the page and saw someone fixed this just yesterday.
Default behaviors are key here to preserve progressive disclosure – most operations will continue to rely on the default of copyability, with non-copyable behavior being opt-in when you want to support it.
I am so proud of myself and my society that my 15yo boy can come home and tell me nonchalantly about one of his best male friend's boyfriend. Like it's nothing. This is the future we want. Never would have flown in my childhood. And I'm sure it doesn't fly many places today.
The debugger team at Apple is looking for an intern to join them, to work on improving the handling debugging of optimized Swift code.
Would be a great opportunity for someone enthusiastic about learning more about how Swift is implemented, and improve the debugging experience for the community.
@icanzilb good point – it’s tricky because this is a property of the language, so not something that’s necessarily appropriate to document on every protocol. But since only the language can provide literal protocols, probably that can just be handled manually on each one.
@ctietze to be fair, it’s really not appropriate to have an initializer that, when it takes a literal, yet does something different to what the literal initializer would do
@icanzilb I don’t think a diagnostic would be appropriate here. The initializer that takes an Int would still be called/needed in non-literal cases. But in the case where you supply a literal, it’s correct to call the literal initializer, which should trap on invalid input not produce nil.
@icanzilb exactly. If you are initializing with a literal it should be guaranteed at compile time to work or trap* so should not be failable. Whereas if you are supplying a variable at runtime failing is reasonable.
of course you can in theory write a literal init that relies on global runtime state or some other monstrosity but let’s ignore that :)
A seasonal question: what candy that is available globally has the worst-tasting American version?
My vote is for KitKat.
Rules: this is for things that are supposed to be the same thing in the US and globally. This isn’t related to naming i.e. smarties in the US are a different thing to in the UK. Milky Way in the US should be compared to a Mars Bar. Also “kinda the same thing” doesn’t count i.e. you can’t say Malteasers/Whoppers they’re different (otherwise that would be the runaway winner).
@layoutSubviews you’re not wrong but the rules are you gotta be more specific i.e. a bar of Cadbury’s (made in the US by Hersheys under license) is clearly not as good tasting but it’s not that bad. Regular Hershey’s is of course trash but only sold in the US for obvious reasons.
@layoutSubviews I should source some European Lindt and do a blind tasting, I don’t know it well enough to know when I try the US bars whether they are crap
There's this increasing tendency to talk about memory safety as if, because it's the most pressing problem right now, solving it means you've won the battle. But that's not the end goal… it's the start. Literally the least you can do.
Percentages add up to 100. As segfaults and exploits due to buffer overruns or use-after-frees decrease, the proportion of bugs that come down to logic errors will increase.
If the way you achieved memory safety (or performance) means your code is so ceremony-heavy that it starts to impact correctness, because you can't so easily see what it is actually trying to do, this is unfortunate.
The boy wanted to know what a SCART cable looked like. I checked my box of emotional support cables and was sorry to discover it doesn’t contain one.
He said a picture would do but it really won’t. You have to hold one, to try twisting it and feel the resistance and hear the crinkling of the inner wires, to stare at the giant plug and poke its sharp connector teeth, to truly understand it.