Why are some stdlibs in darwin no longer needed?

According to commit da242bd2d4bfbbc1db1742ba58e66f1c168e6f22, which says "[SDK] Remove obsolete overlay code", with no more brief explainations, most of the stdlibs are deleted. However, I can't find these files anywhere else in the repository, so how can I compile these stdlibs like ARKit or MetalKit etc.?

tl;dr you cannot compile them, because they are closed-source. If you run your code on apple OS don't worry, they are installed already and you don't have to compile them. If you run your code on non-apple OS, you are out of luck.

The current state of things in swift ecosystem as I understand it

Compiler:

  • open source
  • written mostly in C++
  • available on all platforms

Standard library:

  • open source
  • written mostly in swift
  • available on all platforms

Foundation

  • older than Swift itself
  • closed source
  • written probably mostly in obj-c and C
  • available on apple platforms (macos, iOS, tvOS, etc)

swift-corelibs-foundation

  • also imported using import Foundation
  • tries to do all the things Foundation does, but is a separate thing
  • open source
  • used on linux and windows, where the original, closed-source Foundation doesn't exist

closed-source apple frameworks - SwiftUI, Combine, ARKit, MetalKit, and many more

  • closed source
  • unlike Foundation, they don't have open source clones
  • available on apple systems

overlays

  • open source
  • just a tiny shim to make using a framework from swift nicer
2 Likes

Just from curiosity. In case I would like to develop a multiplatform project, is it possible to use swift-corelibs-foundation instead of the Foundation on macOS?

If you would like to develop a multiplatform project, you simply make it so it works with swift-corelibs-foundation, and it is supposed to work with original Foundation without changing a single line of code (but not the other way around, there are some features that aren't possible on linux, for example selectors)

If you would like to use swift-corelibs-foundation instead of the Foundation on macOS for fun I have no idea if that is possible.

Terms of Service

Privacy Policy

Cookie Policy