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.
Today's programmers are tasked with writing optimal computer code to produce high performance systems, whether for machine learning, data science, or artificial intelligence. This second edition of the highly-regarded Thinking Low-Level, Writing High-Level (Volume 2 in the best-selling Write Great Code series) teaches readers how to produce better machine code by directing the actions of their chosen compiler.
This second edition has been updated to cover 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.
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.
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
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.