0:00 / 0:00
impl Rust: Avro IDL tool in Rust via LLM
Jon Gjengset
111K subscribers • 38 videos on Hallway
- Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
- Presented by Jon Gjengset
- Linked in the descriptionjonhoo/avdl
- May be out of date. The tools, versions or practices it shows have likely moved on.
Advanced. Deep dive for people who know the field.
22K views8 months ago2 recommendations
Programming languagesTools and practiceRustAI for coding
Jon Gjengset live-codes a Rust implementation of an Apache Avro IDL parser and compiler using LLM assistance.
Some of you may be familiar with Avro, the Apache take on Google's Protocol Buffers. Where Protobuf has just one file format, `.proto`, Avro has *three*. Two of these are JSON-based. The first, .avsc files, are used for "schemas", which are like Protobuf message types. The second, .avpr files, are for "protocols", which are like gRPC service declarations. The third file format, .avdl, uses an Interface Description Language, or IDL ( avro.apache.org/docs/1.12.0/idl-language/ ), which is intended for humans (as opposed to machines) to read and write and looks more like a .proto file. Avro comes with a tool that converts those IDLs into JSONs. That tool is written in Java and maintained by the Avro folks, but also seems to have stagnated somewhat. In particular, it produces *really* unhelpful errors, to the point where I've heard of people spending an hour chasing down a misplaced comma. My sense is that this is probably not *too* hard to fix in the Java version, but after digging a little I discovered that the parser behind this tool uses the ANTLR parser generator ( antlr.org/ ). ANTLR supports code generation to many languages, *including Rust*! And you know what that means: let's try to port it to Rust using something like miette ( docs.rs/miette/ ) for errors, and see how good we can make it! Since we a) have access to the existing Java code and b) there's an infinite supply of tests (the same IDL passed to the Java tool should produce the same JSON), this is also a perfect candidate for powercoding (LLM + review the code), so we decided to see if we could get a complete substitute up and running in just four hours 😅 The resulting repository can be found at github.com/jonhoo/avdl Live version with chat: youtube.com/live/NqV_KhDsMIs Introduction What is Apache Avro? Setup and trying out the Java tool ANTLR parser generation Planning the implementation with Claude Code Reviewing AI-generated Rust code Making the LLM iterate Setting up for a multi-agent workflow Seeding a decent CLAUDE.md Parallel issue identification and fixing Making worktrees work Brainrot, FOMO, and LLM use Designing a self-correcting agent loop Wrap-up & next stepsWhy it's here
2 people recommend thisWhat people say. Recommended for insights on using AI tools with Rust's strict compiler and toolchain.
u/Professional_Top8485in r/rust • Recommends
On “Convincing my employer of Rust for a rewrite”
You might get some ideas from the video.
link to this video
Rust is much better with ai tools because compiler is strict and catches worst kind of bugs. Toolchain is good too.