Live data from Hacker News

“Code” 2nd Edition

charlespetzold.com

121–130 of 176 posts

Re: “Code” 2nd Edition

#121

Earlier quoted context omitted.

If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code : https://www.nand2tetris.org/ . Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?

Quoted from the 2021 edition:

"Project 4 is written in the computer’s assembly language, and projects 9 and 12 (a simple computer game and a basic operating system) are written in Jack—the Java-like high-level language for which we build a compiler in chapters 10 and 11."

Re: “Code” 2nd Edition

#122

Earlier quoted context omitted.

If you're actually looking for something that does build to a virtual computer, Nand2Tetris (second edition of the book The Elements of Computing Systems that goes with it is now out) is a great companion to Code : https://www.nand2tetris.org/ . Code is more high level, Nand2Tetris and Elements is project based but covers some similar territory.

I was actually asking about The Elements of Computing Systems in my comment, not Code. What language does it use to build a virtual computer?

The hardware exercises expect you to use a simple HDL, you write an assembler in your language of choice (I used Ruby, but others have used Python or JavaScript), and you write programs for the computer you "built" in earlier chapters using Jack (a language with Java-like syntax).

Re: “Code” 2nd Edition

#123
I’m currently using the first edition to teach my young brother about computers.

We would read the book create a “clean room” implementation of a computer with Minecraft redstone.

It’s great fun! He was overjoyed when we got our first 1-bit memory cell.

Re: “Code” 2nd Edition

#124

Earlier quoted context omitted.

very easily substitute using FETs. Essentially the same as relays and BJTs but much easier to control logic FETs than BJTs.

But that would introduce more complexity (polarity, biasing, etc) that would distract from the initial purpose. With a relay they should only learn how connecting a battery to pins 1 and 2 closes the contacts on 3 and 4. Using relays with more throws they can also learn the basics of logic gates, flip flops, etc. I believe that relays still have a place for educational purposes.

Yup! Agree 100%

Re: “Code” 2nd Edition

#125
post #105
post #68

Earlier quoted context omitted.

I often wonder: for someone with no understanding of how computers work; no idea about electricity and transistors, no idea about CPUs executing instructions, no idea about software and abstraction: what do they think about when they click a ‘play’ button in a music player, and the interface updates and music starts? Do they think about what is happening ‘inside’ the box? I think I do. I suspect I have a completely d…

What's your mental model of a dog?.. What's happening inside when he barks or wags his tail? Why does he like carrots more than cheese? How does his memory work?.. The way you think of dogs is probably not very different from the way many people think of computers.

It's different for me because I know that computers are knowable because they were built by people, and lots of people (including me) know how they work. I believe dogs are knowable too because I believe in science, but nobody really knows (yet) how dogs work at anything close to the same level of detail.

Lets take something I know nothing about: Industrial chemistry. That still seems less mysterious to me than dogs, because I know that I could find books about industrial chemistry at whatever level of detail I wanted. But dogs--not so much, beyond a rather superficial level.

Re: “Code” 2nd Edition

#127

Earlier quoted context omitted.

The content is something we learn in universities, even deeper. I think it's good for self taught programmers

I can't tell whether I had an unusually good CS education, or if I'm missing something, but everything I see discussed in this thread as crucial insights taken from this book are things I recall being covered at least once in university, yeah. Perhaps it's just especially effective in its organization and ordering of fundamentals. Still, the praise it's getting makes me want to pick up a copy just to see if it can fi…

> Perhaps it's just especially effective in its organization and ordering of fundamentals.

This is it. It’s not going to tell you some deep technical details about how modern processors work, but it’s an extremely well-written introduction to low-level computer concepts that any moderately intelligent person can follow with no prior specialist knowledge, which is rare among nonfiction books. But still, it’s a popular science book, not a thorough technical treatise.

Also, probably a lot of people read it before university. I read it at age 16 or so and learned basically my entire framework for understanding what a computer is and does. I doubt someone with a rigorous computer engineering degree under their belt would learn anything specific, but it’s still a fantastic piece of writing and you might enjoy seeing a good explanation from first principles of how everything fits together.

Re: “Code” 2nd Edition

#129

Code is my favorite technical book of all time [1]. Charles does an amazing job of building a computer up from basic principles "two young boys who want to communicate after their parents tell them to go to bed at night" all the way to modern (for 1999) computers. He layers abstraction on top of abstraction all the way to a working computer. My only (slight) disappointment in the book is that he tries to cover operat…

When the book “builds” a computer, I’m assuming that’s a virtual computer? If so, what language does it use?

[deleted]

Re: “Code” 2nd Edition

#130

Code is my favorite technical book of all time [1]. Charles does an amazing job of building a computer up from basic principles "two young boys who want to communicate after their parents tell them to go to bed at night" all the way to modern (for 1999) computers. He layers abstraction on top of abstraction all the way to a working computer. My only (slight) disappointment in the book is that he tries to cover operat…

When the book “builds” a computer, I’m assuming that’s a virtual computer? If so, what language does it use?

It’s more a book that actually shows you how a computer really works, from first principles.

It’s not a book about implementing a particular computer - it’s more about giving you the rough thought process about how it actually works at the level of electricity and wires, and how this gets built up into something that actually calculates stuff.

It’s the first book that took me from “computers are mystical magic” to “computers are understandable magic”.

Post reply on HN