Python profilers
CPython’s thread state has a profiler callback hook c_profilefunc. If this callback is set, then it will be called when a function enters and exits. See relevant code here. Node this callback is on...
CPython’s thread state has a profiler callback hook c_profilefunc. If this callback is set, then it will be called when a function enters and exits. See relevant code here. Node this callback is on...
Network tools Tcpdump Tcpdump, as said on its front page, has two products: tcpdump: command line tool libpcap: C library for network traffic capture. libpcap The document is very short....
Each Instruction Set Architecture (ISA) has its own assembly language. So there isn’t an universal assembly. For example, given a piece of C code, Gnu as is capable of assembling it to the target I...
Recently, CPython announced the introduction of JIT in 3.13. See post. I have been long wanted to learn something about JIT, and this may be a good opportunity. The HN post actually provided quite ...
Recently, I spent some time learning compiler techniques. First, I read the first few chapters of dragon book. Then I turned to blogs teaching me how to build a compiler in short time. After a sho...
Lexer Maximal Munch principle This principle is also called the longest token matching rule. Basically, when there is ambiguity, the lexer always chooses the longest possible valid tokens. Most p...
Research areas Live-variable analysis Dead-code analysis Nullness analysis Typestate analysis
SmallVector SmallVector has a smart design. I was amazed the first time reading the implementation. It utilizes the memory layout of derived classes to achieve the separation of logic and data. Sm...
Parsing Most vexing parse Clang driver See https://clang.llvm.org/docs/DriverInternals.html Useful arguments: -### -ccc-print-phases -ccc-print-bindings Terminology PCH: precom...
First, Clang is both the frontend of C like language, and it is also a compiler driver. As a frontend, Clang has a handwritten recursive decent parser, and it is quite complicated. Quote from Walte...