Adding the Rust Coding with AI article. Changing Ricardo Tafas author…#689
Adding the Rust Coding with AI article. Changing Ricardo Tafas author…#689rftafas wants to merge 1 commit intoespressif:mainfrom
Conversation
|
🎉 A preview for this PR is available at: https://preview-developer.espressif.com/pr689/ |
There was a problem hiding this comment.
@rftafas Thank you for writing this article!
It gave me food for thought. I really enjoyed its conversational style. Pointed out a couple of nitpicks along the way.
Do you plan to create a feature image for the article or should we help you?
Also , please rebase your branch on main to fix PR previews. We introduced some breaking changes to optimize deployment.
| featureAsset: "featured.webp" | ||
| authors: | ||
| - "ricardo-tafas" | ||
| summary: "AI assistants are most effective on ESP32 Rust firmware when you supply clear specs, pinned crates, reference implementations (often ESP-IDF C), and a tight verify loop. The article discusses good practices, pitfalls, discipline, and entropy. A brief explanation about the device is also included, along with the repository and all artifacts." |
There was a problem hiding this comment.
AI assistants
You mean AI agents here and in the rest of the article?
|
|
||
| ### 1.1 Contextualization | ||
|
|
||
| Large language models (LLMs) and coding agents can speed up firmware development on Espressif SoCs. That applies to **Rust on bare metal**. The crates `esp-hal` and `esp-radio`, the Embassy project, and many small protocol crates are all there. Yet, we see little adoption of Rust. That includes me. I've recently been learning it, and if pressured to deliver results, I would fall back on the _C_ that I already know; or, depending on the pressure and time available, the Arduino Core for ESP32 framework as well. The same tools I already use, if enhanced by AI, would make me even more productive. But... What about that junior feeling of starting something new? Well... I challenged myself. |
There was a problem hiding this comment.
the Embassy project
Should a link be added?
|
|
||
| ### 1.2 About Rust in this Challenge | ||
|
|
||
| Rust’s compiler catches many errors that would otherwise appear only on device. That pairs well with AI-generated code: you get **fast iteration in the editor** and **strong feedback from `cargo check`**, provided the model stays inside the right ecosystem (`esp-hal` 1.x, although focused for the newer RISC-V, still supports Espressif Xtensa). It is, then, safe to assume that Rust will benefit greatly from this new LLM-oriented coding world. |
There was a problem hiding this comment.
| Rust’s compiler catches many errors that would otherwise appear only on device. That pairs well with AI-generated code: you get **fast iteration in the editor** and **strong feedback from `cargo check`**, provided the model stays inside the right ecosystem (`esp-hal` 1.x, although focused for the newer RISC-V, still supports Espressif Xtensa). It is, then, safe to assume that Rust will benefit greatly from this new LLM-oriented coding world. | |
| Rust’s compiler catches many errors that would otherwise appear only on device. That pairs well with AI-generated code: you get **fast iteration in the editor** and **strong feedback from `cargo check`**, provided the model stays inside the right ecosystem (`esp-hal` 1.x, although focused on the newer RISC-V, still supports Espressif Xtensa). It is, then, safe to assume that Rust will benefit greatly from this new LLM-oriented coding world. |
|
|
||
| Rust’s compiler catches many errors that would otherwise appear only on device. That pairs well with AI-generated code: you get **fast iteration in the editor** and **strong feedback from `cargo check`**, provided the model stays inside the right ecosystem (`esp-hal` 1.x, although focused for the newer RISC-V, still supports Espressif Xtensa). It is, then, safe to assume that Rust will benefit greatly from this new LLM-oriented coding world. | ||
|
|
||
| The ecosystem has reached milestones that make the story easier to explain to both humans and models. And managers. For example, the `esp-hal 1.0` [announcement](https://developer.espressif.com/blog/2025/10/esp-hal-1/) on the Developer's Portal; official and community docs, like the [Rust on ESP Book](https://docs.espressif.com/projects/rust/book/) and the [no_std training](https://docs.espressif.com/projects/rust/no_std-training/), are enough of a foundation for anyone to conclude that yes, it could be used. |
There was a problem hiding this comment.
| The ecosystem has reached milestones that make the story easier to explain to both humans and models. And managers. For example, the `esp-hal 1.0` [announcement](https://developer.espressif.com/blog/2025/10/esp-hal-1/) on the Developer's Portal; official and community docs, like the [Rust on ESP Book](https://docs.espressif.com/projects/rust/book/) and the [no_std training](https://docs.espressif.com/projects/rust/no_std-training/), are enough of a foundation for anyone to conclude that yes, it could be used. | |
| The ecosystem has reached milestones that make the story easier to explain to both humans and models. And managers. For example, the `esp-hal 1.0` [announcement](https://developer.espressif.com/blog/2025/10/esp-hal-1/) on the Developer Portal; official and community docs, like the [Rust on ESP Book](https://docs.espressif.com/projects/rust/book/) and the [no_std training](https://docs.espressif.com/projects/rust/no_std-training/), are enough of a foundation for anyone to conclude that yes, it could be used. |
|
|
||
| I also used Cursor, but other tools and agents would yield a very similar experience. The rest of this note walks through workflow (how we worked with an AI agent), what can go wrong (including Git as undo and entropy as clutter), what we built, and the documents that kept humans and the model aligned. | ||
|
|
||
| I'm going to use the M5 ESP DualKey development kit. It provides enough ready-to-go peripherals. No breadboard this time. |
There was a problem hiding this comment.
| I'm going to use the M5 ESP DualKey development kit. It provides enough ready-to-go peripherals. No breadboard this time. | |
| I'm going to use the M5Stack ESP DualKey development kit. It provides enough ready-to-go peripherals. No breadboard this time. |
|
|
||
| ### 2.6 Simulation and CI where possible | ||
|
|
||
| When graphics or timing interact with hosts, **simulation** plus **automated checks** can shrink debug time. The [Developer Blog](https://developer.espressif.com/blog/) has discussed simulation and AI-assisted debugging in other contexts (e.g. Wokwi-oriented workflows); the same mindset extends to Rust if you invest in reproducible builds and log-based assertions. |
There was a problem hiding this comment.
The Developer Blog has ...
You want to refer to any specific articles?
|
|
||
| Models behave a lot like tired humans under deadline: they **take shortcuts**, relax **rigid structure** when a quick test “works,” and then **leave that path in place** because nothing failed yet. A throwaway script lands in whatever folder is open; a reference PDF sits next to the binary because that was convenient; the “real” home for specs and sources in the repo map gets ignored as long as the immediate command succeeds. | ||
|
|
||
| That is **entropy**; not malice, just path of least resistance. The assistant does not naturally optimize for **global** organization; it optimizes for **local** accessibility and the last green check. Left alone, the tree drifts the same way a shared desk drifts unless someone names folders and enforces them. |
There was a problem hiding this comment.
| That is **entropy**; not malice, just path of least resistance. The assistant does not naturally optimize for **global** organization; it optimizes for **local** accessibility and the last green check. Left alone, the tree drifts the same way a shared desk drifts unless someone names folders and enforces them. | |
| That is **entropy**; not malice, just the path of least resistance. The assistant does not naturally optimize for **global** organization; it optimizes for **local** accessibility and the last green check. Left alone, the tree drifts the same way a shared desk drifts unless someone names folders and enforces them. |
| - IoT | ||
| - AI Pair Coding | ||
| showAuthor: false | ||
| featureAsset: "featured.webp" |
There was a problem hiding this comment.
No need to add featureAsset:. If you have an image, just make sure it has featured in its name and put it alongside index.md.
| - Rust | ||
| - IoT | ||
| - AI Pair Coding |
There was a problem hiding this comment.
I took the liberty to replace the tag AI Pair Coding with the more generic AI. To keep the total tag count under control, we recommend only adding new tags if at least 2-3 articles fit it.
| - Rust | |
| - IoT | |
| - AI Pair Coding | |
| - how-to | |
| - Rust | |
| - IoT | |
| - AI | |
| - LLM |
📝 Description
Publish date
Expected publish date:
2026-04-xx- April is just fine.Review process
@f-hollow,@FBEZ, and/or@pedrominatel)Checks
content/blog/YYYY/MM/my-new-article(articles only)My new_article)date: 20YY-MM-DDaliases:with a new URL slug is addedlastmode: 20YY-MM-DDstable, hard no forlatest)main🔗 Related
🧪 Testing (Hugo)