# Rust is the language of the AGI

Michael Yuan | AI Engineer World's Fair 2025 | 29:14

Source: https://www.youtube.com/watch?v=bbq0b_FpYEY
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/rust-is-the-language-of-the-agi
Published: 2025-06-03
Tags: agents, code-generation, coding-agents, mcp, rag

## TL;DR
- Rust's compiler and type system give coding models strong feedback about whether generated code is valid.
- Rust Coder combines examples, a vector database, Rust project generation, compilation, testing, and repeated fixes into an agentic coding workflow.
- Michael Yuan imagines agents generating and compiling Rust code for systems such as drones, with humans supervising less often.

## Summary
Michael Yuan argues that Rust's difficulty for human beginners may make it a good target for coding models. Its compiler rejects many classes of mistakes and provides a clear feedback signal for reinforcement learning. Rust Coder applies that property to an open-source workflow: it retrieves relevant Rust examples, generates Cargo projects, compiles them, runs tests, sends errors to a coding model, and repeats until the project works. Yuan demonstrates the system in Cursor, first answering a programming exercise and then fixing a deliberately broken Rust project through an MCP server. He also explains the underlying stack, including model runtimes, vector search, compiler-error examples, APIs, and MCP services. The project has been used in a Rust camp with more than 1,000 college students. Yuan is open about the system being unfinished and asks contributors to expand its compiler-error knowledge base and add agent-facing features.

## Key ideas
### Rust's compiler makes a hard language easier for machines to check
[00:41](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=41s)
Yuan begins with Rust's reputation among developers. Stack Overflow surveys have ranked it as the most admired language for the past ten years, while its desired-to-use score is lower. He attributes that gap to Rust's steep learning curve. The compiler and strong type system force programmers to address errors early, including problems that might pass unnoticed in Python, JavaScript, or C++. Humans often prefer languages that let them get a working result quickly, even when the code is harder to maintain. Yuan says Rust becomes easier after the initial learning period, because compiled projects are more likely to run correctly.

### Rust gives coding models a strong reward signal
[04:20](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=260s)
Yuan cites Bret Taylor's argument that humans may prefer Python while machines may be better served by Rust. Rust is efficient, structurally oriented toward compiler checks, and strict about types. For reinforcement learning, the compiler provides a concrete answer to whether a generated program is acceptable. The model can generate code, compile it, read the feedback, and try again. Yuan says this makes Rust a strong fit for AI code generators. If future systems produce code that humans do not fully understand, he wants the code to be easy to verify through compilation and execution.

### Rust Coder teaches models with retrieved Rust examples
[06:41](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=401s)
The Rust Coder project aims to teach coding models Rust and help them generate better Rust programs. The team used Rust education material and had software interns create hundreds of common developer tasks. Those examples were embedded into a vector database. An agent can retrieve relevant code, explanations, and tutorials for a user's programming question or task, then produce a Rust answer. Yuan presents this as help for both people learning Rust and machines that need to generate code on the fly. The project is supported by two Linux Foundation mentorship grants and educational material from the Rust Foundation.

### A retrieved answer can guide a learner through a complete Rust exercise
[09:14](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=554s)
In the first demo, a student must write a Rust program that converts numbers between bases. The request includes examples of input and output and explicitly requires Rust. A coding model running on the Gaia Network produces code and explains its data structures and functions. Yuan copies the result into an IDE and runs cargo run. The program produces the expected result. He says Rust Coder was used by more than 1,000 developers in a university-based Rust camp, where questions like this were exam tasks. According to Yuan, the tool could solve those questions in one shot and explain the answers to learners.

### The MCP server can generate projects and repeatedly fix compiler errors
[11:47](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=707s)
Rust Coder includes an MCP server that integrates with Cursor. One tool, generate, accepts a description and requirements, retrieves a suitable Rust template, and produces a complete Cargo project. The other, compile and fix, receives project files from the editor and compiles them with its own Rust compiler. When compilation fails, a coding model analyzes the error, edits the source, and runs the compiler again. The loop continues until the tool gets the right result. In the demo, a missing closing character breaks a small Hello World project. Cursor calls the MCP tool, receives the corrected project, and applies the fix.

