Live data from Hacker News

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

github.com

201–210 of 327 posts

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

#203
"... run programs ...." can be considered at a number of (abstract) levels, until the lowermost level is reached , which is machine language. ( Actually, the preceding statement is not correct , since there is often, [ but not all ways] CPU micro code , below Machine language. Machine language is assembly language translated into ones and zeros , that is loaded into the CPU. CPU microcode is a language used to control the internal CPU logic to execute the machine language.

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

#204

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…

Having read the first couple of pages, my only feedback is a strong suggestion to drop the cutesy language.

>The central processing unit (CPU) of a computer is in charge of all computation. It’s the big cheese. The shazam alakablam. It starts chugging as soon as you start your computer, executing instruction after instruction after instruction.

Given the context, that would read much better as:

>The central processing unit (CPU) of a computer is in charge of all computation. It starts chugging as soon as you start your computer, executing instruction after instruction after instruction.

I’m not super-technical, but I do get paid to write.

Your work here is great. Keep it up!

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

#205

Earlier quoted context omitted.

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 hav…

You're both right. What the GP is saying is that all the details of how modern processors work are out there in books and academic papers, and that the material covered in graduate-level computer architecture courses is very relevant and helpful, and they include all (or nearly all) the techniques used in industry. From the GP's perspective, it doesn't matter at all if the course taught branch predictors on a MIPS pr…

> They still go over the various techniques used, their consequences, etc., so the processor chosen as an example is unimportant.

They also include various techniques not used anymore, without mentioning that’s the case. I did a search for “branch predictor static forward not taken site:.edu” and found many documents which discuss that particular BTFN technique. In modern CPUs the predictor works before fetch or decode.

> university courses don't cover that

Here’s a link to one: https://course.ece.cmu.edu/~ece740/f15/lib/exe/fetch.php?med... According to the first slide, the document was written in fall 2015. It has dedicated slides discussing particular implementations of branch predictors in Pentium Pro, Alpha 21264, Pentium M, and Pentium 4.

The processors being covered were released between 1995 and 2003. At the time that course was written, people were already programming Skylake and Excavator, and Zen 1 was just around the corner.

I’m not saying the professor failed to deliver. Quite the opposite, information about old CPUs is better than pure theory without any practically useful stuff. Still, I’m pretty sure they would be happy to included slides about contemporary CPUs, if only that information was public.

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

#207

OP, don't excuse your work by prefixing it with your age. Your write-up is better than most people will ever do. Nice work!

This post would have zero traction on here if they did otherwise. The tubes are full of excellent resources that die on new. They decided to market with the age bit and clearly it worked.

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

#208

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…

Hi Lexi, this is Patrick. I remember you from the replit community when I was working there a couple years ago. This is amazing work. So cool to see you continuing to chase your passion. Wherever it takes you, I’ll be rooting for you. Happy coding :)

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

#209

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…

Is there an equivalent article for "what happens when you load a website?"? If it's written anything like this one, it'd be super helpful and I'd love to read it!

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

#210

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 like that you pointed out the "research posture" in your first image. A tip from somebody who is not 17: it's good to have many different research postures. Staying in one of them for too long will give you trouble later on. Took me way too long to figure this out.

I saw how straight the stick figure's back was and laughed out loud to myself.
Post reply on HN