# Why Rust is the Ideal Language for Vibe-Coding

Daniel Szoke

AI Engineer Europe 2026

[Talk page](https://ai.engineer/talks/ugUeZ8-b-u0-why-rust-is-ideal-language-vibe-coding) · [Video](https://www.youtube.com/watch?v=ugUeZ8-b-u0)

## Why Rust is the Ideal Language for Vibe-Coding

First-attempt runnable code is a weak target for agentic development. Rust’s compiler gives an agent enforceable constraints and specific feedback for its next revision.

Basic familiarity with type checking, async code and shared mutable state is helpful; no prior Rust experience is required.

### Which language should a coding agent use?

[0:16](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=16s)

Which language should you choose for agentic coding? Python, JavaScript and TypeScript are familiar answers. Daniel Szoke, who introduces himself as Sentry’s [Rust SDK](https://github.com/getsentry/sentry-rust) maintainer, begins with that conventional choice. When Szoke asked **ChatGPT**, it recommended Python first and JavaScript/TypeScript second. His own experience put TypeScript ahead.

The GitHub report he cites ranked TypeScript first by distinct monthly code contributors in August 2025. That measures participation, not language quality or coding-agent performance. GitHub’s suggested explanation—that AI-assisted development helped drive the change—is a suspected influence, not established causation. The question is what makes these languages attractive to agents in the first place.

![Purple gradient slide quoting GitHub on TypeScript becoming its most-used language in August 2025, surpassing Python by roughly 42,000 contributors.](https://ai.engineer/api/talk-essay-media/cfabf7e59388fab62495ef0e8480f92e09834a134c27b7b20d533be06ef8d3e2)

GitHub’s contributor-count quotation places TypeScript ahead of Python.

### Why familiar languages produce quick first drafts

[2:04](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=124s)

The advantages are practical, and most help human programmers as well as agents:

- **Familiarity:** These are common languages, often learned early, with conventions that both people and models recognize.
- **Existing building blocks:** Frameworks, libraries and examples let a new application start from established components.
- **Fast iteration:** Python and JavaScript make it easy to run code and inspect its behavior. TypeScript adds compilation to JavaScript, but still supports a quick edit-and-run cycle.
- **Typing support:** Type annotations can catch misuse before execution, although TypeScript’s `any` and Python’s `Any` weaken those checks where they are used.

Together, familiar patterns and relatively few constraints make it easier for a model to produce runnable code on its first attempt. That is an appealing starting experience: generate something, run it, observe the result and iterate.

![Slide with four advantages and a concluding sentence saying LLMs often output runnable code in these languages on the first try.](https://ai.engineer/api/talk-essay-media/44c01af31fe3a34c62b1f0d85d6ddf7118d7a8bdd9e55d16e4f813903e4272fa)

Familiarity, libraries, fast scaffolding and typing support favor TS/JS and Python.

### Runnable code is not the same as reliable code

[3:34](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=214s)

**Ease of generation and reliable behavior are different objectives.** A language that readily accepts a model’s first draft also gives that draft room to contain mistakes. The same flexibility that makes JavaScript, Python and TypeScript convenient can admit both obvious errors and subtle ones. Adding types helps, but type checking alone does not address every failure class, and escape hatches reduce its coverage.

Szoke expects model errors to persist even as models improve, pointing to their nondeterministic behavior. The engineering requirement is therefore familiar: just as software needs safeguards against mistakes by capable human programmers, agent-generated software needs safeguards against model mistakes. Better generation does not remove that requirement.

### What tests and review can establish

[5:31](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=331s)

Tests and code review provide substantial protection, but relying on them alone leaves several distinct gaps.

| Safeguard | Remaining limitation |
| --- | --- |
| Tests written after implementation | An agent may reproduce implementation details in its tests instead of checking the intended behavior independently. |
| Test-driven development | Writing tests first does not make exhaustive coverage of input combinations practical. |
| Agent-written tests and agent review | The model can make mistakes in the verification work too. |

A failing test exposes an incorrect result for the case it exercises. Passing a collection of cases generally cannot prove that every possible input produces the right output. Tests remain useful evidence; they are not a universal proof of correctness.

### Plausible code can fail in unfamiliar ways

[6:40](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=400s)

Yuval Noah Harari’s [Nexus](https://www.ynharari.com/book/nexus/) gives Szoke another way to frame the problem. The book follows information networks from early human societies through the printing press and internet to AI. As Szoke recounts it, Harari prefers “alien intelligence” because “artificial” understates how differently these systems operate from human minds.

For coding, the implication is that a model’s mistakes may not resemble the ones a human reviewer expects. Token prediction can produce sensible variable names, clear comments and convincing structure while concealing a subtle bug. It can also produce an unnecessary heuristic where a direct check would be both simpler and more reliable. The appearance of careful programming is not evidence that the underlying decision is sound.

### Add a deterministic checking layer

[8:46](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=526s)

Szoke invokes Murphy’s Law to motivate another layer of protection: if a failure remains possible, repeated opportunities may eventually expose it. Human review, agent review and testing can reduce that risk. A deterministic check can go further for the particular rules it enforces, rejecting a violation every time it encounters one.

Rust is built around many such constraints. It is a compiled language designed for safety and performance, aiming at C and C++’s performance class while enforcing rules around types, memory and concurrent access. Successful compilation increases confidence that covered classes of errors are absent; it does not establish that the application implements the right behavior.

*Editor’s note:* Rust’s safety guarantees depend on safe Rust and correctly implemented [unsafe abstractions](https://doc.rust-lang.org/book/ch20-01-unsafe-rust.html). Unsafe operations carry obligations that programmers must uphold; `unsafe` does not disable every compiler check.

The compiler’s explanations matter as much as its refusal to accept a program. Rust aims to make diagnostics useful to learners by explaining what went wrong and often how to repair it. Those explanations also give a coding agent concrete context: compile, inspect the rejected operation and revise the code around the identified constraint.

### The constraints an agent must satisfy

[10:53](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=653s)

**Strict type safety** removes the TypeScript-style `any` escape hatch from ordinary type checking. An agent cannot resolve a mismatch simply by declaring that the value should be exempt from those checks.

**Explicit absence** replaces a universal null value with [`Option<T>`](https://doc.rust-lang.org/std/option/enum.Option.html). A possibly missing value is represented as `Some(value)` or `None`, so accessing its payload requires working with that optional representation.

*Editor’s note:* This does not guarantee graceful handling of missing values. `unwrap()` and `expect()` are safe Rust methods that compile but panic when called on `None`.

**Fearless concurrency** extends checking to data used across threads. The compiler constrains which values can move between threads and which can be shared, preventing unsafe combinations from being accepted in safe code. These are only some of Rust’s enforced properties, but concurrency provides a particularly concrete example of how a constraint becomes useful feedback for an agent.

![White slide listing strict type safety, no universal null value, fearless concurrency and additional guarantees, beside an orange Rust crab.](https://ai.engineer/api/talk-essay-media/ca14f29b6aa8037b57b338435b3bda48ac619e2f6da359079b2041f34282cd4e)

Rust safety guarantees: strict typing, null safety and fearless concurrency.

### A shared counter that the compiler rejects

[12:06](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=726s)

The example begins with a counter initialized to zero and concurrent work that increments it. After all 100 increments complete, the intended counter value is 100. The problem is the choice of shared state: the types support shared mutation within one thread, but do not provide synchronization for access across threads.

In an implementation that permits unsynchronized access to shared memory, a counter could intermittently finish with the wrong total. Inside a larger application, locating that race could be difficult. Szoke uses TypeScript as the contrast, then points out that Rust rejects his example before execution.

*Editor’s note:* The JavaScript analogy requires an appropriate shared-memory setup, such as workers accessing a [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer). Ordinary async tasks on one JavaScript thread do not by themselves create this cross-thread data race.

The diagnostic concerns an **async future** that cannot safely be sent between threads. Rust expresses that requirement through [`Send`](https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html): a type implementing it permits ownership to transfer between threads. Although Szoke describes the concurrent work as threads, the diagnostic does not imply a separate operating-system thread for every increment.

Further down, the compiler identifies the captured value: `Rc<RefCell<i32>>` is not `Send`. `Rc` supplies shared ownership within a thread, while `RefCell` permits mutation through runtime borrow checking; neither combination supplies the cross-thread synchronization this counter needs. The central constraint can be isolated without choosing an async runtime:

```rust
use std::{cell::RefCell, future::Future, rc::Rc};

fn increment(counter: Rc<RefCell<i32>>) -> impl Future<Output = ()> + Send {
    async move {
        *counter.borrow_mut() += 1;
    }
}
```

The return type requires a `Send` future, but that future captures an `Rc`. This is the mismatch the agent needs to repair, rather than a vague instruction to make the program safer.

For the same counter, a thread-safe replacement is `Arc<Mutex<i32>>`: `Arc` provides shared ownership across threads, and the mutex protects the read-modify-write operation. Expressing that repair in the increment function gives:

```rust
use std::{future::Future, sync::{Arc, Mutex}};

fn increment(counter: Arc<Mutex<i32>>) -> impl Future<Output = ()> + Send {
    async move {
        let mut value = counter.lock().expect("counter lock poisoned");
        *value += 1;
    }
}
```

The diagnostic has narrowed the agent’s next decision to a concrete one: choose a shared-state representation suitable for the concurrency the program requires.

### Evaluate the repair loop, not just the first draft

[14:22](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=862s)

More constraints make Rust harder for a model to get right on its first attempt. That cost looks different when the model operates inside an agent that can use tools and revise its work:

1. Generate or modify the Rust code.
2. Compile it.
3. Inspect failures and their explanations.
4. Repair the identified problems and compile again.

**A compiler error is actionable feedback, not merely a failed generation.** Each error potentially prevents a production bug. The qualification matters: static checks can conservatively reject valid programs too, so compiler errors are not a one-for-one count of bugs avoided.

Szoke argues that compilation is faster than asking an AI agent to review the code. He presents that as a practical comparison, without a timing benchmark. The more fundamental distinction is what each check establishes: the compiler enforces its covered rules, while an agent reviewer may overlook their violation. Review still has a place, including for behavior beyond the compiler’s guarantees. The proposed workflow keeps it and adds a deterministic layer that the agent can use on every revision.

### The sponsored closing

[15:36](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=936s)

Szoke closes by explicitly identifying the talk as sponsored and returning to his Sentry affiliation. The closing promotion offered attendees three free months of Sentry’s Business plan through a QR code. He also mentions agent monitoring features and invites attendees to the downstairs booth to ask about Sentry or discuss the talk.

## Resources

- [Nexus](https://www.ynharari.com/book/nexus/) — Yuval Noah Harari's history of information networks, from early societies to artificial intelligence.
- [Understanding Send and Sync](https://doc.rust-lang.org/book/ch16-04-extensible-concurrency-sync-and-send.html) — Explains Rust's rules for transferring ownership and sharing references across threads, including Rc, RefCell, Arc and Mutex.
- [Rust Option reference](https://doc.rust-lang.org/std/option/enum.Option.html) — Reference and examples for optional values, payload extraction, fallback values and panic behavior.
- [Spawning tasks with Tokio](https://tokio.rs/tokio/tutorial/spawning) — A practical tutorial on async tasks, ownership and Send bounds, with examples of compiler rejection involving Rc.
- [Sentry Rust SDK](https://github.com/getsentry/sentry-rust) — Official Rust SDK and integrations for reporting application events, errors and panics to Sentry.

## Slides

### AI Engineer Europe

Opening card for AI Engineer Europe.

[0:00](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=0s) [AI Engineer Europe logo in white on a black background.](https://assets.ai.engineer/sites/aiecode2025/sha256/9bc84484548f4eb9f7b88a04e506953a7c2c2aed6778462cad0a5dc88fb1c4ab.webp)

AI Engineer
EUROPE

### Presenting Sponsor

Google DeepMind is the presenting sponsor.

[0:05](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=5s) [Google DeepMind is named as presenting sponsor.](https://assets.ai.engineer/sites/aiecode2025/sha256/7eab358dd46d1a3998b4a1f691d24334ce614d7adcc88aa2b2aa7f50a95bf70a.webp)

PRESENTING SPONSOR
Google DeepMind

### Platinum Sponsors

[0:10](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=10s) [Platinum sponsors Braintrust, WorkOS and OpenAI.](https://assets.ai.engineer/sites/aiecode2025/sha256/cdf1a29d3e146ae1c56cb9547e8d27dd1d127a77ca89f3b2d3859a0436391e6e.webp)

PLATINUM SPONSORS

Braintrust
WorkOS
OpenAI

### Why Rust is the Ideal Language for Vibe-Coding

Sentry’s Rust SDK maintainer Daniel Szoke argues that Rust is ideal for vibe coding, even though it may not be an obvious first choice.

[0:16](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=16s) [Title slide for Daniel Szoke’s talk, dated London, April 2026, with a small view of the speaker and audience.](https://assets.ai.engineer/sites/aiecode2025/sha256/5b5f5cb97bad872a6e2d6dc25a82a01f79ddfcf94dcd43fd7457e35a54cc4afa.webp)

Why Rust is the Ideal Language for Vibe-Coding

London, April 2026
Daniel Szoke

AIE
Google DeepMind

### Asking ChatGPT about Vibe Coding Languages

Daniel Szoke asks ChatGPT for the best vibe-coding language in 2026. It says there is no single number one, but picks Python if forced to choose.

[0:35](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=35s) [ChatGPT prompt asks for the best programming language for vibe coding in 2026.](https://assets.ai.engineer/sites/aiecode2025/sha256/32727d5cbc7a9f0b13b9ece67deaad075e8a2bfac692e64fd903156b54357647.webp)

What’s on your mind today?

What is the number one best programming language for vibe coding in 2026

Interface text:
Private
chatgpt.com
ChatGPT
Log in
Sign up for free
By messaging ChatGPT, an AI chatbot, you agree to our Terms and have read our Privacy Policy. See Cookie Preferences.

[0:52](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=52s) [ChatGPT says there is no single best language for vibe coding, but names Python if forced to choose.](https://assets.ai.engineer/sites/aiecode2025/sha256/a5cf99be733936bffd2808bbfa5296fe343f30cf403467fb38c3b80a8800ed48.webp)

What is the number one best programming language for vibe coding in 2026?

Short answer: there is no single “number one” language for vibe coding in 2026—but if you force a winner, it’s still Python.

Now here’s the honest, nuanced take 👇

🧠 First: what “vibe coding” actually optimizes for

In 2026, vibe coding = AI-first development where you desc

Interface text:
Private
chatgpt.com
ChatGPT
Log in
Sign up for free
Ask anything
ChatGPT can make mistakes. Check important info. See Cookie Preferences.

### ChatGPT on JavaScript and TypeScript

ChatGPT puts JavaScript and TypeScript behind Python, citing their use across browser and backend development. The speaker would reverse the order, favoring TypeScript for agentic coding.

[0:58](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=58s) [ChatGPT ranks JavaScript and TypeScript behind Python and lists reasons for their use.](https://assets.ai.engineer/sites/aiecode2025/sha256/e1c7de6da5ecf6a091eaa6eb4af19aed9ca2fdac690f0ce95331318a4d8c1bb7.webp)

• Beginner-friendly → easier to “steer” AI outputs

👉 It’s consistently ranked #1 for vibe coding lists in 2026  Questera

💡 Translation:
If you say “build me a SaaS backend”, Python + AI usually gets you there fastest with the least friction.

🥈 Strong #2: JavaScript (and TypeScript)

JavaScript is right behind Python.

Why it’s huge:
• Runs everywhere (browser + backend)
• Perfect for full-stack vibe coding
• AI tools are heavily optimized for modern JS frameworks

Use it when:
• You’re building web apps, UIs, SaaS pro[illegible]s

Interface text:
Private
chatgpt.com
ChatGPT
Log in
Sign up for free
Ask anything
ChatGPT can make mistakes. Check important info. See Cookie Preferences.

### GitHub Octoverse 2025

GitHub’s Octoverse article reports TypeScript as the top language by contributor count. The speaker says GitHub suspects AI-assisted development helped drive its rise.

[1:12](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=72s) [GitHub Blog headline says AI leads TypeScript to number one.](https://assets.ai.engineer/sites/aiecode2025/sha256/4fad04c530db3f9914bbdbb4cf00bec857c151744ed26b0d0fa1def064d325b4.webp)

Octoverse: A new developer joins GitHub every second as AI leads TypeScript to #1

In this year’s Octoverse, we uncover how AI, agents, and typed languages are driving the biggest shifts in software development in more than a decade.

Octoverse 2025

AIE
AI Engineer EUROPE

Interface text:
github.blog
Blog
Changelog
Docs
Customer stories
Try GitHub Copilot
See what's new
AI & ML
Developer skills
Engineering
Enterprise software
News & insights
Open Source
Security
Home / News & insights / Octoverse

### Why TS/JS and Python?

The speaker points to familiar languages, rich ecosystems and quick iteration; TypeScript’s types help agents avoid misuse. He says LLMs often produce runnable code on the first try.

[1:52](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=112s) [Slide says TypeScript, JavaScript and Python are common and familiar.](https://assets.ai.engineer/sites/aiecode2025/sha256/d41a28697a68b56a2cd3b2bc7c2bee1d1e4fb34867ff4a8d6d4ebdd271d96a11.webp)

Why TS/JS and Python?

• Common and familiar

AIE
AI Engineer EUROPE

[3:12](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=192s) [Slide lists familiarity, available frameworks and examples, fast scaffolding, and TypeScript typing support. It states that LLMs often produce runnable code in these languages on the first try.](https://assets.ai.engineer/sites/aiecode2025/sha256/3ba345a655bf50ca6b981b4ab5a5898fef2b9d8dada5a3067a6dffadc24d42aa.webp)

Why TS/JS and Python?

• Common and familiar
• Lots of frameworks, libraries, and examples
• Fast to scaffold and run
• TS has typing support

LLMs are often good at outputting runnable code in these languages on the first try.

AIE
AI Engineer EUROPE

### Are we even optimizing the right thing?

The speaker argues that ease of writing is overrated: the flexibility that helps LLMs generate code in these languages also makes mistakes easy.

[3:43](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=223s) [Orange-to-pink slide asks whether we are optimizing the right thing, with the subtitle “A different perspective.”](https://assets.ai.engineer/sites/aiecode2025/sha256/d33088b6c7feb9f19ee0e64c2802884fbe04f50c3883042b6469d8b589a47f77.webp)

Are we even optimizing the right thing?

A different perspective

Interface text:
AIE
AI Engineer

### LLMs are fallible

The speaker expects LLMs to make mistakes even as they improve, and argues that we need to guard against their errors just as we guard against human error.

[4:58](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=298s) [Slide says LLMs are nondeterministic and make mistakes, just like humans.](https://assets.ai.engineer/sites/aiecode2025/sha256/69a1d5924d828a6d9ef17523a13aa9d57e616cdfe2692868fb15388ef2be14b2.webp)

LLMs are fallible

They are nondeterministic and make mistakes, just like us humans

AIE
Engineering the future of AI

### What about tests?

Tests and code review agents help catch errors, but tests written after implementation can check implementation details instead of behavior. Testing every possible input is often impractical.

[5:30](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=330s) [Slide asks about tests and code review agents.](https://assets.ai.engineer/sites/aiecode2025/sha256/3b837300ff76d52c852a310c577bb8bed153e3bdccf471f6eda813303c50b6b1.webp)

What about tests?

And code review agents?

Interface text:
AIE
AI Engineer

### AI = Artificial Intelligence

The speaker introduces Yuval Noah Harari’s Nexus, which traces human information networks from the Stone Age to LLMs. He highlights Harari’s view that LLMs are the first non-human systems able to produce human language.

[6:47](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=407s) [Slide reads “AI = Artificial Intelligence” beside the cover of Nexus by Yuval Noah Harari.](https://assets.ai.engineer/sites/aiecode2025/sha256/58328280bb26c1f64e9fd39f9abdc19aa7df72fba9cbca99377cd1a0524c4d92.webp)

AI = Artificial Intelligence

Yuval Noah Harari
Nexus
A Brief History of Information Networks from the Stone Age to AI
“MASTERFUL AND PROVOCATIVE” MUSTAFA SULEYMAN
THE GLOBAL BESTSELLING AUTHOR OF Sapiens

AIE
Engineering the future of AI

[7:12](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=432s) [Slide reads “AI = Artificial Intelligence” beside the cover of Nexus by Yuval Noah Harari.](https://assets.ai.engineer/sites/aiecode2025/sha256/d8ec4dce4c890e6dddb0e3f56925d465791afa19379a494fbebe17d10209c868.webp)

AI = Artificial Intelligence

Yuval Noah Harari
Nexus
A Brief History of Information Networks from the Stone Age to AI
“MASTERFUL AND PROVOCATIVE” MUSTAFA SULEYMAN
THE GLOBAL BESTSELLING AUTHOR OF Sapiens

AIE
Google DeepMind

### Alien Intelligence and Failure Modes

The speaker calls AI “alien intelligence” because its workings differ from human thinking. Generated code can look polished yet contain subtle bugs or unreliable heuristics.

[7:57](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=477s) [Slide reads “AI = Alien Intelligence” and says failure modes may be totally unexpected for humans, beside the cover of Nexus.](https://assets.ai.engineer/sites/aiecode2025/sha256/f53ddbbe7cf192af196309fac41f5b9a867176e1d7fd913cb0407a7d481595b2.webp)

AI = Alien Intelligence

Failure modes may be totally unexpected for us humans

Book cover:
‘MASTERFUL AND PROVOCATIVE’ MUSTAFA SULEYMAN
Yuval Noah Harari
THE GLOBAL BESTSELLING AUTHOR OF Sapiens
Nexus
A Brief History of Information Networks from the Stone Age to AI

Interface text:
AIE
AI Engineer EUROPE

### Murphy’s Law

The speaker argues that without deterministic guardrails, failures will eventually occur even with review and testing.

[8:44](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=524s) [Slide reads “Murphy’s Law” and “Anything that can go wrong will go wrong.”](https://assets.ai.engineer/sites/aiecode2025/sha256/eb62d94dc50ab660e7dab1aa1c0441f296b2db2dea7117a65d75005795500363.webp)

Murphy’s Law

“Anything that can go wrong will go wrong”

Interface text:
AIE
AI Engineer
EUROPE

[9:09](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=549s) [Murphy’s Law: Anything that can go wrong will go wrong.](https://assets.ai.engineer/sites/aiecode2025/sha256/b81c9174bed7ab1f5db8633dc5fc118282d886d2648240311ce9c043e5d12144.webp)

Murphy’s Law

“Anything that can go wrong will go wrong”

Interface text:
AIE
Engineering the future of AI

### Rust Basics

Rust’s strict compiler enforces safety invariants, while its contextual error messages help beginners and AI agents understand and fix compilation errors.

[10:10](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=610s) [Rust Basics: a compiled language designed for safety and performance, with a strict compiler and contextual error messages.](https://assets.ai.engineer/sites/aiecode2025/sha256/47ea94059b24f570857985d9f1d7955c4f3324ef3c1205507a1eb2d1b4a3a013.webp)

Rust Basics

• Compiled language designed for safety & performance
• Strict compiler enforces many invariants
• Aims to be beginner friendly
• ... so compiler error messages provide a lot of context

Interface text:
AIE
AI Engineer EUROPE

### Rust Safety Guarantees

Alongside strict type safety, Rust uses explicit Option types for values that may be absent and checks access. Its “Fearless Concurrency” checks that data shared across threads is thread-safe.

[11:09](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=669s) [Rust Safety Guarantees lists type safety, null safety, fearless concurrency, and more.](https://assets.ai.engineer/sites/aiecode2025/sha256/9394c6ee5f0d3045ee87981888d1731f7dbfca07ebc5fc46218077a78e773f2d.webp)

Rust Safety Guarantees

• Strict type safety, no bypassing
• Null safety. There’s no universal “null” value
• “Fearless Concurrency”
• … and many more …

Interface text:
AIE
Engineering the future of AI

### Rust Safety Guarantees — Fearless Concurrency

The example tries to increment a shared counter in 100 spawned tasks. Rc and RefCell support mutable sharing within one thread, so Rust rejects this multi-threaded use at compile time.

[11:59](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=719s) [Rust code uses an Rc and RefCell counter in spawned tasks, beside a crab illustration.](https://assets.ai.engineer/sites/aiecode2025/sha256/0359187b43b3e447dcbcb40dc4666333a88b6498cd5d7524843af12433d5f519.webp)

Rust Safety Guarantees — “Fearless Concurrency”

Code Example

// Shared counter
let counter = Rc::new(RefCell::new(0));

// Create 100 threads, which each increment the counter
let handles = (0..100).map(|_| {
    let counter = counter.clone();
    tokio::spawn(async move {
        *counter.borrow_mut() += 1;
    })
});

Interface text:
AIE
Engineering the future of AI

[12:10](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=730s) [Rust counter example highlights Rc and RefCell as not thread safe.](https://assets.ai.engineer/sites/aiecode2025/sha256/f9b0a98664ca1786a9525b337e8d71175880a41f9fef4f4bbbc60dd3010ad00a.webp)

Rust Safety Guarantees — “Fearless Concurrency”

Code Example

// Shared counter
let counter = Rc::new(RefCell::new(0));

// Create 100 threads, which each increment the counter
let handles = (0..100).map(|_| {
    let counter = counter.clone();
    tokio::spawn(async move {
        *counter.borrow_mut() += 1;
    })
});

Not thread safe!

Interface text:
AIE
AI Engineer
EUROPE

### Rust concurrency compile error

Rust rejects the spawned async block: its future cannot be sent safely between threads. The compiler flags the future as not Send.

[13:20](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=800s) [Compiler error states that the async future is not Send; the counter example remains visible.](https://assets.ai.engineer/sites/aiecode2025/sha256/ce91adf2ac74eb1a5609b8c440fd7fa5242a1b2a16a5ccbecc09b3b1f3458cb2.webp)

Rust Safety Guarantees — “Fearless Concurrency”

Compile Error
error: future cannot be sent between threads safely
   --> src/main.rs:10:9
    |
10  | /         tokio::spawn(async move {
11  | |             *counter.borrow_mut() += 1;
12  | |         })
    | |_________^ future created by async block is not `Send`

Code Example
// Shared counter
let counter = Rc::new(RefCell::new(0));

// Create 100 threads, which each increment the counter
let handles = (0..100).map(|_| {
    let counter = counter.clone();
    tokio::spawn(async move {
        *counter.borrow_mut() += 1;
    })
});

AIE
Engineering the future of AI

### Compiler diagnostic identifies the captured counter

The compiler points to the captured counter and identifies Rc<RefCell<i32>> as not Send. The speaker says an AI agent can use that diagnostic to choose a thread-safe type.

[13:45](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=825s) [Compiler diagnostic identifies Rc<RefCell<i32>> as a captured type that is not Send.](https://assets.ai.engineer/sites/aiecode2025/sha256/7f5fe78fbb8d66844b36ff62986d9b63f9aff2f67b2385532aa7632e94f6a255.webp)

Rust Safety Guarantees — “Fearless Concurrency”

Code Example
// Shared counter
let counter = Rc::new(RefCell::new(0));

// Create 100 threads, which each increment the counter
let handles = (0..100).map(|_| {
    let counter = counter.clone();
    tokio::spawn(async move {
        *counter.borrow_mut() += 1;
    })
});

Compile Error
error: future cannot be sent between threads safely
  --> src/main.rs:10:9
   |
10 | /        tokio::spawn(async move {
11 | |            *counter.borrow_mut() += 1;
12 | |        })
   | |________^ future created by async block is not `Send`

Compile Error (continued)
note: captured value is not `Send`
  --> src/main.rs:11:14
   |
11 |             *counter.borrow_mut() += 1;
   |              ^^^^^^^ has type `Rc<RefCell<i32>>` which is not `Send`

Interface text:
AIE
Engineering the future of AI

### Try Sentry

Sentry’s sponsored closing slide promotes its agent monitoring and booth demo. The QR code offers a three-month free trial of its business plan.

[15:34](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=934s) [Sentry promotes agent monitoring, a booth demo and a trial offer alongside a QR code.](https://assets.ai.engineer/sites/aiecode2025/sha256/4f7260467e69d650090623c31da8bc1370b6fa721eb973514fde6c3a3bf9f987.webp)

Try Sentry!

We have agent monitoring.
Come to our booth for a demo!

🤫 Psst ... this QR code gives you a 3 month free trial of our biz plan!

Interface text:
AIE
Engineering the future of AI

[15:56](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=956s) [Sentry slide promoting agent monitoring, a booth demo, and a three-month business plan trial via QR code.](https://assets.ai.engineer/sites/aiecode2025/sha256/81d12bcaefdf275bc75ebaccb117366d0aa907a47e4da6613500dd98a6bfbb3d.webp)

Try Sentry!

We have agent monitoring.
Come to our booth for a demo!

🤫 Psst ... this QR code gives you a 3 month free trial of our biz plan!

Interface text:
AIE
AI Engineer
EUROPE

## Full transcript

[0:00](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=0s) [upbeat music] My name is Daniel Szoke.

[0:16](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=16s) I'm, uh, the Rust SDK maintainer at Sentry, and I wanna tell you why I think Rust is the ideal language for vibe coding. So, the conventional wisdom on what language to use for agentic coding or vibe coding, however you refer to it, um, it's...

[0:37](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=37s) Rust is probably not one of the first things you think of. Um, you know, maybe you think, you know, probably ChatGPT has a good idea what's the best agentic coding language, given that it's also a- an agent of some sort.

[0:53](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=53s) And it would tell you that there's no single number one language, um, but that Python is probably the top language. Um, and as a strong number two, it said JavaScript and TypeScript when I asked it.

[1:06](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=66s) Um, and I think that this is, in at least my experience, pretty true, although I would flip the order because, um, TypeScript seems to have come out as, like, the top choice for agentic coding lately.

[1:22](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=82s) And, um, so there's even this article from GitHub that came out, uh, I guess late last year, and it says that AI... Like, they think that AI has pushed TypeScript to the number one, um, language on GitHub by contributor counts at least.

[1:40](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=100s) Um, so they know it's TypeScript is the number one language, and they, they strongly suspect that that's because of people using it for AI-assisted development. But why are these languages, Python, TypeScript, JavaScript, so ideal for vibe coding, um, at least in the, this sort of

[2:04](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=124s) conventional wisdom? So first of all, they're common and familiar languages. Um, so they're, they're, they're usually the languages you would learn if you were learning programming from scratch. So they're easy for humans, and they also seem to be easy for LLMs.

[2:22](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=142s) There's also a lot of frameworks, libraries, and examples out there, um, so that, that's helpful if you're building something new from scratch, of course, that you can build it on top of something.

[2:35](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=155s) And, you know, it's helpful for humans. It's also helpful for agents.

[2:40](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=160s) They're fast to scaffold and run. They're dynamic languages. They're interpreted, at least JavaScript and Python are. TypeScript, maybe there's some light compilation down to JavaScript or something. But it's pretty easy just to run it and see what it does, and then you iterate on that.

[2:59](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=179s) And, uh, particularly for agents, the typing support is helpful so that the agent doesn't misuse types. Um, but, uh, yeah, there's the any type that it kind of undermines that a little bit in, in TypeScript and, and typed Python.

[3:16](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=196s) But, you know, overall, these languages, LLMs, the models themselves are pretty good at outputting runnable code in the first try because these languages are simple, um, and they impose few constraints.

[3:34](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=214s) So I think because of this fact that LLMs just seem to be good at writing them, people jump to these languages. Um, but I think something that a lot of people, in my experience, don't question as much is whether this is even something we want to optimize for, right?

[3:55](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=235s) Um, the classic vibe coding languages are easy for the models to write, but is that even a good thing?

[4:04](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=244s) My argument is that the importance of it being easy for the model to write the language is overstated, and in fact, I would even say that in some cases it's a bad thing that these languages are easy for the models to write.

[4:22](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=262s) Um, the dynamic and flexible nature of the languages is what makes it easy for the agent, or for the LLM, I should say, to write JavaScript, Python, TypeScript. Um, but this same flexibility also makes it very easy to make mistakes, sometimes even obvious mistakes, sometimes less obvious mistakes.

[4:45](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=285s) Adding typing is a helpful constraint, but that only gets you so far, um, because it only gives you the type safety, and also it's not a very strong type safety, um, in TypeScript or Python.

[4:59](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=299s) And this is, of course, a problem because LLMs are fallible. They will always be fallible because they are, by design, non-deterministic systems. So hopefully in the future they get better at making mistakes less often.

[5:15](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=315s) But I don't think this is something that would ever disappear entirely. And so just like the smartest humans make mistakes and we need to guard against human error, we're also gonna need to guard against LLM error.

[5:31](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=331s) One way that folks often would do that, especially also in the conventional, uh, vibe coding languages, is adding tests. This is a huge help, but there are a lot of problems with only relying on having tests and, and code review agents.

[5:51](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=351s) Um, firstly, you know, if you don't prompt the agent skillfully, it'll often write the tests after the implementation, and then you just end up testing implementation details without actually testing the behavior properly.

[6:06](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=366s) Uh, even with that test-driven development, though- Tests usually can only prove incorrectness when they fail. Because it's impractical to test every single possible input combination, you can't prove that every input produces the correct output in a lot of cases.

[6:29](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=389s) And then, of course, if LLMs are the ones generating the tests, they may make mistakes when writing those tests, and the same thing applies to code review agents.

[6:40](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=400s) And then kind of more on a philosophical level, right? We all know AI stands for artificial intelligence, but there's this book called Nexus I recently read, and I can highly recommend it to anyone who hasn't read it yet.

[6:54](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=414s) It's from an author, Yuval Noah Harari. He's a historian, and he has kind of a unique perspective on artificial intelligence, so he's discussing human information networks all the way from Stone Ages to printing press, to internet, to now with LLMs, right?

[7:16](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=436s) Um, and he thinks LLMs are really unique because it's the first time we have something that's non-human that's able to produce human language. And, um, a point he makes that really stuck with me is that he doesn't like that the A in AI is artificial because it understates how different, um, LLMs and other AI

[7:40](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=460s) technologies are from how humans think, and he actually likes to call it alien intelligence instead. Um, because the internal workings of how they think at a low level is different from how we think.

[7:55](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=475s) LLMs predict tokens that come in streams, and it's a very powerful mechanism of thinking, but it's not how we think. And my point here is that the failure modes might be totally unexpected to us, and I'm sure if you've done any coding with AI, you might have had a situation where you got code that looked really nice.

[8:17](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=497s) It might have had sensible variable names, good comments, and whatever, but when you take a look, something might not be right. Like, there might be a subtle bug, or maybe it's relying on some heuristic when you could check the actual thing and more reliably and more easily in some cases.

[8:36](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=516s) So you really need to be careful with this, with, um, LLM and agentic-based development, right?

[8:46](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=526s) And then that brings me to Murphy's Law, which basically states that anything that can go wrong will go wrong eventually at some point, right? So if you are using a language without deterministic guardrails, even if you apply human review, uh, agentic review, test...

[9:04](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=544s) a good testing process, if you don't have something that is a absolute deterministic guard against this, eventually you're gonna have some failures. And in these languages like JavaScript, Python, TypeScript, where you lack these guardrails a lot of the times, you're gonna have failures more often, right?

[9:26](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=566s) Um, and this brings me to Rust, which is a language with many constraints. Um, and so for those of you who don't know anything about Rust or don't know that much about it, some basic background.

[9:42](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=582s) It's a compiled language. It's designed with safety and performance in mind. It wants to be as fast as C and C++, but it wants to be memory-safe, type-safe, um, and basically wants to be such...

[9:58](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=598s) Like, it wants to have such a strict compiler that if the code compiles, you can be reasonably confident that a lot of different types of bugs are not present in your code.

[10:10](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=610s) Um, and that, that happens because the compiler is enforcing invariants like type safety, memory safety, concurrency, et cetera.

[10:21](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=621s) Um, and the language tries to be very beginner-friendly. So Rust itself, I think people who haven't encountered it would kind of have the perception that it's very advanced, but they try to make the language easy to learn.

[10:34](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=634s) The compiler errors give you a lot of information on what went wrong and how to fix the problem. And so they provide a lot of context, and of course, this is really helpful when AI agents compile Rust code, hit an error, and then need to fix it.

[10:53](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=653s) So as I mentioned, there's a lot of safety guarantees in Rust, right? Um, first one worth mentioning is that the type safety is, is strict. You can't bypass it with some any type or an unchecked cast.

[11:08](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=668s) Null safety is another big one if you've come from other languages. There's no universal null value. If you want to have an option that... or an, a type that can be empty, you need to define it explicitly as an Option type, and the compiler will force you to always check that the value is there before you access

[11:28](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=688s) the inner value. And fearless concurrency, which is, I think, really powerful, and it basically means that the Rust compiler will check if you have a, any multi-threaded code, that any data shared between the threads is done, that that's all done in a thread-safe way.

[11:49](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=709s) And this is really just a small list. There's, there's so many more things that the Rust compiler enforces. But I just wanna give you all a quick example on fearless concurrency because I think it's, it's really powerful.

[12:06](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=726s) So here's a little code example. Basically, we have a counter here, which is gonna start with a value of zero, and we're gonna create 100 threads here, um-

[12:19](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=739s) And each time we're gonna take the counter and add one to this inner value. So once all these threads finish, you would expect this to have a value of 100.

[12:33](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=753s) Now, there's a problem here, which is that, um, these types here, they're designed for, um, sharing mutable data, but only within a single thread. They're not synchronized for, um, multi-threaded safe access.

[12:51](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=771s) Um, so in a language like TypeScript, something like this might compile, it might run, and then you would only notice the problem when every once in a while you would get a value other than 100 out of this, right?

[13:06](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=786s) And it might be, especially if this is a small s- part in a bigger application, it could be very difficult to debug where this data race is occurring. But in Rust, this just doesn't compile.

[13:21](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=801s) You're gonna get a compile error, and it will say, "Error: Future cannot be th- sent between threads safely." Um, this future, so this little async block in here, um, is not Send, and all Send means is safe to be sent between threads, and it's not.

[13:41](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=821s) So this error isn't that helpful, but if you scroll down in the error message, it'll explain further, and this is what's gonna be really helpful to your AI agent because it says, "Oh, the value here, this counter value that was captured, it's not Send.

[13:59](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=839s) It has type Rc<RefCell<i32>>, and that's not Send." And so if your AI agent, when it just compiles your project, it'll get this compiler error, and it can immediately go and change this to a thread safe type, of which there's, there's plenty in, in Rust.

[14:22](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=862s) Um, so of course, all these, uh, constraints come with a trade-off. Rust is harder for LLMs to ru- get right on the first try because there's so many rules they need to follow.

[14:35](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=875s) But I think this is a good thing. Um, that's because it's not just LLMs that write code. We put the LLM in an AI agent. It's in a loop.

[14:45](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=885s) It can do things autonomously. And AI agents are very well-suited to be able to compile their code, check any failures, and then go and fix them. And every compile error, um, is potentially a bug that you avoid in your production code.

[15:03](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=903s) So, um... And, and with the Rust compiler, like something I hear sometimes, people complain that compile times are slow. But I guarantee you that it's faster than letting an AI agent review your code, and it might not even find all the errors that the Rust compiler is guaranteed to find.

[15:25](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=925s) I still think you should use, use it, of course, but it's good to have this, um, additional element of safety, I guess.

[15:36](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=936s) And of course, this is a sponsored talk, and I'm from Sentry, so this is the little marketing slide. Um, you should try us out if you don't already. This QR code would give you three months for free of our business plan.

[15:52](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=952s) Um, we have agent monitoring features. We have a booth downstairs. Come by, feel free to ask questions about Sentry, or if you wanna talk to me about the talk, you can also come by and I'm happy to chat.

[16:05](https://www.youtube.com/watch?v=ugUeZ8-b-u0&t=965s) Thank you. [clapping] [outro music]
