
Write Great Code
Understanding the Machine
by Randall Hyde · first published 2004
25mentions
16recommended by
19HN commenters
2009–2026first – last mentioned
84% recommend16% neutral
Why HN recommends it
Introduction to how machines work: computer architecture, machine-level representation such as floating point, and how high-level code maps to low-level operations. Suits programmers who never learned the hardware.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…use C (or machine language) for everything, but having an idea how the whole stack fits together will show which operations are inherently more expensive, error prone, etc. Two books I'd recommend: _Write Great Code vol. 1: Understanding the Machine_ by Randall Hyde, and _The Elements of Computing Systems_ by Nisan & Schocken (http://www.idc.ac.il/tecs/). WGC1 is about things typically learned about the machine while…
on “0.30000000000000004” ↗…is also good, as is Code by Charles Petzold. http://www.amazon.com/Code-Language-Computer-Hardware-Softwa... AFTER EDIT: While I thought about the first three books I mentioned, I thought of another, Write Great Code, Volume 1: Understanding the Machine by Randall Hyde. http://www.amazon.com/Write-Great-Code-Understanding-ebook/d...
on “Ask HN: Are there good books about computers that aren't textbooks?” ↗…to fully understand why your HLL programs behave the way they do. That's the charitable interpretation. I'm actually writing this comment on a laptop sitting on a book that did that for me. It's called Write Great Code by Randall Hyde. Guy who made Art of Assembly Programming and HLA. It was enlightening.
on “Let's Build a Simple Interpreter, Part 1 (2015)” ↗…language-agnostic. Others have mentioned it already. Can't recommend enough if you're iffy on the internals of computers and programming. https://www.amazon.com/Code-Language-Computer-Hardware-Softw... Write Great Code (Volumes I and II). Randall Hyde's books are fantastic explications of the underlying computer operations. Examples are in assembly or pseudo-code but easy to understand. https://www.amazon.com/Write-Great-Code-Understanding-Machin...
on “Ask HN: What language-agnostic programming books should I read?” ↗…Why your program behaves the way it does * Why your performance profile looks the way it does * Gives you the skills you need to debug inevitable problems in your high level tools. I highly recommend Write Great Code: Understanding the Machine: http://www.amazon.com/Write-Great-Code-Understanding-Machine...
on “Should programmers learn machine code?” ↗…considered the bible of the BSD networking APIs, and if you're interested in writing network software at any scale, in any language, you should start with this book -- everything else builds from here. 2. Write Great Code: Volume 1: Understanding the Machine (Randall Hyde) - At the end of the day you're writing code that will execute on a machine. Understanding how the machine works will help you understand your code.…
on “* is Unix” ↗…you lots of Algebra; then go learn you some functional programming (in particular LISP, HTDP: How To Design Programs and SICP are great for this). Then I would pick up Randall Hyde's books on "How to Write Great Code" series - he starts out with machine fundamentals (stuff you would typically learn in an Assembly or computer engineering course minus the Assembly). Then I would learn some type of Assembly (again I…
on “Ask HN: Computer science for the self taught programmer” ↗I agree with kazinator: the title doesn't reflect the work. I bet I got something that does: Write Great Code [1]. Hyde helps a programmer understand how the compiler converts most imperative language features to assembler if it's doing it in a direct, lightly optimized way. It often gives C code next to assembler…
on “Understanding C by learning assembly” ↗…constructs. So, learning to code professional C++ will not help you understand machines more. You'd have to learn C, basic OS/CPU structures, and which compilers produce for certain C statements. Maybe read Write Great Code by Hyde or some online articles. Learn C++ to understand machines? Not happening unless you microprogram a CPU for it on a FPGA.
on “Why I love Rust” ↗…against learning the lower level, but just to focus on a relevant low level. There are different approaches, but a good starting point to understand modern computers from the bottom up is the series "Write great code" by R.Hyde, volumes 1 and 2. If one wants to program on 6502 for the sake of programming on 6502, there are plenty of books on archive.org to learn from. It's not easy to find good ones, and they're…
on “Porting Doom to the 3D0 Console” ↗Some thoughts: 1. https://www.amazon.com/Write-Great-Code-2nd-Understanding/dp... 2. https://www.amazon.com/Write-Great-Code-Low-Level-High-Level... 3. https://www.amazon.com/Computer-Organization-Design-RISC-V-A... 4. https://www.amazon.com/Computer-Architecture-Quantitative-Ap...…
on “Ask HN: After Charles Petzold's Code and Nand2Tetris, What Next?” ↗…signals and protocols behind everything. It's not necessary as a book, but can help understand the datasheets and standards - But you want to start with something like Computer Architecture by C. Fox or Write Great Code - Volume 1 - Understanding the Machine, 2nd Edition by R. Hyde. There are better textbooks out there, but those are nice introductions to the binary world. The gist is that you don't have a lot of memory…
on “Practical Guide to Bare Metal C++” ↗…Both are simple, compact languages with strong philosophy and history. I think that most of the languages we have today compromise between C style and Lisp style. One of my favourite books is called, "Write Great Code: Volume 1: Understanding the Machine". This book gave me a real intuition for why the computer behaves the way it does given a piece of code. If like that kind of stuff, you might also take compiler…
…the starting (Java or Python) and then branching out after completely comfortable in one? Should I learn them in a specific order? I just picked up Code Complete at the lib today but will start with "Write Great Code" as you suggested. Thanks!
…languages and their compilers... doesn't exactly help on this. I've been out of it a while, evangelizing & informing mainly these days. Yet, your post brings back memories. My strategy, leveraging the Write Great Code book, was to map language constructs onto assembler via macro-assembler or languages such as LISP with good metaprogramming. Then, I hand compiled the code in other's projects with my macro's. So, we…
on “Rwasa – A high-performance web server in x86_64 assembly” ↗