AIScript - how to write an interpreter language in Rust
Shuang Zhu
English Session #rustI’ll share my journey building AIScript, a new interpreter language specifically designed for AI application development. This talk will dive deep into language implementation techniques using Rust, covering:
- Language Implementation Architecture
- Building a robust lexer with comprehensive error reporting
- Implementing a recursive descent parser
- Creating an efficient bytecode compiler and virtual machine
- Designing a module system that supports both native and script modules
- Novel Language Features
- AI-native primitives: Built-in support for prompts, agents (inspired by OpenAI Swarm), and AI function
- Unique error handling syntax inspired by Rust/Zig/Golang
- Builtin data validation similar to Python’s Pydantic
- Encapsulates Rust’s best practice of web development (axum, sqlx, etc) into the language syntax
- Real-world Challenges
- Garbage collector using gc-arena
- Performance optimizations in the VM
- Type checking and validation implementation
Speakers:
I’m Shuang Zhu, creator of AIScript, Rust Search Extension, Query.rs and Rust Magazine. Github: https://github.com/folyd
Previously, I worked as a Senior Rust Engineer at Bytedance and co-founded Wanderboat.ai. I’m currently a funder of a stealth startup.