### Compiler-error examples give the system knowledge that generic coding models lack
[17:02](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=1022s)
Yuan says the simple demo could be solved by a general model, but Rust Coder is designed around a dedicated knowledge base of compiler errors and fixes. The database contains examples of the code patterns that trigger errors and ways to correct them. When the system cannot solve an issue, a human or another model may provide a different answer, which can then add knowledge for future cases. The stack combines a coding model, model-specific prompts, retrieved Rust examples, and a self-improving error database. Yuan argues that this specialization could help with harder Rust problems than a general assistant tuned mainly for Python and JavaScript.

### Rust Coder exposes the same workflow through APIs and MCP
[24:13](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=1453s)
The project offers two interfaces. Web-service APIs can be called by workflow engines and deterministic software, while MCP lets language models use the same capabilities as tools. A caller sends a description and requirements to generate a project. For compile and fix, it sends all project files as one flat text payload separated by file markers, and receives the complete project back in the same format. Yuan says the repository can be cloned and started with Docker Compose. An agent framework with MCP support can then decide when to generate Rust code and when to call compile and fix.

### The long-term design is autonomous code generation with compiler feedback
[21:34](https://www.youtube.com/watch?v=bbq0b_FpYEY&t=1294s)
Yuan describes MCP as an interface for machines rather than only a convenience inside an IDE. An agent could use a Rust SDK stored in the MCP server's knowledge base, generate code for a task, compile it, debug it, and deploy it without a person editing each file. His example is a drone whose behavior is controlled by generated Rust code. The compiler would provide a degree of confidence that the code executes correctly before the drone receives it. He presents this as a long-term direction, while acknowledging that Rust Coder is still a work in progress and needs more examples and more functions.

## Notable quotes
- "Rust forces you to write correct and optimized code from the get-go." (02:57)
- "The compiler of the Rust language provides a very good feedback loop for the AI." (05:05)
- "Rust Coder would be able to do it in one shot and would be able to explain its answers to the learner." (11:24)
- "The goal of this long-term project is for people to contribute this knowledge back into the knowledge base." (19:43)
- "The road to AGI is AI coders and Rust is the best language for AI coders to use." (28:42)

## Tools & references mentioned
- Rust
- Rust Coder
- Bret Taylor
- OpenAI
- Stack Overflow Developer Survey
- Python
- JavaScript
- C++
- DeepSeek
- AlphaGo
- AlphaZero
- Linux Foundation
- Rust Foundation
- Cursor
- Gaia Network
- Chancoder
- MCP
- Qwen Coder
- Codestral
- LlamaEdge
- Docker Compose
- Elasticsearch
- TiDB
- Quadrant
- YOLO
- Whisper
- TTS
- Stable Diffusion

## Who should watch
- You are building a coding agent and want compiler feedback to be part of its tool loop.
- You are integrating MCP into an IDE or agent framework and need a concrete generate, compile, and fix example.
- You are interested in contributing Rust examples or compiler-error fixes to an open-source coding project.

## Related talks

- [Why Rust is the Ideal Language for Vibe-Coding](https://aietalks.com/talks/why-rust-is-the-ideal-language-for-vibe-coding) (Daniel Szoke, Sentry, 16:25)
- [Code Generation and Maintenance at Scale](https://aietalks.com/talks/code-generation-and-maintenance-at-scale) (Morgante Pell, Grit, 18:54)
- [Containing Agent Chaos](https://aietalks.com/talks/containing-agent-chaos) (Solomon Hykes, Dagger, 23:48)
- [Beyond the Prototype: Using AI to Write High-Quality Code](https://aietalks.com/talks/beyond-the-prototype-using-ai-to-write-high-quality-code) (Josh Albrecht, Imbue, 17:59)
- [AGI: The Path Forward](https://aietalks.com/talks/agi-the-path-forward) (Jason Warner & Eiso Kant, Poolside, 15:56)
