Thank you so much for your reply!
To be honest, there was no significant rationale.
I thought it was better to discuss if we had some concrete (sample) implementation, then I had chosen the one just described in the previous pitch.
I had no idea that we could have getters-initializers asymmetry, but I think now it's the better or the best way to realize this feature. Thank you for your input.
That's certainly easy to understand.
(One possible alternative could be ianaName
↔︎ianaCharsetName
, whatwgName
↔︎whatwgEncodingName
...redundant?)
I'm sorry but the reason why my expression was as such was in the context of the other thread. A footnote should have been added.
The Context
As for CoreFoundation, some functions such as CFStringConvertNSStringEncodingToEncoding and CFStringConvertEncodingToIANACharSetName that are currently available on both of Darwin and non-Darwin with import CoreFoundation are not exposed via Swift API. FoundationEssentials uses them internally, but doesn’t seem to expose them publicly. Will they keep available, or be rewritten in Swift?
CoreFoundation was never meant to be user visible with swift-corelibs-foundation. This is one of the big differences between Windows and Linux with swift-corelibs-foundation. Because the Windows port happened later, that was addressed and is why the CoreFoundation functions are not visible on Windows. I expect that as swift-corelibs-foundation becomes more a forwarder for swift-foundation, those APIs should shrink and disappear on Linux as well.
I can understand what you say, but I’d rather insist that I don’t think CoreFoundation is a mere backend of swift-corelibs-foundation de facto. For example, CFStringConvertEncodingToIANACharSetName and its complementary function CFStringConvertIANACharSetNameToEncoding (of which I gave examples above) are very useful to (and widely used by) server-side programs and web client programs. I hope equivalent APIs are worked out in swift-foundation even if CoreFoundation would become unavailable.
Hey @YOCKOW - you're right that function doesn't seem to have a Swift equivalent in our current APIs. For functions in CoreFoundation that are useful in the Swift ecosystem, I think the best approach (as you mentioned) is to publish them as official Swift APIs rather than continue to call to CoreFoundation to use them (that way eventually they can be removed from CoreFoundation in swift-corelibs-foundation). This one in particular seems relatively simple in implementation and is actually alread…
That makes sense since Foundation is now more open than ever. I'd try to write a pitch if I have enough time, or I welcome someone else writing the pitch. Thank you.