[swift-evolution] Winding down the Swift 3 release

Eric Wing ewmailing at gmail.com
Thu May 19 19:49:28 CDT 2016


>>
>> Here’s a simple, yet tragic example: BOOL in Objective-C. We were
>> stuck with signed char instead of getting a real boolean. Back in 10.4
>> Tiger when the Intel migration was announced, I filed a bug report
>> reminding them that this was the chance to fix this. They didn’t fix
>> it, so we were stuck. Then I filed again in the 10.5 beta Leopard time
>> frame during the 64-bit transition, I filed again reminding them that
>> this should be fixed before the 64-bit ABI gets locked down. Again, it
>> wasn’t fixed so we were stuck. Then when the iOS SDK was going to
>> become public, I filed again. Still not fixed. Then armv7, still
>> nothing. Finally, for arm64, this was finally fixed. Too bad we’re
>> stuck on Mac with this probably forever.
>
> Objective-C had a real boolean type as soon as the compiler was C99
> compatible and that’s when I started using it. BOOL is a typedef that is
> part of the Foundation/Cocoa API, not the Objective-C ABI.
>

I’m well aware of C99 _Bool. However, this was a discussion of ABIs,
and my point was how hard it is to change after the fact. And if you
are going to nitpick, BOOL is defined in objc.h, not Foundation, AND
it is now defined as C99 bool on arm64. The fact that Cocoa was unable
to migrate to this repeatedly for about a decade proves my point.

I also said booleans were a *simple* example of this. Greg Parker’s
revelations of the lack of zero-cost exceptions on armv7 is something
I completely forgot about reminded me of a low-level project I was I
participated in a few years back where this implementation detail has
terrible consequences for it. Getting the ABI right matters for so
many reasons and percolates into everything.


>> Anyway, I don’t want to deal with another monstrous broken language.
>
> Objective-C is not broken.

I actually wasn’t referring to Objective-C nor accusing anybody at
Apple or Swift of creating a monster. But I want to keep it that way,
thus my support for delaying the stable ABI decision for Swift.


-Eric


More information about the swift-evolution mailing list