Название: From Source Code To Machine Code: Build Your Own Compiler From Scratch
Автор: James Smith
Издательство: Leanpub
Год: 2023-05-18
Страниц: 102
Язык: английский
Формат: pdf (true), epub, mobi + Extras
Размер: 10.2 MB
Ever wondered how computers turn source code into working software? You can learn the art by building your own mini-compiler. A succinct book walks through a minimal yet complete compiler implementation. Compiles a static-typed language into x64 ELF executables. Like my other books, this book follows a step-by-step approach. You start with simple things, like a calculator, then a simple interpreter. Then you tackle the compiler bit-by-bit, compiling to bytecode, learning assembly, and finally generating native executables. The final product is a small, statically typed language that resembles a subset of C, which compiles into x64 Linux ELF executables. And it has a machine-agnostic IR, so it’s not hard to target other platforms such as ARM, which is a challenge you can take up later. The project is written from scratch in pure Python without any dependencies, although everything is language agnostic.