Building an Interpreter in Rust: A Journey Through Lexical Analysis, Parsing, and Evaluation
dev.to·6d·
Discuss: DEV
🔧Functional Programming
Preview
Report Post

Introduction

I previously read Writing An Interpreter In Go and implemented the interpreter in Rust for learning purposes. I’ll put what I learned in this article.

The Output

The completed interpreter can be found here. Since it’s Rust source code mimicking Go, I named the repository imitation_interpreter.

GitHub Repository

Since it’s for learning purposes, there are some minor issues like lack of newline support, but it can perform minimum viable programming including variable assignment, if statements, and function usage.

For the runtime environment, if you have cargo*2 installed you can run it locally. If you don’t but want to try it, you can run the …

Similar Posts

Loading similar posts...