u/Snapstromegonin r/rust • Recommends
On “Does anyone know of a good book/blog post/video about making a lox interpreter?”
link to this video
111K subscribers • 38 videos on Hallway
Advanced. Deep dive for people who know the field.
103K views2 years ago2 recommendations
Programming languagesSystems programmingRustCompilers and interpreters
Jon Gjengset live-codes a parser and interpreter for the Lox language in Rust using CodeCrafters.
For some time I've been looking for an opportunity to do a stream on writing a parser + interpreter for... something. Anything really. I've wanted to implement a parser following matklad's excellent article on Pratt parsing ( matklad.github.io/2020/04/13/simple-but-powerful-pratt-parsi… ), though honestly anything in the area of parsing would do. Well, CodeCrafters have recently released a new challenge in beta that follows Robert Nystrom's Crafting Interpreters book ( craftinginterpreters.com/ ), so I jumped at the opportunity. Join me in working through the challenges, or try it yourself first and compare notes after the fact! You can access the challenge over at app.codecrafters.io/join/interpreter?via=jonhoo , which also gives you 7 days free access, or in free source form (without the nice infrastructure) at github.com/codecrafters-io/build-your-own-interpreter . You can find my solution code over at github.com/jonhoo/lox You can join my Discord at discord.jonhoo.eu/ Introduction What is compilation? The Lox language Lexing single-character tokens Lexing multi-character tokens Lexing numbers Lexer errors Lexing comments Lexing strings Printing numbers Outlining the (Pratt) parser Parsing expressions Parsing special statements Extract out statement parser Finish up expression parser Printing token trees Trying out the parser Aligning with expected output Tests falling like dominoes Outro Live version with chat: youtube.com/live/FdZmJ0DAmn4What people say. Recommended as an excellent, in-depth walkthrough of building an interpreter and parser from scratch.
u/Snapstromegonin r/rust • Recommends
On “Does anyone know of a good book/blog post/video about making a lox interpreter?”
u/volitional_decisionsin r/rust • Recommends
On “Any resource for learning to make compiler for any language”