About this book

How to Become a Compiler

Free sample

Chapter 1: The Metaprogrammer's Oath...–- You are about to do something strange. Most people learn to write code. You are about to learn to write code that writes code. That makes you not a programmer, but a metaprogrammer — and the first thing every metaprogrammer must understand is this: a compiler is not magic. It is not a black box.

It is not a mysterious artifact handed down from the gods of computing. A compiler is simply a program. A program that you, after reading this book, will be able to build from scratch.–- This is the Metaprogrammer's Oath: "I will no longer treat the compiler as a tool. I will understand it, bend it, and if necessary, replace it." By the final chapter of this book, you will have built your own working compiler for a real programming language. You will have written the lexer that reads source code.

You will have written the parser that understands structure. You will have written the optimizer that makes code fast. And you will have written the code generator that produces actual machine instructions — instructions that your CPU will execute. When you finish, you will look at every programming language differently. You will look at your own code differently.

You will see the hidden machinery beneath every keystroke.–- But first, you need to understand why compilers exist at all. And to understand that, you need to go back to a time when computers were women — not machines.The Computer Before Computers–- The word "computer" originally meant a person who computes. In the early 20th century, before electronic computers existed, laboratories and engineering firms employed rooms full of people — often women with degrees in mathematics — whose job was to sit at desks and perform calculations by hand. They would receive engineering problems, break them down into arithmetic operations, fill pages with numbers, and return results days or weeks later. These human computers were accurate, but they were slow.

Each new problem required starting from scratch.–- When electronic computers like the ENIAC emerged in the 1940s, they promised something revolutionary: speed. The…

This is the end of the free sample. Get the eBook to keep going. Buy now

Read a sample →

Contents

  1. Chapter 1
  2. Chapter 2
  3. Chapter 3
  4. Chapter 4
  5. Chapter 5
  6. Chapter 6
  7. Chapter 7
  8. Chapter 8
  9. Chapter 9
  10. Chapter 10
  11. Chapter 11
  12. Chapter 12

Details

Author
Cooke Argelia
Publisher
SamEnrico
Language
English
ISBN
9781505804225
Genre
Non-Fiction, Informative, Educational
Released
2026-05-09
Pages (approx.)
154
Available as
eBook, Paperback, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Cooke Argelia

See all

You may also like

See all