Jump to ratings and reviews
Rate this book

Write Great Code, Volume 2, 2nd Edition: Thinking Low-Level, Writing High-Level

Rate this book
Explains how compilers translate high-level language source code (like code written in Python) into low-level machine code (code that the computer can understand) to help readers understand how to produce the best low-level, computer readable machine code. In the beginning, most software was written in assembly, the CPU's low-level language, in order to achieve acceptable performance on relatively slow hardware. Early programmers were sparing in their use of high-level language code, knowing that a high-level language compiler would generate crummy, low-level machine code for their software. Today, however, many programmers write in high-level languages like Python, C/C++/C#, Java, Swift. The result is often sloppy, inefficient code. But you don't need to give up the productivity and portability of high-level languages in order to produce more efficient software.In this second volume of the Write Great Code series, you'll     How to analyze the output of a compiler to verify that your code does, indeed, generate good machine code    The types of machine code statements that compilers typically generate for common control structures, so you can choose the best statements when writing HLL code    Just enough 80x86 and PowerPC assembly language to read compiler output    How compilers convert various constant and variable objects into machine data, and how to use these objects to write faster and shorter programsNEW TO THIS EDITION, COVERAGE     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 language systems like the Microsoft Common Language RuntimeWith an understanding of how compilers work, you'll be able to write source code that they can translate into elegant machine code. That understanding starts right here, with Write Great Code, Volume 2: Thinking Low-Level, Writing High-Level.

658 pages, Kindle Edition

First published March 14, 2006

28 people are currently reading
456 people want to read

About the author

Randall Hyde

18 books16 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
28 (35%)
4 stars
29 (36%)
3 stars
16 (20%)
2 stars
5 (6%)
1 star
1 (1%)
Displaying 1 - 6 of 6 reviews
Profile Image for Ben.
2,734 reviews227 followers
September 27, 2022
Get Low

I picked this book up, as it sounded really intriguing.

It was really superb, and I am so glad I read it.

Quite a scientific and impressive computer science book.

I look forward to reading the other 2 volumes in this series.

Very good.

4.8/5
Profile Image for Eugene ghaiklor Obrezkov.
119 reviews2 followers
April 18, 2025
Another book from the series “Write Great Code”, but this time focused on translating high level constructs into the low level machine code (assembly mnemonics, to be specific).

Previously, we were learning about the machine itself, how can we build one, how can we tell it what to do via its machine code instructions.

Now, we are focusing on how can we use more high level languages to program the machine and not thinking about the machine code it translates to. Well, we do in this book :)

What I liked specifically here is that this book is full of snippets both of high level language code and its low level implementation that were emitted via some compiler.

Like, literally. For instance, you are reading a chapter about if clauses and then you are seeing one in Swift language for example and then you are looking at the machine code that Swift compiler emitted for this if clause. In my opinion this is huge. So I liked it.

However, there is really a thin layer of “too much snippets” vs the explanations. So, that’s why I give 3/5. It is ok, it’s full of concepts and explanations of how compilers translate high level language into its low level implementation, but in my opinion there is too much of them. I was basically skipping at the end of the book lots of pages.

But anyway, recommend to those who are interested in how high level languages are being compiled into something that the machine can actually do.
Profile Image for Thomas Hansen.
32 reviews4 followers
March 29, 2023
Really interesting book!
I think I will revisit it and the others in this series after I have more assembler experience.

Had some aha moments with assembly code created from Swift and running on Apple Silicon.
Well worth the read I would say, and if you have access to some different cpu architectures, write and run some small assembly code on them and you will probably find even more useful parts
Profile Image for Jose.
253 reviews7 followers
August 19, 2012
Its ok, not the best book to read if you are a beginner. It's nice to learn a few things about what is going on "under the hood" but nothing in this book will make your code significantly better.
67 reviews1 follower
February 6, 2019
Great book, goes deep into the underlying "mechanics" and provides a greater understanding for the machinery on which code runs
Displaying 1 - 6 of 6 reviews

Can't find what you're looking for?

Get help and learn more about the design.