File: EmbeddedSwiftStatus.md

package info (click to toggle)
swiftlang 6.1.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,791,644 kB
  • sloc: cpp: 9,901,738; ansic: 2,201,433; asm: 1,091,827; python: 308,252; objc: 82,166; f90: 80,126; lisp: 38,358; pascal: 25,559; sh: 20,429; ml: 5,058; perl: 4,745; makefile: 4,484; awk: 3,535; javascript: 3,018; xml: 918; fortran: 664; cs: 573; ruby: 396
file content (77 lines) | stat: -rw-r--r-- 6,950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Embedded Swift -- Status

**⚠️ Embedded Swift is experimental. This document might be out of date with latest development.**

**‼️ Use the latest downloadable 'Trunk Development' snapshot from swift.org to use Embedded Swift. Public releases of Swift do not yet support Embedded Swift.**

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.

## Embedded Swift Language Features

| **Language Feature**                                  | **Currently Supported In Embedded Swift**                                          |
|-------------------------------------------------------|------------------------------------------------------------------------------------|
| *Anything not listed below*                           | Yes                                                                                |
| Library Evolution (resilience)                        | No, intentionally unsupported long-term                                            |
| Objective-C interoperability                          | No, intentionally unsupported long-term                                            |
| Non-WMO builds                                        | No, intentionally unsupported long-term (WMO should be used)                       |
| Existentials (values of protocol types)               | Only class-bound existentials (for protocols derived from AnyObject) are supported |
| Any                                                   | No, currently disallowed                                                           |
| AnyObject                                             | Yes                                                                                |
| Metatypes                                             | No, currently only allowed as unused arguments (type hints)                        |
| Untyped throwing                                      | No, intentionally unsupported long-term (typed throwing should be used instead)    |
| Weak references, unowned references                   | No                                                                                 |
| Non-final generic class methods                       | No, intentionally unsupported long-term                                            |
| Parameter packs (variadic generics)                   | No, not yet supported                                                              |

## Embedded Standard Library Breakdown

This status table describes which of the following standard library features can be used in Embedded Swift:

| **Swift Standard Library Feature**                         | **Currently Supported In Embedded Swift?**          |
|------------------------------------------------------------|-----------------------------------------------------|
| Array (dynamic heap-allocated container)                   | Yes    |                                      
| Array slices                                               | Yes    |                                      
| assert, precondition, fatalError                           | Partial, only StaticStrings can be used as a failure message |
| Bool, Integer types, Float types                           | Yes    |
| Codable, Encodable, Decodable                              | No     |
| Collection + related protocols                             | Yes    |
| Collection algorithms (sort, reverse)                      | Yes    |
| CustomStringConvertible, CustomDebugStringConvertible      | Yes, except those that require reflection (e.g. Array's .description)     |
| Dictionary (dynamic heap-allocated container)              | Yes    |
| Floating-point conversion to string                        | No     |
| Floating-point parsing                                     | No     |
| FixedWidthInteger + related protocols                      | Yes    |
| Hashable, Equatable, Comparable protocols                  | Yes    |
| InputStream, OutputStream                                  | No     |
| Integer conversion to string                               | Yes    |
| Integer parsing                                            | No     |
| KeyPaths                                                   | Partial (only compile-time constant key paths to stored properties supported, only usable in MemoryLayout and UnsafePointer APIs)     |
| Lazy collections                                           | No     |
| ManagedBuffer                                              | Yes    |
| Mirror (runtime reflection)                                | No, intentionally unsupported long-term |
| Objective-C bridging                                       | No, intentionally unsupported long-term |
| Optional                                                   | Yes    |
| print / debugPrint                                         | Partial (only String, string interpolation, StaticStrings, integers, pointers and booleans) |
| Range, ClosedRange, Stride                                 | Yes    |
| Result                                                     | Yes    |
| Set (dynamic heap-allocated container)                     | Yes    |                                      
| SIMD types                                                 | Yes    |
| StaticString                                               | Yes    |
| String (dynamic)                                           | Yes    |
| String interpolations                                      | Partial (only strings, integers, booleans, and custom types that are CustomStringConvertible can be interpolated)    |
| Unicode                                                    | Yes    |
| Unsafe\[Mutable\]\[Raw\]\[Buffer\]Pointer                  | Yes    |
| VarArgs                                                    | No     |

## Non-stdlib Features

This status table describes which of the following Swift features can be used in Embedded Swift:

| **Swift Feature**                                          | **Currently Supported In Embedded Swift?**          |
|------------------------------------------------------------|-----------------------------------------------------|
| Synchronization module                                     | Partial (only Atomic types, no Mutex)    |
| Swift Concurrency                                          | Partial, experimental (basics of actors and tasks work in single-threaded concurrency mode) |
| C interop                                                  | Yes    | 
| C++ interop                                                | Yes    |
| ObjC interop                                               | No, intentionally unsupported long-term |
| Library Evolution                                          | No, intentionally unsupported long-term |