The Pragmatic Engineer: "From Swift to Mojo and High-Performance AI Engineering with Chris Lattner"
Date: November 5, 2025
Host: Gergely Orosz
Guest: Chris Lattner (Creator of LLVM, Swift, and Mojo)
Episode Overview
This episode features an in-depth conversation with Chris Lattner, one of the most influential figures in modern programming languages and compiler technologies. The discussion spans Chris's unique journey: from creating LLVM (the bedrock of many compilers), to his behind-the-scenes work on Swift at Apple, and his current efforts building the new Mojo programming language for high-performance AI engineering at Modular. Chris delves into lessons learned, how software and hardware intersect, strategies for introducing sweeping changes at large companies, and the future of programming in an AI-driven world. Engineers and tech leaders will find practical wisdom, vivid anecdotes, and candid takes on building impactful engineering projects from the ground up.
Key Discussion Points & Insights
1. Early Industry Context: The Compiler Landscape
-
State of Compilers in the Early 2000s
- In the 1980s and 90s, each hardware vendor built their own proprietary C compiler, leading to widespread incompatibility and confusion.
- "It was a gigantic mess... GCC came on the scene, really in the 90s, and cleaned up that mess... It became the standardized thing." — Chris Lattner [03:19]
- GCC’s open source nature helped propel Linux and standardized compiler environments.
- However, GCC was inflexible, monolithic, and lacked modern features like JIT and cross-file optimization.
-
Birth of LLVM
- Chris started LLVM as a university project to improve on GCC's limitations and as a means to learn about compiler design.
- LLVM introduced modularity, flexibility, and new capabilities — such as JIT compilation and targeting multiple architectures.
- "Compilers are cool, even today!" — Chris Lattner [06:09]
- LLVM's adoption within Apple was gradual and pragmatic: first for internal uses and experimenting, eventually moving to core product tools.
2. Driving Strategic Tech Change Inside Big Tech
-
Winning Organizational Support
- Progress depended on both top-down executive support and bottom-up grassroots wins:
- "It wasn't one thing, it was just a lot of hard work... every six months we'd have a new thing... I became known as somebody who would get things done." — Chris Lattner [14:28]
- Gradually, LLVM replaced all of Apple’s internal compiler/codegen/debugger infrastructure, culminating in industry-defining moments such as enabling the first 64-bit iPhone.
-
Convincing a Closed Company to Open Source Critical Tools
- LLVM/Clang: “We didn’t really ask too many people for permission, we just kind of did it. And so that was the easy one. The hard one was Swift.” — Chris Lattner [20:05]
- Strategic stealth, clear technical impact, and persistence allowed these projects to eventually get green-lit despite initial resistance.
3. The Genesis and Evolution of Swift
-
From Nights-and-Weekends Project to a Shipping Language
- Swift started around 2010 as a secret side project by Chris to address Objective-C’s limitations, particularly around safety and modernity.
- Borrowed ideas from a wide survey of languages (e.g., OCaml, Haskell, Go, TypeScript).
- "The first year and a half it was literally just me working on it... didn't ask permission, just started fiddling around, seeing what could be done that would be better." — Chris Lattner [00:00]
-
Design Philosophy & Challenges
- Focus: memory safety, scalability from embedded to high-level scripting, and leveraging best ideas across the language space.
- “The initial ideas of Swift was really about saying, how do we build a scalable language and how do we pull together the best ideas, shamelessly, you know, borrowing ideas from different places.” — Chris Lattner [23:20]
- Transition from secret to official project involved slow, internal socialization and incremental migration of features from Swift prototypes into Objective-C.
-
Painful but Necessary Launch
- Swift 1.0 shipped in 2014, but with known rough edges; Chris’s team was explicit about expected source-breaking changes and instability.
- “We told people: we will help you, but expect code breakage. And I’m glad we did that.” — Chris Lattner [34:04]
- Many in the Apple developer community were excited but wary, with significant internal debate over Objective-C vs. Swift for production use.
- Adoption required nudging both early adopters and skeptics, with SwiftUI later serving as a killer feature for late migration.
-
Reflection on Mistakes and Learnings
- Chris candidly revisits hasty architectural decisions, feature creep, early technical debt, and the need to iterate at the language level.
- "Early Swift... I didn’t know what I was doing. I’d never done it before. I’d built a C compiler which had a spec... and so a lot of the ideas going into it were new... That’s my fault." — Chris Lattner [42:59]
- The transition to Swift 3.0 represented stabilizing and cleaning up the language.
4. The Path to AI: Tesla, Google, Modular, and Mojo
-
Falling in Love with AI (2016+)
- Sparked by applied AI (image recognition in the Photos app), Chris joined Tesla and then Google to work on deep learning infrastructure, especially for new AI chips (TPUs).
- Led efforts to scale TensorFlow’s support for CPUs, GPUs, TPUs, and built foundational systems like MLIR.
-
Identifying the Modern AI Software Stack Problem
- At Google and Sci-Fi, Chris saw the pain of hardware-vendor-specific vertical stacks, causing massive duplication, bug-prone kernels, and inflexibility.
- "Before gcc, every chip maker had to build their own software stack. That's literally the shape of AI software today... you share very low code." — Chris Lattner [53:16]
- Modular’s vision: Build the LLVM for AI — a unified, extensible software stack (including a new language: Mojo) that allows targeting multiple hardware vendors efficiently.
-
Mojo: Design, Principles, and Uniqueness
- Mojo merges Python familiarity with scalable, high-performance semantics and a powerful, unified metaprogramming system (inspired by Zig, but modernized).
- "Mojo is a member of the Python family, so it's super familiar, easy to learn... One of the simplest things to do with Mojo is to extend an existing Python module. No bindings—just like Swift and Objective-C." — Chris Lattner [69:44]
- Explicit focus on giving performance control back to developers (e.g., vectorization, hardware features) and not hiding magic heuristics in the compiler.
- Mojo’s design lets programmers (not just compiler experts) build high-performance, portable, and easily readable code for CPUs, GPUs, and future accelerators.
- “A lot of what makes Mojo really special is it takes power out of the compiler and gives it to you as a developer. Because it turns out a lot of people can write code, they can’t necessarily write compilers.” — Chris Lattner [61:23]
-
Current Progress and Next Steps for Modular/Mojo
- Modular’s team: ~140 engineers, supporting multiple architectures across Nvidia, AMD, and Apple.
- Mojo 1.0 is targeted for early summer next year (2026), incorporating lessons from Swift’s bumpy 1.0.
- Open source is central; hundreds of thousands of lines available for AI tools and LLM training.
- "We're still at the beginning and every year of our journey is just another epoch of new things to build and learn and grow and develop into this." — Chris Lattner [78:40]
5. Programming in the Age of AI: Humans & LLMs
-
AI Coding Tools in Engineering at Modular
- AI coding assistants (e.g., Claude, Cursor) are already boosting productivity, especially for mechanical or prototyping tasks.
- For advanced engineers, the net productivity boost is meaningful (around 10%), but for prototyping or those less expert, it can be transformative.
- "For me... I still code. I use Cursor as my daily driver right now. And so I feel like it's a good 10% productivity [boost]..." — Chris Lattner [79:43]
- Risks: “Vibe coding” (blindly accepting LLM-generated code) can rot architecture and introduce maintainability problems. Human review and understanding remain key for production code.
-
Should We Build Languages for LLMs?
- Chris is clear: languages should prioritize human readability and expressivity, not just optimize for AI agents.
- "I don’t think that optimizing for the LLM is the right thing to do at all... The important thing is reading the code. Always has been, by the way. Code is read more often than it's written... Writing the code is actually not the key thing to me, it's about reading it." — Chris Lattner [86:12 - 86:21]
- Open source, concise syntax (like Python), great error messages, and high expressivity make both human and AI use easier and more effective.
6. Careers: Advice, Hiring, and Learning Compilers
-
Engineering Hiring at Modular
- The team recruits both seasoned specialists (e.g., GPU experts, compiler veterans) and fearless early-career engineers, including new graduates.
- Curiosity, willingness to tackle unknowns, and open-source contributions are highly valued.
- "I love to see people that are really hungry, have not given up, and just said, AI will do everything for me. They're intellectually curious, willing to work hard, and they're fearless... Open source contribution is a simple way to prove you can also work with a team." — Chris Lattner [83:43]
-
Getting Started with Compilers
- Compilers offer real-world programming experience: layering, correcting mistakes, and cumulative learning.
- Start with standard tutorials, e.g., LLVM’s Kaleidoscope, or Rust’s compiler ecosystem.
- "Compilers don't get the credit they deserve... There's a lot of really good jobs in compilers. I really do encourage people to do it because we need more folks in this field." — Chris Lattner [90:47]
Notable Quotes & Memorable Moments
| Timestamp | Quote | Speaker | |---|---|---| | 00:00 | “I just started again, nights and weekends. Didn’t ask permission, just started fiddling around, seeing what could be done that would be better.” | Chris Lattner | | 14:28 | “It wasn't one thing, it was just a lot of hard work and it was a lot of fun because we were able to... get things done, you had an amazing platform in which to work.” | Chris Lattner | | 23:20 | "How do we build a scalable language and how do we pull together the best ideas shamelessly, you know, borrowing ideas from different places." | Chris Lattner | | 34:04 | "We told people: we will help you, but expect code breakage. And I’m glad we did that." | Chris Lattner | | 42:59 | "Early Swift... I didn’t know what I was doing. I’d never done it before... and so a lot of the ideas going into it were new... That’s my fault." | Chris Lattner | | 53:16 | "Before gcc, every chip maker had to build their own software stack. That's literally the shape of AI software today..." | Chris Lattner | | 61:23 | “A lot of what makes Mojo really special is it takes power out of the compiler and gives it to you as a developer. Because a lot of people can write code, they can’t necessarily write compilers.” | Chris Lattner | | 69:44 | “Mojo is a member of the Python family, so it's super familiar, easy to learn... One of the simplest things to do with Mojo is extend an existing Python module. No bindings.” | Chris Lattner | | 86:12 | "I don't think that optimizing for the LLM is the right thing to do at all... The important thing is reading the code. Always has been." | Chris Lattner |
Segment Timestamps
- 00:00 – 08:12: Early context, GCC’s dominance, birth of LLVM
- 08:12 – 16:22: Differences between GCC/LLVM, early open source journey
- 16:22 – 20:19: Driving change at Apple, open sourcing critical infrastructure
- 20:19 – 34:33: The Swift backstory: inception, design, “secret” development, cultural challenges
- 34:33 – 45:30: Swift's launch, developer adoption, and lessons learned
- 45:30 – 51:13: Iteration in language/compiler design, the importance of starting fresh, technical debt
- 51:13 – 55:50: From Apple to Tesla, Google, and Sci-Fi—AI stack realities
- 55:50 – 61:23: Modular’s founding, the rationale behind Mojo
- 61:23 – 74:32: Mojo’s design, empowering more programmers, taking compiler power to the user, code-portability
- 74:32 – 79:17: Modular’s progress, hiring, company culture, and ecosystem
- 79:17 – 88:41: AI tools in engineering, LLMs, language design for AIs, open source and future direction
- 88:41 – end: Advice for aspiring compiler engineers, how to get started, compilers as a practical field
Conclusion
Chris Lattner’s journey is a testament to persistence, curiosity, and the impact of building foundational tools that empower other builders. His approach—start small, iterate fast, welcome change, and bring as many people along the learning curve as possible—emerges as a playbook for both software engineering leaders and ambitious individual contributors. Whether it’s rethinking programming languages for safety and scalability (Swift), or making cutting-edge AI accessible and performant for all (Mojo), Chris’s work continues to shape the direction of how software (and now, AI) is built.
For more episodes and engineering deep-dives: newsletter.pragmaticengineer.com
This summary skips sponsor reads and non-content segments, focusing on core technical and experiential discussions.
