This page are a bunch of timestamped notes I’m taking while trying to learn compilers. Most of what I’m currently learning while embarking this magical journey is taken from “Crafting Interpreters - Bob Nystrom”. I’m by no mean trying to become a compiler god by the end of the week, I just consider myself more of a curious undergrad that likes to poke at seemingly obscure areas of engineering.
Wed 20 May 2020
An interesting thing that I have already learned is how much I don’t understand about what goes underneath the code I write. When StackOverflow wizards come out with all the performance craziness they do so because of a fundamental understanding of how languages internally work.
Sun 24 May 2020
I’ve just started the chapter on lexical analysis. It is called so because historically computers where so
memory constrained that reading sources files
(scanning) and performing lexical analysis
were two separate stages.
Wed 27 May 2020
The scanner/lexer divides lines of code into blobs called
lexemes. A type is associated to these.
Once such chunk is recognized a token is emitted.
he rules that determine how characters are grouped into lexemes for some language are called its lexical grammar.
In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language that can be expressed using a regular expression, in the strict sense of the latter notion used in theoretical computer science (as opposed to many regular expressions engines provided by modern programming languages, which are augmented with features that allow recognition of languages that cannot be expressed by a classic regular expression) ~ Wikipedia