2017 LLVM Developers’ Meeting: “Implementing Swift Generics ”
LLVM2 HN recommenders · recommended in 2 months, 2017-2026
21K views · 9 years ago · talk · evergreen
Swift compiler engineers explain how Swift implements generics using dictionary-passing with reified type metadata. They compare it with Java-style uniform representation and C++ or Rust monomorphization.
Recommended as the clearest explanation of how Swift generics compile and how that differs from other languages.
31:22Swift for TensorFlow: The Next-Generation Machine Learning Framework (TF Dev Summit '19)
TensorFlow
41K views • 7 years ago
1:05:45I Interviewed The Creator Of LLVM, Clang, Swift, and Mojo
The PrimeTime
274K views • 2 years ago
26:012018 LLVM Developers’ Meeting: C. Schafmeister “Lessons Learned Implementing Common Lisp with LLVM”
LLVM
61K views • 7 years ago
39:40"Type-Driven Program Synthesis" by Nadia Polikarpova
Strange Loop Conference
15K views • 8 years ago
40:332016 LLVM Developers’ Meeting: D. Dunbar “A New Architecture for Building Software”
LLVM
7K views • 9 years ago
22:17WWDC24: Go small with Embedded Swift | Apple
Apple Developer
138K views • 2 years ago
1:14:32Building Your Own Dynamic Language
Stanford
21K views • 18 years ago
50:11Twitter’s Quest for a Wholly Graal Runtime by Chris Thalinger
Scala Days Conferences
3K views • 8 years ago
1:50:07JSON Parser 100% From Scratch in Haskell (only 111 lines)
Tsoding
205K views • 6 years ago
2:07:18Demo: Base language, compile-time execution
Jonathan Blow
164K views • 12 years ago
2:03:12Co-dfns Live Stream: Compiler Design and Architecture
Aaron Hsu (arcfide)
21K views • 9 years ago
59:03Breaking Down Programming Paradigms: APL's Surprising Learning Curve // Aaron Hsu // Dyalog '17
Dyalog User Meetings
7K views • 9 years ago
1:28:59Psp collections: views and more by Paul Phillips
AI Council
11K views • 12 years ago
1:01:40Demo: Implicit Context
Jonathan Blow
28K views • 11 years ago
49:482023 LLVM Dev Mtg - Mojo 🔥: A system programming language for heterogenous computing
LLVM
61K views • 2 years ago
1:22:21Introducing a Memory-Safe Successor Language in Large C++ Code Bases - John McCall - CppNow 2023
CppNow
18K views • 3 years ago
1:07:00Sydney Golang Meetup - Rob Pike - Go 2 Draft Specifications
Macquarie Group
57K views • 7 years ago
13:45A 10x faster TypeScript
Microsoft Developer
608K views • 1 year ago
1:08:52JVMLS 2015 - Compilers are Databases
Java
16K views • 11 years ago
57:38Clasp: Common Lisp using LLVM and C++ for Molecular Metaprogramming
Google TechTalks
52K views • 11 years ago
4 comments from Hacker News
> It doesn't make sense to me that an embedded VM/interpreter could ever outperform direct code. You're adding a layer of abstraction and indirection, so how is it possible that a more indirect solution can have better performance? It is funny, but (like I’ve already mentioned[1] a few months ago) for serialization(-adjacent) formats in particular the preferential position of bytecode interpreters has been rediscovered again and again. The earliest example I know about is Microsoft’s MIDL, which started off generating C code for NDR un/marshalling but very soon (ca. 1995) switched to bytecode programs (which Microsoft for some reason called “format strings”; these days there’s also typelib marshalling and WinRT metadata-driven marshalling, the latter completely undocumented, but both data-driven). Bellard’s nonfree ffasn1 also (seemingly) uses bytecode, unlike the main FOSS implementations of ASN.1. Protocol Buffers started off with codegen (burying Google user in de/serialization code) but UPB uses “table-driven”, i.e. bytecode, parsing[2]. The most interesting chapter in this long history is in my opinion Swift’s bytecode-based value witnesses[3,4]. Swift (uniquely) has support for ABI compatibility with polymorphic value types, so e.g. you can have a field in the middle of your struct whose size and alignment only become known at dynamic linking time. It does this in pretty much the way you expect[5]: each type has a vtable (“value witness”) full of compiler-generated meth
The Swift story around ABI stability and library evolution is pretty unique. Relatedly, its approach to generics doesn't fall into either of the 2 traditional paths (either box everything like Java and C#, or template instantiation like C++ or Rust). link ▶ this video
Swift's generics have some unique properties at module boundaries to allow for a stable ABI while enabling library evolution. To get additional background, you might be interested in this[0] conference talk (the paper's author is one of the co-presenters). Also, this post[1] by a Rust and Swift compiler engineer talks about what Swift does differently than other languages, and the tradeoffs that are involved. [0] ▶ this video [1] link
If you're interested, there's a very nice talk on how Swift's generics compile. It's different to Rust in some key ways. ▶ this video