Thinking Low-Level, Writing High-Level, the second volume in the landmark Write Great Code series by Randall Hyde, covers high-level programming languages (such as Swift and Java) as well as code generation on 64-bit CPUsARM, the Java Virtual Machine, and the Microsoft Common Runtime.
Today's programming languages offer productivity and portability, but also make it easy to write sloppy code that isn't optimized for a compiler. Thinking Low-Level, Writing High-Level will teach you to craft source code that results in good machine code once it's run through a compiler.
You'll learn:
• How to analyze the output of a compiler to verify that your code generates good machine code
• The types of machine code statements that compilers generate for common control structures, so you can choose the best statements when writing HLL code
• Enough assembly language to read compiler output
• How compilers convert various constant and variable objects into machine data
With an understanding of how compilers work, you'll be able to write source code that they can translate into elegant machine code.
NEW TO THIS EDITION, COVERAGE OF:
• Programming languages like Swift and Java
• Code generation on modern 64-bit CPUs
• ARM processors on mobile phones and tablets
• Stack-based architectures like the Java Virtual Machine
• Modern langua
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A practical bridge between high-level source code and the machine code compilers actually emit, teaching you to write HLL that compilers can translate into efficient, elegant assembly. Best for working developers in C, C++, Swift, Java, or similar who want performance insight without becoming full-time assembly programmers.
【Book Arc】
- **Opening (~0%–10%)**: Frames the core premise—compilers are only as good as the source you feed them—and argues why a little assembly knowledge pays off even for HLL developers.
- **Early (~10%–33%)**: Builds the minimum assembly foundation (80x86 registers, addressing modes, constants, data declarations) so you can read compiler output rather than write assembly from scratch.
- **Middle (~33%–57%)**: Explains how compilers work internally—translation phases, optimization, object/executable file formats, linkers—and how constants and variables are laid out in memory.
- **Late (~57%–85%)**: Moves into code generation for real constructs: control structures, expressions, arrays, strings, and functions/procedures, showing what machine code each HLL choice produces.
- **Ending (~85%–100%)**: Closes with an engineering-software afterword and glossary, tying low-level reasoning back to everyday design decisions.
【Key Takeaways】
- **Compilers are only as good as your source** (Opening): Sloppy HLL constructs force weak machine code; understanding the translation pipeline lets you write code compilers optimize well.
- **Enough assembly to read, not to write** (Early): Registers, addressing modes, and data declarations are taught as a reading skill for inspecting compiler output.
- **Know your toolchain** (Middle): Compiler phases, optimization passes, object file formats (COFF), and linker behavior all shape the final binary.
- **Constants and variables have machine-level costs** (Middle): How integers, floats, characters, booleans, and their storage classes (static, automatic, dynamic) map to memory affects performance.
- **Control structures generate predictable patterns** (Late): Knowing the assembly idioms for conditionals and loops helps you pick the HLL construct that compiles cleanest.
- **Functions and procedures carry overhead** (Late): Calling conventions, parameter passing, and stack frames explain why some abstractions are cheaper than others.
- **Language-neutral mindset** (Throughout): The reasoning applies across Swift, Java, C/C++, and stack-based targets like the JVM and Microsoft runtime, not just one language.
【Reading Tips】
- Deep-read the early assembly chapters even if you never plan to write assembly—they are the vocabulary for everything later.
- Skim the object-file-format and linker details on a first pass; return when you actually need to debug binary size or alignment.
- Keep a compiler open alongside the book: generate assembly output (`-S`, `/FA`, `objdump`) and compare it to the patterns described.
- Treat the constants/variables chapters as a reference; revisit them when tuning memory layout or data structure choices.
- Don't expect language-specific recipes—extract the general principle and apply it to your own stack.
【Coverage Limits】
This guide is synthesized from front matter, table of contents, and early/middle excerpts; the excerpts do not cover the detailed content of the later code-generation chapters or the afterword, so specifics there are inferred from chapter titles only.
Page 3
that you master what is in these pages. Then read it again.” —DevCity “Write Great Code, Volume 2, exceeds its goal of helping developers pay more attention...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Loading comments...
Reply to Comment
Edit Comment