Live data from Hacker News

I'm 17 and wrote this guide on how CPUs run programs

github.com

141–150 of 327 posts

Re: I'm 17 and wrote this guide on how CPUs run programs

#141

The only thing is I hate titles like this—the title is bragging a bit too much. Maybe a title more like: “How I’m helping my high school peers learn about CPUs”. That way it implies you’re young, smart, and care about others—all of which I imagine are true :)

It's not clear whether you're referring to the HN post title or the article title itself ("Putting the You in CPU"). In either case I think your proposed edit makes it much worse.

The HN post title is accurate and describes what they did. It makes a choice to center the writer rather than the guide, which has certain consequences about how readers will approach it, but is perfectly appropriate. Of course, your proposed edit makes the same choice, and is arguably more of a brag than the original.

The article title is cute, which is not what you would want for a dry technical manual but appropriate in this case, where the style is supposed to be fun and entertaining as well as informative.

Re: I'm 17 and wrote this guide on how CPUs run programs

#142
post #121

Hi! I'm Lexi, I wrote this article/mini-book. There's a classic question of "what happens when you load a website?", but I've always been more interested in "what happens when you run a program?". About 3 months ago, I was really annoyed at myself for not knowing how to answer that question so I decided to teach myself. I taught myself everything else I know in programming, so this should be easy, right? NOPE! Appare…

I can't resist pointing out that LWN ( https://lwn.net/ ) has been dedicated, for many years, to the production of operating-system information that is not terrible. Have a look, and perhaps consider joining us :)

LWN is one of my favorite websites. I learned more from LWN articles (probably mostly yours lol) than most other resources on the internet when researching for my article. I actually quoted you from 19 years ago! https://cpu.land/epilogue#bonus-tidbits

Re: I'm 17 and wrote this guide on how CPUs run programs

#143
post #29

Earlier quoted context omitted.

It's a bit dated but perhaps you should check out Structured Computer Organization by Andrew Tanenbaum.

Oh, thank you for the suggestion! I of course know of Tanenbaum by reputation but I've never read the book.

I've read a couple of Tanenbaum's text books, and they are fantastic! My biggest regret is not playing along with the minix examples, but I didn't have a computer while I was reading the book.

Re: I'm 17 and wrote this guide on how CPUs run programs

#144
post #7

Earlier quoted context omitted.

These days 17 year olds can get away with "programming" by gluing things they don't understand... I've been doing that for 26 years. ...but I think they'll eventually hit a ceiling. I wonder if it'll happen soon.

I'm not sure it's always obvious to ourselves when we have. We humans are amazing at denial and telling ourselves whatever story we want to believe in. I'm not picking on you. If there's one thing I'm terrified of, it's blind spots.

Agreed. I can almost guarantee you that if you've written code that has any sort of performance needs at all (which describes most code) you've written something badly or suboptimally that you could have easily avoided or improved if you'd had a deeper understanding of the compiler or CPU. Every single one of us have.

Re: I'm 17 and wrote this guide on how CPUs run programs

#145
post #23

Congrats on completing this guide. > There aren't many comprehensive systems resources if you aren't going to college, so I had to sift through tons of different sources of varying quality and sometimes conflicting information. The absolutely best resource you will find is Charles Petzold's Code: The Hidden Language of Computer Hardware and Software . The 2nd edition was just released. https://codehiddenlanguage.com/

I think The Elements of Computing Systems by Noam Nisan and Shimon Schocken and the associated nand2tetris project is just as good if not better and is much more hands-on.

https://mitpress.mit.edu/9780262539807/the-elements-of-compu...

https://www.nand2tetris.org/

Re: I'm 17 and wrote this guide on how CPUs run programs

#146
post #129

Earlier quoted context omitted.

I share the OP’s opinion that a lot of available information is incorrect. It seems the industry is moving faster than the academics who write books and university courses can update these sources. Big endian CPUs, CPU architectures other than AMD64 and ARM, x87 FPU, are examples of the topics which are no longer relevant. However, these topics are well covered because they were still relevant couple decades ago when…

> However, the details of modern branch predictors are proprietary, so we don’t have authoritative sources on them. I focused on Computer Architecture for a masters degree and now I work on a CPU design team. While I cannot say what we use due to NDA, I will say that it is not proprietary. Very nearly everything, including the branch predictors, in modern CPUs can be found in academic research. Many of these secrets…

I’m not related to academia. I don’t design CPUs. I don’t write operating systems and I don’t care about these side channel attacks. I simply write user-mode software, and I want my code to be fast.

The academic research used or written by CPU designers being public doesn’t help me, because I only care about the implementation details of modern CPUs like Intel Skylake and newer, AMD Zen 2 and newer. These details have non-trivial performance consequences for branchy code, but they vary a lot between different processors. For example, AMD even mentions neural networks in the press release: https://www.amd.com/en/technologies/sense-mi

Re: I'm 17 and wrote this guide on how CPUs run programs

#147

Very nicely written, and congrats on doing such a deep dive on this kind of topic. These days 17 year olds can get away with "programming" by gluing things they don't understand, but I think they'll eventually hit a ceiling. So what you're doing is super valuable, not for yourself, but for everyone else who will learn from your materials. Well done :) EDIT: now go write an emulator if you haven't already, it's a ton…

Hard disagree, unless you pursue a super niche position doing a specific technical task you are going to have to become really really good at reading docs and learning how to cobble stuff together out of cloud services and JS libraries.

Far more likely someone with an academic approach to programming would be completely overwhelmed when a task requires them to get a base understanding of a bunch of different technologies before moving on.

If you work at a huge company and have a bunch of project managers and designers narrowing specifications down so you can focus entirely on execution sure, but that is rarely the case for most people.

Re: I'm 17 and wrote this guide on how CPUs run programs

#148
post #23

Congrats on completing this guide. > There aren't many comprehensive systems resources if you aren't going to college, so I had to sift through tons of different sources of varying quality and sometimes conflicting information. The absolutely best resource you will find is Charles Petzold's Code: The Hidden Language of Computer Hardware and Software . The 2nd edition was just released. https://codehiddenlanguage.com/

Thank you! Looks hardware-y and very interesting, I may well read through it at some point.

I'm going to +1 this book but I also think this book would electrify you, as it did me:

https://en.wikipedia.org/wiki/The_Information:_A_History,_a_...

Re: I'm 17 and wrote this guide on how CPUs run programs

#150
I love this! Maybe dive a little deeper? Like, what happens from power on to login prompt. Like, power good > get instruction from predetermined address > execute (BIOS code) > init hardware > change to protected mode > load OS, etc.

Different cpus are different, of course, but they all go through a similar start up sequence. Again, nicely done.

Post reply on HN