The Platform Steering Group agreed that we would provide some guidance for package and standard library maintainers as to platform features that we consider obsolescent and therefore not worth putting effort into supporting, the goal being to make it easier to develop and test code, and to lower the maintenance overhead by reducing the number of different permutations that maintainers must consider when writing new code or maintaining existing code.
As such, we consider the following to be obsolescent:
- Big-endian byte ordering* †.
- Non-eight-bit bytes.
- Non-eight-bit C
chars. - Non-IEEE floating point.‡
- Non-ASCII-based character encodings (such as EBCDIC).
- C
intof less than 32-bits in size†. - Pointers (and thus Swift
Ints) of less than 32-bits in size†. - Segmented addressing.**
- Non-byte-addressable memory.†â€
- Integer representations other than 2's complement*.
- Representations of NULL other than all zeroes.
The Platform Steering Group would generally be opposed to adding official support to Swift for any platform that requires one or more of the above obsolescent features, and takes the view that it is not necessary for package authors, standard library maintainers, or indeed the core compiler itself to worry about supporting platforms that require those features.
Kind regards,
Alastair Houghton
Platform Steering Group
* This is specifically about the target platform and the built-in fixed-width types; it isn't a prohibition on types like BigInt using sign-and-magnitude or big-endian or even mixed-endian representations, or on having a BigEndianInt32 type, for instance, nor should it affect the need to use big-endian ordering or non-2's complement representations sometimes when serializing/deserializing data to disk or network.
†Except for the Embedded Swift variant of the standard library, which may support 16-bit pointers and ints as well as big-endian targets. Note that this does not extend to the Swift runtime or other libraries; those will be free to require 32-bit pointers as a minimum and may assume little-endian layout if they wish. Platforms with 16-bit pointers or that use big-endian layout may therefore need to supply their own runtime, and will generally require a 32-bit or 64-bit build machine.
‡ For primary CPU floating point, excluding long double; non-IEEE GPU and ML formats like NVFP4, FP8, BF16 and so on are fine.
** This does not preclude a platform using segmented addressing but supplying Swift with a flat memory map, nor does it preclude using a segment register as a base pointer for per-thread data or for other system-specific purposes that do not affect normal program code; the point is that Swift and its users will not have to deal with far pointers.
††Platforms that are unable to access unaligned words are fine; this is about the ability to specify the addresses of individual bytes.