Compiling to Machine Code
Although few people build compilers for full programming languages, you might find yourself in a position where you need maximum run-time performance. For example, you might have a scripting or small programming language that executes on a small device like a phone. Because of battery life issues, phone processors run slowly compared to desktops. It might make sense to translate your language all the way down to the machine code to wrench the most speed from the slow CPU.
In C Compiler, we looked at the typical compiler application pipeline. There are many stages and a whole lot of tricky stuff going on. In a nutshell, we need patterns and techniques from Chapter 2, Basic Parsing Patterns, Chapter 4, Building Intermediate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access