2017 LLVM Developers’ Meeting: “Implementing Swift Generics ”
http://www.LLVM.org/devmtg/2017-10/
—
Implementing Swift Generics - Douglas Gregor, Slava Pestov and John McCall
Slides: Coming Soon
—
Swift is a safe and efficient systems language with support for generic programming via its static type system. Various existing implementations of generic programming use either a uniform runtime representation for values (e.g., Java generics) or compile-time monomorphization (e.g., C++, Rust). Swift takes a “dictionary-passing” approach, similar to type-classes in Haskell, using reified type metadata to allow generic code to abstract over the memory layout of data types and avoid boxing. In this talk, we will describe the compilation of Swift’s generics from the type checker down to LLVM IR lowering and interaction with the Swift runtime, illustrating the how the core representation of generics flows through the system, from answering type-checking queries to the calling convention of generic functions and runtime representation of the “dictionaries”.
—
Videos Filmed & Edited by Bash Films: http://www.BashFilms.com