Company: RTU MIREA
Start of main content
Python Has a Ready-Made Frontend for Your Compiler
Normal people write compilers too, especially when it is about a small domain-specific language (DSL) compiler. What to do if operations overloading is no longer enough, and PLY-like tools look too heavy? Reuse the syntax of Python itself, then we will get lexical and syntactic analysis almost for free!
The talk will cover the fast creating of compilers with help of ast module, type annotations and match/case constructs. The talk is illustrated by a number of examples, from the simplest static analyzers in the spirit of a toy mypy to DSL-compilers of different complexity.
Company: Independent consultant