|
| 1 | +# Status |
| 2 | + |
| 3 | +**⚠️ Embedded Swift is experimental. This document might be out of date with latest development.** |
| 4 | + |
| 5 | +**‼️ Use the latest downloadable 'Trunk Development' snapshot from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift.** |
| 6 | + |
| 7 | +For an introduction and motivation into Embedded Swift, please see "[A Vision for Embedded Swift](https://github.com/swiftlang/swift-evolution/blob/main/visions/embedded-swift.md)", a Swift Evolution document highlighting the main goals and approaches. |
| 8 | + |
| 9 | +## Embedded Swift Language Features |
| 10 | + |
| 11 | +| **Language Feature** | **Currently Supported In Embedded Swift** | |
| 12 | +|-------------------------------------------------------|------------------------------------------------------------------------------------| |
| 13 | +| *Anything not listed below* | Yes | |
| 14 | +| Library Evolution (resilience) | No, intentionally unsupported long-term | |
| 15 | +| Objective-C interoperability | No, intentionally unsupported long-term | |
| 16 | +| Non-WMO builds | No, intentionally unsupported long-term (WMO should be used) | |
| 17 | +| Existentials (values of protocol types) | Only class-bound existentials (for protocols derived from AnyObject) are supported | |
| 18 | +| Any | No, currently disallowed | |
| 19 | +| AnyObject | Yes | |
| 20 | +| Metatypes | No, currently only allowed as unused arguments (type hints) | |
| 21 | +| Untyped throwing | No, intentionally unsupported long-term (typed throwing should be used instead) | |
| 22 | +| Weak references, unowned references | No | |
| 23 | +| Non-final generic class methods | No, intentionally unsupported long-term, see <[Embedded Swift -- Non-final generic methods](NonFinalGenericMethods.md)>| |
| 24 | +| Parameter packs (variadic generics) | No, not yet supported | |
| 25 | + |
| 26 | +## Embedded Standard Library Breakdown |
| 27 | + |
| 28 | +This status table describes which of the following standard library features can be used in Embedded Swift: |
| 29 | + |
| 30 | +| **Swift Standard Library Feature** | **Currently Supported In Embedded Swift?** | |
| 31 | +|------------------------------------------------------------|-----------------------------------------------------| |
| 32 | +| Array (dynamic heap-allocated container) | Yes | |
| 33 | +| Array slices | Yes | |
| 34 | +| assert, precondition, fatalError | Partial, only StaticStrings can be used as a failure message | |
| 35 | +| Bool, Integer types, Float types | Yes | |
| 36 | +| Codable, Encodable, Decodable | No | |
| 37 | +| Collection + related protocols | Yes | |
| 38 | +| Collection algorithms (sort, reverse) | Yes | |
| 39 | +| CustomStringConvertible, CustomDebugStringConvertible | Yes, except those that require reflection (e.g. Array's .description) | |
| 40 | +| Dictionary (dynamic heap-allocated container) | Yes | |
| 41 | +| Floating-point conversion to string | No | |
| 42 | +| Floating-point parsing | No | |
| 43 | +| FixedWidthInteger + related protocols | Yes | |
| 44 | +| Hashable, Equatable, Comparable protocols | Yes | |
| 45 | +| InputStream, OutputStream | No | |
| 46 | +| Integer conversion to string | Yes | |
| 47 | +| Integer parsing | Yes | |
| 48 | +| KeyPaths | Partial (only compile-time constant key paths to stored properties supported, only usable in MemoryLayout and UnsafePointer APIs) | |
| 49 | +| Lazy collections | Yes | |
| 50 | +| ManagedBuffer | Yes | |
| 51 | +| Mirror (runtime reflection) | No, intentionally unsupported long-term | |
| 52 | +| Objective-C bridging | No, intentionally unsupported long-term | |
| 53 | +| Optional | Yes | |
| 54 | +| print / debugPrint | Partial (only String, string interpolation, StaticStrings, integers, pointers and booleans, and custom types that are CustomStringConvertible) | |
| 55 | +| Range, ClosedRange, Stride | Yes | |
| 56 | +| Result | Yes | |
| 57 | +| Set (dynamic heap-allocated container) | Yes | |
| 58 | +| SIMD types | Yes | |
| 59 | +| StaticString | Yes | |
| 60 | +| String (dynamic) | Yes | |
| 61 | +| String interpolations | Partial (only strings, integers, booleans, and custom types that are CustomStringConvertible can be interpolated) | |
| 62 | +| Unicode | Yes | |
| 63 | +| Unsafe\[Mutable\]\[Raw\]\[Buffer\]Pointer | Yes | |
| 64 | +| VarArgs | No | |
| 65 | + |
| 66 | +## Non-stdlib Features |
| 67 | + |
| 68 | +This status table describes which of the following Swift features can be used in Embedded Swift: |
| 69 | + |
| 70 | +| **Swift Feature** | **Currently Supported In Embedded Swift?** | |
| 71 | +|------------------------------------------------------------|-----------------------------------------------------| |
| 72 | +| Synchronization module | Partial (only Atomic types, no Mutex) | |
| 73 | +| Swift Concurrency | Partial, experimental (basics of actors and tasks work in single-threaded concurrency mode) | |
| 74 | +| C interop | Yes | |
| 75 | +| C++ interop | Yes | |
| 76 | +| ObjC interop | No, intentionally unsupported long-term | |
| 77 | +| Library Evolution | No, intentionally unsupported long-term | |
0 commit comments