4 ms·
This is a great exercise for anyone who wants to start exploring how a particular compiler works. I went through something similar in 2005, when during an inte
by thamer 5y ago
This is a great exercise for anyone who wants to start exploring how a particular compiler works.
I went through something similar in 2005, when during an internship I was working on a program reading and displaying generated Python code in which the code comments provided important metadata about the statements on the same line. I hacked the compiler to make the AST generate a new token for comments (they're otherwise dropped), and this was an incredibly useful experience that gave me knowledge about CPython that I still rely on to this day – 16 years later.