Mini-rust in Rust 001: Lexing an int
October 31, 2024 [Programming, Programming Languages, Rust, Tech, Videos] #mini-rustMini-rust in Rust 001: Lexing an int
Mini-rust in Rust 002: Errors while lexing
Mini-rust in Rust 003: Much prettier errors
Mini-rust in Rust 004: Refactoring our lexer
Mini-rust in Rust 005: Making our lexer an iterator
Mini-rust in Rust 006: Parsing an operation
Mini-rust in Rust 007: Evaluating an operation
Mini-rust in Rust 008: Refactoring our parser
Introducing my new series: writing a little Rust-like language in Rust. It will be an interpreted language, and (for now at least) it will try to work as much like real Rust as possible. Maybe one day it will be a useful language, but for now it's purely for fun. (You can imagine it being a nice scripting language, or an embedded language inside Rust projects, but for that it might need to deviate from Rust - maybe avoiding ownership and references and using a Python-like runtime model.)
In this video we write enough code to understand that an integer is made up of several digits next to each other, and we wrap that up in a "token". This is the start of a Lexer.
You can find the source code at codeberg.org/andybalaam/milk and more of my stuff at artificialworlds.net