This document describes a design for Component Object Model (COM) interoperability in Swift: the
@COMattribute, object layout, ARC bridge,QueryInterfaceimplementation, Clang importer integration, threading model, activation, aggregation, and theCOMmodule contents. A companion document (winrt-projection-design.md) covers the WinRT projection layer built on this foundation.
The Component Object Model (COM) is the foundational binary interface standard underlying the Windows platform. Every significant Windows API surface, from Win32 shell extensions to Direct3D, from Office automation to the Windows Runtime (WinRT), is defined in terms of COM interfaces. COM is also used cross-platform: Mozilla's XPCOM and Apple's IOKit both implement COM-compatible binary interfaces, and MiniCOM demonstrates that the binary model is genuinely portable, running on Linux, macOS, Android, iOS, and Web