Mini-rust in Rust 001: Lexing an int
October 31, 2024 [Programming, Programming Languages, Rust, Tech, Videos] #mini-rustIntroducing 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