gpt4 book ai didi

swift - 它仍然是 "dangerous to rely on binary frameworks that use Swift"吗?

转载 作者:可可西里 更新时间:2023-11-01 01:12:07 26 4
gpt4 key购买 nike

在 Swift 博客中 https://developer.apple.com/swift/blog/?id=2从 2014 年 7 月 11 日起,它声明:

"if your project uses frameworks to share code with an embedded extension, you will want to build the frameworks, app, and extensions together. It would be dangerous to rely upon binary frameworks that use Swift — especially from third parties. As Swift changes, those frameworks will be incompatible with the rest of your app. When the binary interface stabilizes in a year or two, the Swift runtime will become part of the host OS and this limitation will no longer exist."

从那时起已经快 3.5 年了,比“一两年”还多。 Xcode 9、iOS 11 和 Swift 4 是目前的标准。这仍然是真的吗?如果是这样,预计什么时候会改变?

我想将 SDK 从 Objective-C 转换为 Swift,并且需要将其作为二进制文件分发(至少部分分发)。

...

更新: 我找到了这个 https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160725/025676.html在“Possible Swift 4 Phase 2 Efforts”下声明:

"- .swiftmodule stability: At some point we need to stabilize the “.swiftmodule” binary file format (or replace it with a different mechanism) to allow 3rd party binary frameworks. This is a very large amount of work over and above what is required for ABI stability of the standard library."

这是否回答了我自己的问题?那是我们现在的处境吗?

最佳答案

根据answer provided by Apple :

Is it still "dangerous to rely on binary frameworks that use Swift"?

是的。

这东西很复杂所以I’m将遵从 Swift ABI Stability Manifesto了解详情。但是,执行摘要是:

  • ABI 稳定性计划用于 Swift 5(参见 this page)
  • 模块格式稳定性仍然没有目标日期
  • 在没有两者的情况下分发二进制框架不是一个好主意

关于swift - 它仍然是 "dangerous to rely on binary frameworks that use Swift"吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46671395/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com