[HN Gopher] I'm 17 and wrote this guide on how CPUs run programs
___________________________________________________________________
I'm 17 and wrote this guide on how CPUs run programs
Author : archmaster
Score : 928 points
Date : 2023-08-09 13:33 UTC (9 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| adam_oxla wrote:
| Amazing article. I have not seen such a comprehensive guide yet.
| Although when I have seen the title I was expecting it would be
| focused more on CPU inner workings: superscalar pipelines,
| frontend, backend, instruction fusing, memory banks, instruction
| cache, branch prediction, instruction reordering etc.
| 0x978 wrote:
| Wow, found your github from this and getting insane imposter
| syndrome haha, very impressive work
| [deleted]
| jack_riminton wrote:
| Nice one. You'll go far. Especially if you ignore the cranky
| resentful people on here
| jononomo wrote:
| How much help did you get from GPT-4?
| headline wrote:
| Great work!
| GuestHNUser wrote:
| OP, you should take a look at Casey Muratori's course at
| computerenhance.com
|
| The first part of the course's homework creates a simulator of
| the 1978 intel 8086 (which modern x86_64 assembly still closely
| resembles). You will learn a lot of things about computers that
| are really difficult to find elsewhere.
| codenlearn wrote:
| Thank you for posting the link.
| demizer wrote:
| Kid, first of all great job! Second of all I am jealous you
| understand this as such a young age. I was pounding 40 ounces of
| Old English in the hood at 17, but should have doing something
| like this. Granted, the internet was just a baby when I was 17.
| kazinator wrote:
| The guide is stuck in some false then versus now thinking.
|
| A preemptible kernel isn't "modern". Cooperative multitasking
| isn't "old".
|
| These are just choices in the design space that can be relevant
| at any time.
|
| Fully preempted real-time operating systems existed many decades
| ago.
|
| Meanwhile, today, there seems to be a renewed interest today in
| coroutines and fibers and such, and they are showing up in
| programming languages. Those mechanisms are forms of cooperative
| multitasking.
|
| If you need an embedded system to do a few simple things, why
| would you threaten its stability with preemptive, interrupt-
| driven task switching?
| keithnz wrote:
| Great effort, but really still needs a bunch of work. In some
| places the sentences just don't make sense. I think in terms of
| CPU, a good starting point is the Von Neumann architecture which
| most computers are designed around.
|
| The current description of CPUs mix things up with OS concepts.
| You may want to look into things like memory management units (
| MMU ) that builds on the basic Von Neumann architecture to
| provide "virtual memory" such that an OS can use it to provide
| process isolation that OS's can use. Also the more capable CPUs
| have what are often called "modes" (protected mode in x86, ARM
| have a similar thing) to isolate running programs from each other
| and be able to create rings for things like kernels and device
| drivers.
| bityard wrote:
| I'm 43 and wanted to say nice work.
| randombits0 wrote:
| 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.
| tails4e wrote:
| Nicely done, congrats. A really good reference, and the style and
| flow is very nice.
| kaycey2022 wrote:
| This is awesome with such good presentation. Well done!
|
| I would also recommend the linux programming interface book for
| those looking for a very in depth introduction to this topic.
| petecog wrote:
| Very nicely written. Great work! I'm passing it around. Thanks
| ChrisArchitect wrote:
| [dupe]
|
| The other link for this is cpu.land -- stick to your 'official'
| urls! -- shared and discussed a few weeks ago
|
| https://news.ycombinator.com/item?id=36823605
| diarrhea wrote:
| This is on my reading list. This little bit sold me on it in the
| past:
|
| > _The bottom of every page is padded so readers can maintain a
| consistent eyeline._
|
| Such a _tiny_ and, in hindsight, obvious detail. It 's
| surprisingly pleasant. When I noticed that, I knew I had a
| passion project in front of me.
| kaycebasques wrote:
| There are quite a few very nice UI touches. I think the bit
| about the author (authors?) being 17 is relevant because it
| seems like they put a lot of thought about how to represent a
| book on the web and came up with some new conventions, just
| like you'd expect from a new generation. The chapter navigation
| widget at the top for example, where the previous and next
| chapters are slightly opaque. Haven't seen that before.
| EspressoGPT wrote:
| Yeah, that simple frontend definitely got a lot more thought
| than your average shitty convoluted company website.
| 878654Tom wrote:
| What a lovely guide and the best part is that it is a genuine
| guide.
|
| Many articles posted on the internet are meant for one thing,
| guide a user to buy a certain service or product. But after
| reading the whole guide I only had the feeling of someone wanting
| to share knowledge.
|
| The hackclub also seems to be a very interesting organisation and
| I hope more and more teenagers will join you guys and contribute
| to society as you have contributed by making this guide.
| [deleted]
| asdefghyk wrote:
| "... 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.
| archmaster wrote:
| 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! Apparently everything online about
| how operating systems and CPUs work is _terrible_. There are,
| like, no resources. Everything sucks. So while I was teaching
| myself I realized, hey, I should make a really good resource
| myself. So I started taking notes on what I was learning, and
| ended up with a 60-page Google Doc. And then I started writing.
|
| And while I was writing, it turned out that most of the stuff in
| that giant doc was wrong. And I had to do more research. And I
| iterated and iterated and iterated and the internet resources
| continued to be terrible so I needed to make the article better.
| Then I realized it needed diagrams and drawings, but I didn't
| know how to do art, so I just pulled out Figma and started
| experimenting. I had a Wacom tablet lying around that I won at
| some hackathon, so I used that to draw some things.
|
| Now, about 3 months later, I have something I'm really proud of!
| I'm happy to finally share the final version of Putting the "You"
| in CPU, terrible illustrations and all. I built this as part of
| Hack Club (https://hackclub.com), which is a community of other
| high schoolers who love computers.
|
| It was cool seeing some (accidental) reception on HN a couple
| weeks ago while this was still a WIP, I really appreciated the
| feedback I got. I took some time to substantially clean it up and
| I'm finally happy to share with the world myself.
|
| The website is a static HTML/CSS project, I wrote everything from
| scratch (I'm especially proud of the navigation components).
|
| I hope you enjoy, and I hope that this becomes a resource that
| anyone can use to learn!
| astroalex wrote:
| You have a gift for writing and teaching technical concepts. I
| think you could make a serious impact on computer science
| education if you pursued that as a career. Congratulations on
| finishing this mini-book!
| hansoolo wrote:
| Hi Lexi, pretty cool project you finished there! Congrats!
|
| I was a little confused about how you only talked about the
| sources on the internet are kinda poor. But I didn't see any
| comments about books for research...
|
| Did you use any? Can you recommend some on this topic?
| fhools wrote:
| Hey great work you did there. I'd also like to recommend
| nand2tetris and its companion book Elements of Computing
| Systems. If you'd like to dig deep into how a cpu is actually
| elemented via HDL.
| iancmceachern wrote:
| This attitude and ability to execute on your vision will serve
| you well. Excellent work, stay awesome
| minton wrote:
| It makes me happy to see the future generations refusing to
| accept the magic of it all and instead pulling back the
| curtain. Excellent work!
|
| As a side note, once OpenAI slurps up your work, the next
| ChatGPT might not have to lie so much.
| c_s_guy wrote:
| 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!
| 89vision wrote:
| Your github is really interesting. It seems like you have a
| bright future ahead of you. Do great things.
| trogdor wrote:
| 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!
| paulmilligrams wrote:
| If I was your editor, I'd add the following with a red
| ballpoint pen:
|
| Out of touch, tone deaf take. Revise.
| milesvp wrote:
| Please don't ever edit anyone's work with such terse
| comments. There is not one actionable improvement in this
| red ballpoint pen comment. If you want someone to do better
| at writing something, you need to give them things to at
| least consider. You may not know what would improve the
| writing, but just saying "this sucks, fuck off" is never
| productive. At the very least, find one example of a tone
| deaf paragraph and give an example of a rewrite that at
| least you would find better. You may not be the author's
| target audience, but at least you've given input that may
| lead to a better revision.
|
| edit: It occurs to me this is replying one more nesting
| than I realized. The comment stands, but I thought I'd note
| that I missed the sarcasm
| yamazakiwi wrote:
| Your feedback is opinionated, which is fine, but it really
| depends on who is reading the content.
|
| I enjoy some personality thrown into technical writing. Most
| of it is so soulless.
| throwaway49391 wrote:
| Funny coming from trogdor. Don't you have other countrysides
| and peasants to burninate?
|
| Seriously though, that's kind of a nitpick.
| Southworth wrote:
| I loved the poignant guide to ruby and that's not dissimilar
| at all. I think you've been a little unkind/too honest.
| Southworth wrote:
| I loved it, and it reminded me a lot of The Poignant Guide to
| Ruby.
| cbozeman wrote:
| She's a 17 year old girl. I'd be more worried if the language
| _wasn 't_ "cutesy".
|
| Lexi, don't change a thing. This document you've created
| encompasses who you are _right now_ and more importantly,
| _where you are_ in your technical journey and understanding.
|
| The tone is just fine the way it is. If you're compelled to
| "fix" something, just correct errors and call it a day.
| depressedpanda wrote:
| You both have a point.
|
| "Cutesy" language may act as a distraction to the reader,
| and -- like anything when overdone -- can be detrimental to
| the text. Kill your darlings and all that.
|
| _However_, if something isn't supposed to be a terse
| reference manual, it will convey a lighter tone and seem
| more approachable to most people, if used judiciously.
|
| I don't think anyone has enough experience at 17 to know
| where to strike the right balance, so overdoing it (and
| being called out for it) is just part of the journey of
| becoming a better writer while finding your own personal
| style and tone.
| astroalex wrote:
| I couldn't disagree more. I found the tone charming, funny,
| and accessible. I think it would particularly resonate with
| kids and beginners. It reminded me, in the best way, of why
| the lucky stiff's writing.
|
| I will henceforth be referring to CPUs as "shazam alakablams"
| and there isn't anything you can do to stop me!
| simonw wrote:
| I haven't read the whole thing yet, but initial impressions are
| that this looks GREAT. Being able to communicate concepts like
| this well in writing is a rare skill, it will serve you very
| well in your future career.
| archmaster wrote:
| Thank you + I hope you enjoy! I would really appreciate your
| feedback if you finish.
| jonhohle wrote:
| If you haven't looked, older game consoles (Genesis, Game Boy,
| etc.) can provide a very good introduction to how systems are
| built - how devices are mapped to memory addresses, how CPUs
| initialize and get different entry points for the program,
| interrupt handlers, etc.
| xivusr wrote:
| You've found your calling! Keep up the amazing work.
| AndrewKemendo wrote:
| We Will Watch Your Career With Great Interest
| cxr wrote:
| [removed]
|
| 1. <https://manybutfinite.com/category/internals>
| archmaster wrote:
| re Figma: that's a good idea, I can definitely include SVGs
|
| I'll check out Gustavo Duarte's posts!
| corbet wrote:
| 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 :)
| archmaster wrote:
| 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
| replwoacause wrote:
| This is beautiful work. You have a very bright future ahead.
| linhns wrote:
| I haven't gone through everything but this is looking much
| better than anything universities can produce. First time I
| feel that I can go through all of these content and want more.
|
| What a brilliant job you're doing here. Keep it up and you'll
| have a wonderful career.
| munificent wrote:
| This is very, very well written. Congratulations on making (and
| finishing!) such a good resource!
| RamblingCTO wrote:
| I just read the first chapter and it reads very very nice! Wish
| I had that back in Uni haha. Well done, keep on going!
| Computers are indeed simple and complicated at the same time.
|
| /e: this was also a trip down memory lane to my time at Uni and
| why I fell in love with compsci. It's so inherently beautiful
| and clever, every teeny tiny bit of it.
|
| I also had a great book when starting out: "Einfuhrung in die
| Informatik" from Gumm/Sommer (my professors), written in
| German. They explain round about everything on a basic level in
| round about 900 pages. Think about how far we've come in the
| last 15 years, wow! I feel very sentimental now haha
| thiht wrote:
| Impressive work.
|
| I usually don't comment on << I'm xxx years old and did yyy >>
| because I'm not interested in material that would be <<
| good/great for an xxx years old >>. In this case, this is great
| work, period. Adding << for an xxx years old >> would be
| insulting.
|
| Some sections remind me of the material of my college courses,
| which were quite extensive as my degree historically had a dual
| electronics/software specialization.
|
| > Apparently everything online about how operating systems and
| CPUs work is terrible.
|
| Agree with that! As a pro tip, when online resources are scarce
| for a subject, try adding keywords to find college degree
| resources (slides, websites, homework, etc.). The material is
| usually badly referenced on Google, but can be pretty good
| depending on what you find.
| rolph wrote:
| jealousy, thievery, exploitation, are all things that throw
| themselves at young talent.
|
| be warned, here,there be dragons!
| phillipcarter wrote:
| This is a great website! Really enjoyed reading it this
| morning. I wish I had something like this to supplement the
| really dry textbook I had to read in Operating Systems class in
| college. Reminds me a bit of Learn You a Haskell for Great
| Good, which was similarly an excellent supplement to the dry
| textbook: http://www.learnyouahaskell.com/
| archmaster wrote:
| I am a big fan of Learn You a Haskell! Was absolutely lovely
| when I was learning FP.
| linhns wrote:
| For those who haven't bookmarked this, do it immediately. I
| actually did not like it at first but as time goes by I just
| realized it is awesome. And it's free!
| mgaunard wrote:
| I haven't done the research, but I can't believe most of the
| information could be that hard to find or wrong, at least if
| you know where to look.
|
| These sorts of topics are usually well-covered in the matching
| undergraduate-level computer science courses (computer
| architecture and operating systems, which, these days, are
| mostly optional since out of fashion).
|
| Several universities have free courses available, and some of
| the professors in the field have also written books.
|
| You'll also find pretty informative presentations in the
| relevant tech conferences if you'd rather stay closer to the
| state of the art.
|
| Still, teaching is an art that is undervalued, and making the
| information more available or more fun to interact with is
| certainly very valuable.
| Const-me wrote:
| 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 people wrote
| these sources.
|
| Some details of modern hardware are secret. An example from
| low-level programming, many sources claim CPUs have two kinds
| of branch predictors, static one which predicts forward
| branches as not taken, and the dynamic one which
| queries/updates these BTB entries. This is incorrect because
| mainstream CPUs made in the last 15 years no longer have the
| static one. However, the details of modern branch predictors
| are proprietary, so we don't have authoritative sources on
| them. We only have speculations based on some micro-
| benchmarks.
| dist1ll wrote:
| > CPU architectures other than AMD64 and ARM [..] no longer
| relevant
|
| _cough_ RISC-V _cough_
| zerohp wrote:
| > 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 are easily found in the reading list
| for a graduate-level computer architecture course.
| Implementation details vary but usually not by too much.
| Const-me wrote:
| 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
| chaosite wrote:
| 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 processor,
| even though MIPS isn't really used anywhere anymore
| (well, that's wrong, they're used extensively in
| networking gear, but y'know, for the argument). They
| still go over the various techniques used, their
| consequences, etc., so the processor chosen as an example
| is unimportant.
|
| You're saying that all this information is unhelpful for
| you, because what you want is a detailed optimization
| guide for a particular CPU with its own particular
| implementation of branch prediction. And yeah, university
| courses don't cover that, but note that they're not
| "outdated" because it's not as if at some point what they
| taught was "current" in this respect.
|
| So yeah, in this sense you're right, academia does not
| directly tackle optimization for a given processor in
| teaching or research, and if it did it would be basically
| instantly outdated. Your best resource for doing that is
| the manufacturer's optimization guide, and those can be
| light on details, especially on exactly how the branch
| predictor works.
|
| But "how a processor works" is a different topic from
| "how this specific processor works", and the work being
| done in academia is not outdated compared to what the
| industry is doing.
|
| PS: Never believe the marketing in the press release,
| yeah? "Neural network" as used here is pure marketing
| bullshit. They're usually not directly lying, but you can
| bet that they're stretching the definition of what a
| "neural network" is and the role it plays.
| Const-me wrote:
| > 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.
| chaosite wrote:
| > They also include various techniques not used anymore,
| without mentioning that's the case.
|
| Definitely. Sometimes it's for comparative reasons, and
| sometimes it's easier to understand the newer technique
| in the context of the older one.
|
| > discussing particular implementations of branch
| predictors in Pentium Pro, Alpha 21264, Pentium M, and
| Pentium 4.
|
| Yeah, but the course is still not the optimization guide
| you wanted. The slides pick & choose features from each
| branch predictor to make the point the professor wanted
| to make and present the idea he wanted to. It's not
| really useful for optimizing code for that particular
| processor, it's useful for understanding how branch
| predictors work in general.
|
| > I'm pretty sure they would be happy to included slides
| about contemporary CPUs, if only that information was
| public.
|
| Only if they served as a good example for some concept,
| or helped make a point that the professor wanted to make.
| There's no point in changing the examples to a newer
| processor if the old one is a cleaner implementation of
| the concept being discussed (and older examples tend to
| be simpler and therefore cleaner). The point isn't to
| supply information about specific processors, it's to
| teach the techniques used in branch predictors.
|
| P.S. See those 3 slides about a "Perceptron Branch
| Predictor"? Based on a paper from 2001? I'm betting AMD's
| "neural network" is really just something like that...
| [deleted]
| archmaster wrote:
| "Wrong" is perhaps not the most accurate word. I most often
| found information to be either extremely oversimplified such
| as to be unhelpful, or outdated and no longer relevant for
| current systems. Although, yes, some things were just wrong.
|
| There are courses and presentations and books, but there
| aren't many websites or articles -- and that's the learning
| style that works best for me. Undergrad programs will teach a
| lot of what I covered (though certainly not all, and it
| really depends on the program) but I believe that knowledge
| should not be gatekept on going to college.
| assbuttbuttass wrote:
| Ultimately, diving deeper with only websites and articles
| can be quite challenging. I experienced this myself trying
| to learn more about the continuation passing style
| transformation in a compiler. No online websites or
| articles discussed the topic with any kind of depth.
|
| Ultimately I read the classic book "Compiling with
| Continuations", and it basically cleared up all my
| confusions.
|
| All of this is to say, don't discount books and courses.
| They will almost always be more in depth and correct than
| what you will find written up on a website.
| archmaster wrote:
| I think you are very correct, and I don't like it. There
| should be more "online books" that are in depth and
| correct!
| assbuttbuttass wrote:
| Agreed!
| vmladenov wrote:
| Have a look at this one!
| https://github.com/angrave/SystemProgramming/wiki
|
| It was still in development when I went, looks like they
| made a PDF now. https://github.com/illinois-
| cs241/coursebook
| cinntaile wrote:
| The course was changed from cs241 to cs341 so I think the
| most up to date version is here [0] now.
|
| [0] https://cs341.cs.illinois.edu/coursebook/index.html
| halosghost wrote:
| Others have already mentioned how high-quality this is, but I
| feel the need to reinforce it. The content is excellent, the
| framing is smooth, the presentation is accessible, and
| gorgeous. And beyond all that, you also ensured that the
| generated PDF is high-quality.
|
| I'm incredibly impressed. Keep up the great work, but most
| importantly, hold on to your passion and care!
|
| All the best,
|
| -HG
| archmaster wrote:
| Glad you like the PDF! Fun fact: it's actually the print
| stylesheet output of the one-pager edition. Hit Ctrl-P on
| https://cpu.land/editions/one-pager (pref. in Chrome)
| lostlogin wrote:
| That one-pager button is great.
| patrickscoleman wrote:
| 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 :)
| __MatrixMan__ wrote:
| 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.
| findalex wrote:
| I saw how straight the stick figure's back was and laughed
| out loud to myself.
| kriro wrote:
| I only browsed this but it seems like a pretty cool primer.
| Loving the style as well.
|
| It's also a very good idea to write these types of resources
| when you teach yourself something new because it clarifies your
| thought process and helps you identify parts that are still
| unclear even though you initially thought you understadn them
| etc.
|
| I also liked this at the end:
|
| """ I talked to GPT-3.5 and GPT-4 a decent amount while writing
| this article. While they lied to me a lot and most of the
| information was useless, they were sometimes very helpful for
| working through problems. LLM assistance can be net positive if
| you're aware of their limitations and are extremely skeptical
| of everything they say. That said, they're terrible at writing.
| Don't let them write for you. """
|
| Congrats, cool project.
| shever73 wrote:
| >It's also a very good idea to write these types of resources
| when you teach yourself something new because it clarifies
| your thought process and helps you identify parts that are
| still unclear even though you initially thought you
| understadn them etc.
|
| Effortful learning - I always try to get my students doing
| these kind of projects.
|
| I think this one is very cool. It's like a more approachable
| version of Modern Operating Systems.
| archmaster wrote:
| I'm glad you enjoyed it!
|
| > It's also a very good idea to write these types of
| resources when you teach yourself something new because it
| clarifies your thought process and helps you identify parts
| that are still unclear even though you initially thought you
| understadn them etc.
|
| I found this to be very much the case. As I wrote the
| article, I discovered so many things that I didn't properly
| understand. It partially took so long because I ended up
| going down mini rabbit holes every step of the way. And now I
| understand stuff a lot better!
| II2II wrote:
| Excellent work.
|
| I have run across so many resources where it is clear that
| they author was both a learner and had little interest in
| going back to improve their work for clarity and accuracy.
| Your work is clearly several leaps beyond that. It is clear
| and the portions I have read are accurate. It leaves me
| wanting to go back to read more and I am confident you
| won't disappoint.
|
| Thank you for your contributions and I wish you the best in
| your future endeavours.
| EGreg wrote:
| I love it! And also the natural humor that comes with writing
| as a 17-year-old. When I was your age I wrote this column of
| articles on FlipCode, about game development:
|
| https://www.flipcode.com/tpractice/
|
| (If you check it out, I'd love to know your opinions).
|
| Also, I wonder what are your local state laws about hiring a
| 17-year-old to work on open source stuff as an intern. I
| checked out your github and think you might enjoy part-time
| discovering what we build. Here is the codebase:
| https://github.com/Qbix/Platform
| EGreg wrote:
| Apparently the URL needed updating:
|
| https://www.flipcode.com/archives/Theory_Practice-
| Issue_00_I...
| amelius wrote:
| It's a bit dated but perhaps you should check out Structured
| Computer Organization by Andrew Tanenbaum.
| archmaster wrote:
| Oh, thank you for the suggestion! I of course know of
| Tanenbaum by reputation but I've never read the book.
| freedomben wrote:
| 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.
| zahllos wrote:
| I've only skim-read your articles so far, but it looks
| excellent. Congratulations and please keep doing work like
| this. I previously worked as a research engineer (a fancy name
| for a software engineer working in a university lab, in my case
| doing computer security research) so believe me when I say
| there are graduate students who don't have your grasp of
| operating systems (see the comments elsewhere on OS courses
| being optional).
|
| > Apparently everything online about how operating systems and
| CPUs work is terrible.
|
| Unfortunately finding good information is not easy, but it is
| out there - you've proven it by synthesizing some of that hard
| to find information into a better form. My degree is in
| mathematics, but my computing knowledge is self taught. Knowing
| how to learn in this way and to be able to communicate highly
| technical information in an approachable manner are incredibly
| important skills and not to be underestimated.
|
| I have two links to share - I limited myself to two because we
| could be here a long time otherwise:
|
| 1. https://git.lain.faith/sys64738/airs-notes.git (TOC for
| linker part here: https://lwn.net/Articles/276782/) - you've
| scratched the surface of ELFs and linking. This is a 20-article
| blog series by Ian Lance Taylor plus miscellaneous extra topics
| containing everything you ever wanted to know about ELFs and
| quite a bit that will likely make you wonder how any of your
| commands are actually even working! There's even a brief
| mention of ELF's companion, DWARF, which amongst other things
| is a virtual machine used every time a C++ exception is
| triggered.
|
| 2. Have you seen this excellent project?
| https://0xax.gitbooks.io/linux-insides/content/ - essentially a
| human-readable walkthrough of how the Linux kernel does stuff.
| Has almost certainly been shared on HN before.
| mananaysiempre wrote:
| > https://git.lain.faith/sys64738/airs-notes.git
|
| Oh, that's awesome, it even has some things transcribed from
| Fengrui Song's blog (https://maskray.me/) as well--I
| sometimes feel like it's the only place where some
| particulars of binutils(-compatible) behaviour are documented
| (I don't come there for the generalities, though, like GP is
| seeking). I only wish there were more of these transcriptions
| :)
| SilasX wrote:
| Oh wow I think I found my intellectual doppelganger! I run into
| this problem a lot, where I try to learn something simple but
| it quickly balloons to the point where the answer is in a
| hundred pieces due to missing context and bad assumptions about
| the reader. I went through this same process but for Bitcoin,
| culminating in writing the Understanding Bitcoin book[1].
|
| I also saw this dynamic in the cryptopals challenges, where I
| thought the hardest problems were "look up this off-the-shelf
| cryptosystem and implement it", not "find a flaw in that system
| you reimplemented with only a few hints.[2]
|
| Like others, I recommend nand2tetris as having answered a lot
| of the questions I had. It has you implement the hardware of a
| computer that can execute the program loaded in its memory,
| from the logic gates and flip-flops up. Then, you implement a
| compiler that can translate high-level Java-like code into
| binary. (First to a virtual machine, then assembly, then
| binary.)
|
| Of course, even then it leaves caps: it's a deliberately toy
| system, it can't handle programs longer than its memory, the
| machine does only one-shot programs (and thus can't handle a
| programmer creating a program live and having it be executed).
| But it answered a lot of my questions, like how to make memory
| work, and how function call/return work.
|
| [1] http://understandingbitcoin.us.
|
| [2] Previous comment about it:
| https://news.ycombinator.com/item?id=36398627
| kylehotchkiss wrote:
| Hi Lexi. I love seeing 17 year olds taking a deep dive into
| tech. You chose a great field and have a great career ahead!
| Keep up the good work - stay curious, work on personal
| projects. It gets a little harder to find the time as you get
| older and you'll look back on the things you're doing now and
| feel satisfaction for it.
| Southworth wrote:
| This is really, really awesome. Excellent work. You've a bright
| career in front of you, I reckon.
| [deleted]
| brunooliv wrote:
| Damn. If you're producing this type of content at 17, I can't
| even imagine the amazing things you'll be able to do it you
| choose to pursue the field professionally. Absolutely amazing!!
| hughesjj wrote:
| This is legit, nice work! I'm going to link this to some friends
| globular-toast wrote:
| Looks like a cool guide. Something seems off about this, though.
| Can't quite put my finger on it.
| osclarto wrote:
| wow 17! excellent work. You're going places for sure if you keep
| this up. I would guess even most working Devs don't have any real
| concept of how things work at the CPU level let alone during high
| school.
| asynchronous wrote:
| Would just like to comment that the presentation is top notch,
| really appreciate the level of detail put into it.
| morjom wrote:
| I wish I was taught these things in my basic degree. Thank you
| for the writeup
| bobboies wrote:
| 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 :)
| bdcravens wrote:
| Except the title wouldn't be entirely accurate - there's plenty
| of "Senior Engineers" who are really just framework assembly
| liners who could learn something from this writing :-)
| freedomben wrote:
| I didn't really like the title of the HN post either, but I
| don't think it needs much change. Just drop the "I'm 17 and"
| part and do "I wrote this guide on hwo CPUs run progra..."
|
| The "I'm 17" part just felt irrelevant to me in a technical
| work. I.e. it's either technically correct or it's not.
| However, I can see a strong argument about why it _should_ be
| in the title. If you care about meta details of the work, it 's
| certainly different and interesting to be produced by someone
| so young. I suppose part of this is my own life experience
| talking, and very likely means I'm projecting. When I was a
| teenager I _hated_ divulging that to others on the internet
| because they treated me differently when they found out how old
| I was.
| bobboies wrote:
| Well--it could go either way but I do think it is notable
| that the author is young and helping peers. Based on original
| post seems important to them. But the exact number 17 not
| important either way!
|
| I might click through and read an article to see what the
| youth of today are creating, but not so much care about an
| adult writing something on CPUs haha
| simonw wrote:
| Hacker News automatically removes the word "How" from the
| beginning of submissions (and then Title Cases them for good
| measure) - so I believe submitting that title would instead
| result in this: I'm Helping My High School
| Peers Learn About CPUs
|
| I might be wrong though, it might only do this with "How to
| ...".
| seabass-labrax wrote:
| 'How to' is one of the title forms that _isn 't_ modified,
| currently.
| simonw wrote:
| I submitted https://simonwillison.net/2023/Aug/6/annotated-
| presentations... the other day - title "How I make
| annotated presentations" - and it was automatically re-
| titled to "I Make Annotated Presentations" - but then
| renamed back again, I presume by a moderator.
|
| https://news.ycombinator.com/item?id=37024398
| topaz0 wrote:
| Good to hear I'm not the only one who finds that form of
| title unpalatable. IMO one of the most annoying headline
| trends of the clickbait era.
| topaz0 wrote:
| 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.
| bobboies wrote:
| The HN title I meant!
| scovetta wrote:
| I read through the first couple parts, this is exceptionally well
| written, clear, and AFAICT, accurate. Nicely done.
| NuSkooler wrote:
| I've only skimmed so far, but this looks really great. Good work!
| tornato7 wrote:
| Halfway through part one and I'm hooked! Thanks for writing this.
| It's something I didn't know I needed.
| xivusr wrote:
| You've found your calling! Keep up the amazing work.
| alaintno wrote:
| I'm almost 40 years old, and I've never accomplished something
| like this. I was just about to cope about my impostor syndrome.
| Well, I guess I need to cope more!
|
| Great job :p
| cezart wrote:
| It's never too late to start doing what you think will make you
| feel accomplished. Be it when you're 17, 40 or 80. You still
| have plenty of time ahead, and there isn't even much reason to
| rush. Just pick an inspiring idea and slowly work on it in the
| little free time you can allocate to it. The key I guess is to
| feel proud of working on it. The end product will result on
| it's own eventually.
| lfkdev wrote:
| Wow, so because you're 17 we should click on this article? I was
| 17 also some time ago
| ac1spkrbox wrote:
| [flagged]
| dang wrote:
| " _Please don 't pick the most provocative thing in an article
| or post to complain about in the thread. Find something
| interesting to respond to instead._"
|
| " _Please don 't post shallow dismissals, especially of other
| people's work. A good critical comment teaches us something._"
|
| https://news.ycombinator.com/newsguidelines.html
| mplanchard wrote:
| Ah but did you make anything interesting when you were 17? Most
| people were 17 at some point, but most of them didn't make
| anything particularly impressive at that age.
| ChrisArchitect wrote:
| What happened to the Show HN: on this?
| dang wrote:
| I took it off because reading material isn't supposed to be
| Show HN.
|
| That's not any judgment about the content, which as far as I
| can tell is great.
|
| https://news.ycombinator.com/showhn.html
| lagniappe wrote:
| This is great work :) thanks for sharing it with us. Unexpected
| Linkin Park bit at the end was nice, but now I'm wondering if
| Linkin Park is now considered 'oldies'
| IggleSniggle wrote:
| I mean, of course? AC/DC has got to be the "moldy oldies" of
| today, which leaves Elvis or The Champs nothing but genetic
| parasites to the degree that they are still recognizable.
| Wagner? Vivaldi? Ockeghem? Fuhgeddaboudit.
|
| To be clear, that's the bizarre/absurdist arbitrary line I'm
| tracing to Linkin Park
| speed_spread wrote:
| Linkin' Park is where you went when compiling a really large
| C++ app (before mold)
| ageitgey wrote:
| Definitely oldies now! Their hits are two decades ago. If you
| were born in the 80s, Linkin Park is as old now as the Beatles
| were then.
| bee_rider wrote:
| The gap between Nirvana and now is significantly larger than
| the gap between Nirvana and Zeppelin, and the worst part is
| some kid might come along and not understand how crushing that
| is.
| wkjagt wrote:
| The best resource I've found so far that helped me understand how
| computers / CPUs work, is Ben Eater's work. Both his 6502
| computer, and 8-bit CPU series are amazing.
|
| Looking forward to reading your guide. Thanks for sharing!
| elSidCampeador wrote:
| Nicely done!
| tech_ken wrote:
| Wow what incredible timing, I was just looking for something like
| this yesterday!
| WC3w6pXxgGd wrote:
| This is fantastic. Great job! I like the easier to comprehend
| language than what you typically find when reading information
| about this stuff (wikipedia is one of the worst...).
|
| You'd probably like Nand2Tetris. To be frank, I never finished it
| (it's so long!), but building a CPU from scratch was insightful
| (at the time - I don't remember much now, sadly).
| skizm wrote:
| Meta point: I'm curious of people's thoughts when OPs in general
| post "I'm N years old..." or "I'm a blind programmer who..."
| before posting something unrelated to their life situation.
| Personally I think this falls into the "girls do not exist on the
| internet" rule of thumb. No reason to state that you're a girl
| (or 12 years old or whatever) other than to prime people to look
| upon your writing with lower standards. I think it is fine to
| mention your situation in passing or as a footnote if it is
| interesting, but unsure it really adds anything to lead with it
| (personally I think it detracts).
|
| That's just my opinion. Anyone else have thoughts?
|
| FWIW this seems pretty well written from just skimming the intro
| and a bit of chapter 3.
|
| Edit: sorry I did not mean for this to be the top comment and
| push OP down so far. The writing here is really good and folks
| should definitely click through and at least give it a skim if
| they're interested. I was just curious what people's thoughts
| were on this topic.
| bdcravens wrote:
| I don't think it's any worse that appealing to authority
| ("patio11 said that ....") or referencing that you were in YC.
| In those cases as well, quality should stand on its own. Even
| so, I think context helps, and it's not always the same as
| having lower standards.
| l__l wrote:
| Not commenting on whether it's good/bad, but I think it's
| completely different to your examples. Both of those say
| "here is context of my past achievements; this is an
| indication that what follows may be of high absolute quality"
|
| As opposed to the "I am N years old", which is saying "here
| is context, which doesn't by itself indicate achievement,
| which may be an indication that what follows is of high
| relative quality"
| matsemann wrote:
| > _other than to prime people to look upon your writing with
| lower standards._
|
| I have to admit, a fault of mine is that I sometimes do the
| opposite. When I read stories about someone younger than me
| achieving stuff, it's easy to look for faults to diminish the
| accomplishment.
|
| "High school student made X? Pft, I found a small flaw when
| skimming the story therefore the whole thing is probably bad
| and I don't have to feel bad about not achieving the same at
| that age."
| firebirdn99 wrote:
| This is very impressive at 17, and her Github activity. So age
| definitely qualifies. We were fascinated with Mark Zuckerberg,
| or Bill Gates at their ages, so this isn't anything new. Doing
| anything remarkable at a young age is impressive and worthy to
| be noted.
|
| This is a young person making strides in a hard field, and
| quite different from majority of peers at their age, but
| especially today with short attention spans, and TikTok,
| gaming, other distractions.
|
| Another point is many high schools tend to coddle their
| students even for very little accomplishments. I was surprised
| by the attention one 16 yr old student got for making an
| interesting yet simple science explainer about the sleep cycle.
| She won the award in the Breakthrough challenge competition,
| got a 250K scholarship, and given feedback to the tune that she
| would cure cancer.
|
| There's also a huge competitive gap between US High schools
| today on average, than many other countries. It would be great
| for the US system to challenge HS students again and reward
| real accomplishment.
| Cushman wrote:
| Gently: Could we please not? :)
|
| This is a young person who's new to the community. That's where
| communities come from!
|
| Without other comment, this meta thread is pushing the author's
| personal statement below the fold. As the grown-ass adults in
| the room, we can have our judgments, but we should try to make
| a little space, too.
| isaacremuant wrote:
| I disagree with your premise of censoring as a "way to be
| welcoming".
|
| There's a valid discussion to be had about the title and the
| need to preface things with age.
|
| As a a grown ass adult you're not making space, you're
| demanding ranking that favours your ideas and even more, the
| silence of some you disagree with.
|
| The funniest thing is that you didn't even address the guide
| itself. The style or the content, you just came to do
| "justice" or something.
|
| Content is good enough. Style is a bit "full of wonder and
| amazement" and has its own particular flair but that's just
| personal style, regardless of age. You could even argue that
| age is necessary to account for "the audience are other high
| schoolers, but that's if you have the discussion you're
| asking people not to have (and whoever agrees with your
| censoring mindset and downvoted OP to now effectively hiding
| it from. View).
| wholinator2 wrote:
| I think kids tend to do it in traditionally adult spaces just
| as a buffer from the extreme criticism that can exist online.
| Saying, "someone wrote a cpu guide" has a lot less impact than
| saying "a teenage girl wrote a cpu guide". I don't think the
| individual behind the content is all that important and we have
| to recognize that we only ever see the kids that tell us
| they're kids, i could be an 8 year old prodigy for all anyone
| knows.
|
| Praise is nice, especially when you're young. Stating your
| young has to dramatically increase praise to criticism ratio in
| adult spaces like this. No one would care on reddit but we're
| all old men here lol so the kids stand out. It can be overdone
| if the person makes the content about themselves instead of the
| content, or intentionally starts controversy. But this is fine.
|
| Since she states she won a hackathon she's probably a very
| gifted and motivated young person who is still surrounded with
| adults telling her she's great, that doesn't mean they're
| wrong. And sooner or later the adults begin drastically raising
| the bar for praising you so it's cool for her to get her last
| couple years out of it.
| SantalBlush wrote:
| Encouraging youth is a good thing. But I suspect that the
| youth most in need of encouragement are the sort of kids who
| wouldn't even have the courage to post something to HN. Maybe
| I'm wrong. But I think that's why these things rub me the
| wrong way.
|
| These things always strike me as merely fishing for praise,
| while trying to stifle legitimate criticism, which is unfair
| to everyone else, old and young alike.
| wesapien wrote:
| Agreed. Honestly, I thought it was always about humble brag.
| For example: Look at me I'm a 5 yr old cat living in a $2M
| loft in Soho while I go to school in MIT riding my private
| helicopter. I'm such a success at cat.
| ecshafer wrote:
| I think this approach is pretty alien to me. When I was a
| kid, I hid the fact I was young on the internet because I
| wanted to be taken seriously and not be dismissed or treated
| with kids gloves due to my age. I didn't like that I could
| show a website I built to someone in life and have them say
| 'oh wow good job kid'. Internet is brutal but usually pretty
| honest.
| makeworld wrote:
| What do you mean "rule of thumb"? That's just an old meme
| making fun of how most Internet users were male. It's not about
| how you shouldn't mention gender.
|
| If gender is never mentioned, maleness is assumed all the time,
| and then male users will not realize the abilities of their
| female peers.
| dellorter wrote:
| I think something valuable is lost if everyone must present
| irrelevant identity information to combat false assumptions
| some may hold. At least for the crowd who want to primarily
| be associated with attributes that can be merited to their
| choosing.
| e9 wrote:
| On the other hand it is very positive because it inspires
| others in whatever "I am X" situation to get involved. It's not
| uncommon for other fields like sports etc to have similar
| influence: "someone else like me is doing this so I can do it
| too!"
| hyperliner wrote:
| [dead]
| d_tr wrote:
| I don't mind. I will form some opinion after I see the work,
| and yes, my standards will be different depending on the life
| circumstances of the OP, especially when it comes to some
| disability which makes the work more difficult, like being
| blind. In such a case, mentioning it could be encouraging to
| other people facing similar hurdles.
| cprecioso wrote:
| Doesn't the idiom "girls do not exist on the internet" itself
| point to the "standard" that, in this circles, men think of the
| people are interacting with as men, as "default", and the not-
| default is women. And we come back to the invisibilization of
| people who are not a white young guy in tech.
|
| I'd wish to get as far away as possible from such an attitude,
| and thus really enjoy when I see people outside of this "norm"
| to make themselves known and attract more heterogenous people
| that can enrich the community.
| dellorter wrote:
| I don't think it's intended as such, but the particular
| phrasing as expressed could be misinterpreted as such.
| Therefore it should be expressed differently; don't choose to
| differentiate based on attributes that shouldn't make a
| difference for your message.
| KolenCh wrote:
| If you want people judging you, mention that, if the goal is
| for others to judge the work, don't.
| oytis wrote:
| Internet is a different place now. People bring their
| personalities and identities in. Don't think there is anything
| wrong with it. Also nothing wrong with being more patient with
| very young people and more impressed with their achievements
| IMO.
| dellorter wrote:
| I think some of the negativity towards identity is that it's
| usually not something that can be merited as your doing and
| not usually relevant.
|
| I understand this criticism, but think it's a lost cause to
| point it out.
| yawnxyz wrote:
| If the HN community was kinder, this kind of caveat would not
| be necessary
| globular-toast wrote:
| I don't support racism, sexism, ageism etc. Therefore I would
| prefer it if people didn't try to use those attributes to draw
| attention.
| DistractionRect wrote:
| Mixed feelings, but overall, I think it does two things:
|
| - promotes more civil discussion. Commentors are less mean,
| less dismissive, and when posting criticism it's usually more
| constructive
|
| - gets the article more attention/traction than normal as a
| subset of the audience is impressed by the
| accomplishment/effort given the backstory
|
| Which both benefit the author, and that's fine. We talk about
| hooks and marketing all the time here; this is harmless but
| effective, which IMO is the best kind.
| sam0x17 wrote:
| Yeah, for me the breakout interesting thing about this post
| was that it was written by a 17 year old.
| tempaccount420 wrote:
| Can't wait for people to start abusing this strat by lying
| about their age.
| verisimi wrote:
| Its leveraging one's marketing credentials - do whatever you
| can to make the sale/get the views.
|
| However, I'm not even going to click on the link.
|
| I cannot stand these sorts of manipulations. I feel embarrassed
| on behalf of whomever that they attempt to play the victim card
| for attention. I wouldn't have a problem with someone stating
| their age/sex/gender/sexuality if that were actually relevant
| to the issue at hand, or even to mention it in the first
| paragraph as a sort of aside. But to put it front and centre in
| the submission, is a pretty low tactic. Pass.
| dhdjcjfn wrote:
| I just wanted to give another interpretation of the phasing
| used in the post. I took it more like this should be considered
| more impressive because it is well written AND written by
| someone so young. And i suppose it's fair to feel like that as
| the author cause its a pretty good post
| throwaway290 wrote:
| It's always great when I see someone's work and it's
| interesting so I look the person up and it turns out that is
| not the stereotypical demographic (eg. 20 to 40 yo dude), but
| if I see demographic factor paraded upfront I feel like it is
| meant to compensate for lacking work (if not then what is the
| purpose?) and I automatically counter compensate so it tends to
| lower my first impression
| lovich wrote:
| Kind of a tangent off your point but you're referencing the
| "girls do not exist on the internet" phrase like it was used by
| people to say don't bring your identity onto an anonymous
| forum.
|
| Was that how it was used? Back in my forum and chan days when
| that phrase was common I only saw it used to explicitly try to
| force women off the internet. It was usually quickly followed
| up with "tits or gtfo" for instance and I never saw an
| equivalent push on anyone mentioning they were a man
| kkoncevicius wrote:
| I've always understood "tits or gtfo" to suggest that if you
| are mentioning you are a girl then do something related to it
| (show breasts) or else shut up about being a girl when its
| not relevant.
| wizzwizz4 wrote:
| That's on the charitable side. It reads to me more like "a
| woman's acceptance in this community is predicated on her
| providing sexual favours". But your interpretation still
| reveals an issue: men are allowed to express themselves in
| small (and often _large_ ) ways that are "not relevant", so
| why this (pervasive) attitude when women do it?
| dellorter wrote:
| [flagged]
| ggambetta wrote:
| Fully agree with this, I have a very similar response when I
| see these.
|
| That said, the tone of my reply to OP would have been different
| if hadn't known their age. Or more likely I would have thought
| to myself _" so you understand CPUs, cool"_ and moved on.
| ibiza wrote:
| Also, 17? At that point young adults have reached cognitive
| maturity[1], so perhaps that's a good time to drop the
| qualifiers.
|
| 1. https://pubmed.ncbi.nlm.nih.gov/30762417/
| balder1991 wrote:
| Maybe in this case it's a way to avoid too harsh criticism.
| It's like, "hey, if I'm missing something I don't have a degree
| so don't take this as an authoritative piece".
| throwaway290 wrote:
| If it serves like a content warning then sure but it's
| dubious, a lot of outright junk appears here without anything
| like that-- that's what discussion threads are for:)
|
| and about avoiding negative feedback, well I'm 36 and I don't
| have a degree... What can _I_ do to avoid harsh criticism? I
| clearly can 't use my age right? (right now I try to ignore
| it if it's not constructive or try to not become depressed
| and use it if it is, but overall I don't think this industry
| is so harsh criticism wise)
| yboris wrote:
| A lovely piece of advice I came across from Larry King in
| his book _How to Talk to Anyone, Anytime, Anywhere_ :
|
| If you're about to give a public speech and you don't have
| much experience (and are thus anxious), come out and state
| as the first thing ( _something like_ ) "Hey, I don't talk
| publicly and this is scary, but I'll try my best".
|
| This immediately can make you less anxious as any mistakes
| you make can be understood (rather than criticized) by the
| audience.
|
| When commenting outside my area of expertise I often
| mention my lack of qualifications so as to invite gentle
| corrections to my mistakes (and to make others _not_ assume
| I speak from great knowledge).
| WC3w6pXxgGd wrote:
| > other than to prime people to look upon your writing with
| lower standards
|
| Yes, that's the point. They're 17, so my expectations are
| lower.
|
| I am impressed a 17 year old wrote this website.
| GloomyBoots wrote:
| I know what you mean, but I see it a little differently.
|
| 1. I was a precocious kid, and as much as it might rub people
| the wrong way, there's nothing wrong with being proud of
| yourself for that and bringing attention to it. The downside is
| that you can (at least some of us) have one hell of a shock
| once you're out of the wunderkind age range and you've made
| that a core part of your identity.
|
| 2. Different standards are warranted with youth. That was a big
| reason why I prefaced everything with my age growing up.
| Programmers are notoriously nitpicky and curmudgeonly, but they
| do tend to have a special place in their heart for youthful
| curiosity and enthusiasm, and are more willing to give
| constructive feedback to someone in that phase than a mature
| adult who won't just RTFM. I know I feel that way.
| snovymgodym wrote:
| I agree with your take. It also reminds me of those comments on
| youtube videos of classic rock songs (or any music older than 5
| years at this point) that go along the lines of "I'm X years
| old, and I like this REAL music".
|
| It always seems like the intent is for internet strangers to
| pat you on the back and tell you how special/precocious you
| are.
| llm_nerd wrote:
| Everything is marketing.
|
| The age thing is a bit of a red flag now given that too many
| parents in this industry try to give their kid an advantage by
| presenting their work as the work of their child. Seed the
| internet with all of the amazing accomplishments your kid
| "achieved" at a young age. I now look on the "I'm NN years old
| and I..." claims with skepticism, to the point where it's a net
| negative. It makes the project look worse.
|
| Not in this case. It probably a nice guide. Already know how
| CPUs work so didn't read it, but it's entirely reasonable that
| a teen could do the work and assemble the details of how a CPU
| works.
| ranting-moth wrote:
| 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!
| bityard wrote:
| I'm 43 and I agree with this.
| [deleted]
| codemiscreant wrote:
| 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.
| vunderba wrote:
| Prefacing self promotional material with an age (either skewing
| young or old) is a marketing angle that's worked for well...
| ages, so I don't begrudge her leveraging it.
| nicechianti wrote:
| [dead]
| racl101 wrote:
| Very cool.
|
| What a novel way to show your skills to employers.
| dghughes wrote:
| Going down the Rabbit Hole is fun for any subject you learn a
| lot. For electronics I went down the hole power, current and
| voltage, EMF, magnetism, ferromagnetic metals, domains (as in
| magnetic area no networking i.e. electron alignment), virtual
| electrons, physics, quantum mechanics...
|
| Similar for computers you see the high level stuff but then you
| can go right down to the wire level where bits are voltages
| +5/-5/0V and clock timing.
|
| Although being too curious can be bad thing. You have to know
| when to stop or where to start. I think we've all heard stories
| of people troubleshooting who are very intelligent. They're
| tearing into a problem down to the hardware level or going over
| code line by line when all they needed to do was reboot.
| wizzwizz4 wrote:
| > _when all they needed to do was reboot._
|
| That's not fixing the problem: that's ignoring it. Which might
| be the right decision if you need the computer to work _now_ ,
| but _fixing_ it would mean it never happens again.
| mckirk wrote:
| Are there any pointers you could share on what would be a good
| way to go down the electronics rabbit hole? I'm great with
| software, but still often notice a glaring lack of knowledge
| when it comes to hardware topics.
| dghughes wrote:
| Fundamentals of Electronics is what I used for a textbook or
| one I liked. One thing I'd strongly recommend is to brush up
| on your math if it's been a while. Calculus included.
| Electronics is very mathy!
| speps wrote:
| Actual guide link: https://cpu.land/
| matteason wrote:
| > The bottom of every page is padded so readers can maintain a
| consistent eyeline.
|
| That's a nice little detail, I haven't seen that before
| AnimalMuppet wrote:
| Can you (or archmaster) explain it? I'm not sure I understand
| what it's for.
| SushiHippie wrote:
| When you scroll to the bottom while reading text you always
| only need to look in the middle of the screen when it's
| padded. Otherwise at the end of the page you would need to
| look at the bottom of the screen
| archmaster wrote:
| When many people read an article on the web, they keep
| their eyes in one small vertical area on the page and
| scroll to shift the text (rather than reading the whole
| visible area and then scrolling to the next "page").
| However, when you reach the end of the scroll area, you're
| suddenly forced to move your eyeline down the page. Adding
| a bunch of space adds means you can keep scrolling the text
| to be underneath your eye-area. (sorry for the crufty
| explanation lol, it's kinda hard to visualize)
| pjaoko wrote:
| You've put in some good, hard work there, congrats.
|
| I'm thinking I'd have to have some very fine scrolling
| skills, and sit exactly still to keep my eyes constantly
| on one small vertical area of the page. And I'd rather
| dart and exercise my eyeballs than my scrolling finger :)
| danparsonson wrote:
| Your care and attention to detail are rare things in my
| experience, and will stand you in good stead in your
| future career. The effort and love you've put into this
| project really shine through!
| matteason wrote:
| It means that you can keep your eyeline focussed on the
| middle of the viewport (or the top, or wherever's natural
| for you) as you scroll new content into view. On a regular
| page, once your scrollbar reaches the bottom you have to
| start reading down the viewport because there's no more
| space to scroll. I don't know how much practical difference
| it would actually make to readability - would be
| interesting to measure - but I thought it was neat
| nrabulinski wrote:
| As someone who has worked a bunch with debugging Linux itself,
| debugging qemu, and vulnerabilities in kernel and userspace, I
| really struggle to appreciate stuff like this because my initial
| reaction is "well, duh, of course that's how it works" but
| looking back at myself getting into those fields I really applaud
| you and thank you for creating this great content
| beders wrote:
| I like that Gen-Z. Back to the basics! Listening to 80s music! Go
| younglings, go!
| ggambetta wrote:
| 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
| of fun :)
| ericmcer wrote:
| 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.
| Bedon292 wrote:
| Or write an operating system. I remember, a long time ago,
| starting to work through a book (Operating System Concepts) and
| covering a lot of similar topics. So this reminded me about it.
| Although I only remembered the dinosaurs on the cover and had
| to look up the name.
| racl101 wrote:
| > These days 17 year olds can get away with "programming" by
| gluing things they don't understand,
|
| That was me 10 years ago as 30 year old dev just breaking in.
| Some things never change.
| bdavbdav wrote:
| I got away with this for a long time then realised it was
| probably better to manage people who really understand what
| they're doing, while having a really good feel for what is
| technically possible, but not necessarily the best on the finer
| implementation points.
| doublepg23 wrote:
| I'm certainly wondering when this fad of high-level languages
| like C goes away.
| Swizec wrote:
| > These days 17 year olds can get away with "programming" by
| gluing things they don't understand
|
| 17 to 21-ish is probably my least gluey era of programming. I
| wrote an MVC framework from scratch, built my own interpreter,
| my own compiler, accidentally tried to reinvent machine
| learning and NLP from scratch, all sorts of cool and wonderful
| things.
|
| Then I discovered money and prior art. Wow you can build things
| so much faster if you let others tell you "here, just use
| this"! And frameworks!! Omg jquery makes life so much easier
| this is amazing.
|
| Many years later now, the stuff that used to count as "just
| gluing things together" is now considered "super low level
| advanced stuff". We've built new abstractions on top of those
| abstractions.
|
| The stuff beginners "can get away with" now, that's the next
| generation's super low level here be dragons stuff. Programming
| is great that way.
| tornato7 wrote:
| Programming was more fun before I learned how to import
| libraries. So many things I wrote from scratch... JSON
| parsers, distributed K/V stores, optimization algorithms, UI
| frameworks etc. From 17-21 nobody expected me to be Uber-
| productive so I just kind of went off and coded these things
| from scratch for months at a time. Good times.
| onion2k wrote:
| _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.
| glial wrote:
| Meh. A nicer way to say "gluing things together" is
| "reasoning with abstractions." There's detail all the way
| down, but you don't need most of it and can't remember all of
| it. The key is just knowing when to dip down and when to
| float on top -- screw that up and you run into trouble.
| Gehinnn wrote:
| I think there are different ceilings. And probably everyone
| has some spaces where they didn't reach their ceiling yet.
| ggambetta wrote:
| 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.
| ethbr0 wrote:
| In my experience, it's an unknown-unknown problem (don't
| know what we don't know).
|
| Is it important you can recite cache eviction algorithms
| from memory? No.
|
| Is it important you know there are such things as caches
| and roughly how they work? Yes. Because then you can
| quickly look up the details when/if you need them.
| wizzwizz4 wrote:
| Is it important that you understand cache eviction
| algorithms well enough that you can look at a description
| of an algorithm and see how it applies to your system?
| Yes. And if memorising is the way you gain that ability,
| then memorising is what you need to do.
|
| And what is it important for? Why, for making sure that
| your software makes efficient use of system resources.
| This is _essential_ if you 're writing application
| software that's used by other people - but if you're
| writing server-side code, or some one-a-month business-
| logic data-processing scripts, or code that's only ever
| going to run on five specific machines, it's not that big
| of a deal. I haven't needed this skill yet.
| sverhagen wrote:
| > I'm not sure it's always obvious to ourselves when we
| have.
|
| Agreed. Some people would have to change employers in order
| to break through the ceiling, or to even see how they're
| limiting themselves. And for some of them: why would they?
| freedomben wrote:
| 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.
| needlesslygrim wrote:
| As a fellow (very nearly) 17 year old, good job! :^) Just 20
| minutes ago I was trying to figure out how to extract the first
| byte of a 16 bit integer and finding out about Endianness, and
| you're writing a whole book about CPUs! I'll make sure to read
| this once I've finished Crafting Interpreters, although it may
| take a while since progress with that has certainly slowed down
| (as it does with many of my other projects lol).
| rvz wrote:
| Fantastic work by the author. The best part:
|
| > I talked to GPT-3.5 and GPT-4 a decent amount while writing
| this article. While they lied to me a lot and most of the
| information was useless, they were sometimes very helpful for
| working through problems. LLM assistance can be net positive if
| you're aware of their limitations and are extremely skeptical of
| everything they say. That said, they're terrible at writing.
| Don't let them write for you.
|
| Good. Thank you for disclosing this.
|
| Great to know that even teenagers like the author know the limits
| of LLMs and know where and when to use them and haven't fallen
| into the hype and mania in blindly trusting them, unlike the
| millions of so-called new wave of _' AI startups'_ out there.
|
| Once again, fantastic work and keep it up.
| not_the_fda wrote:
| This is really great. There are many developers with decades of
| experience that don't understand these things.
| racl101 wrote:
| Count me in.
| t0b1 wrote:
| That's a very nice writeup, I like the style. The mix of text to
| illustrations/memes was really pleasent. I have my reservations
| about the RISC/CISC nomenclature but I guess that's ,,each to
| their own" >.>
|
| As someone who has spent some time figuring out how parts of the
| kernels work I can sympathize with the pain it probably was (but
| well worth it given the article imo).
|
| For NT, I think that Windows Internals covers a lot about the
| stuff one wants to know and Microsoft's documentation is also not
| bad (certainly better than Linux's kernel docs imo); it's a
| really good starting point.
|
| For more info about Windows I can recommend gamehacking
| forums/resources. There's a lot of filtering needed but they are
| a pretty good source of info for niche things sometimes.
|
| As a last note, I noticed that the font of some code blocks are
| pretty large when viewed on my smartphone making them hard to
| read (e.g. Ch. 6/main.c)
|
| P.S.: > If you are a teenager and you like computers and you are
| not already in the Hack Club Slack, you should join right now
|
| Way too remind me that I'm getting old lol
| charcircuit wrote:
| This site doesn't explain how CPUs run programs. It only
| explained the instructions that CPUs will run and some
| abstractions on top of that, but not how CPUs typically run those
| instructions.
| js2 wrote:
| 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/
| archmaster wrote:
| Thank you! Looks hardware-y and very interesting, I may well
| read through it at some point.
| grimgrin wrote:
| 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_.
| ..
| js2 wrote:
| Indeed. It starts from first principles, assuming the reader
| doesn't know anything about computers or even electronics.
| The final chapters are about coding.
|
| Your guide could actually serve as an addendum to the book.
| Based on the title of your guide, I was expecting something
| more like _Code_ , but now having read your guide, it's more
| of an introduction to operating systems with a particular
| focus on Linux and the CPU/memory aspects. Well done.
| fossuser wrote:
| I'll +1 this too - it's very good and he's a good teacher,
| it's enjoyable to read.
| unethical_ban wrote:
| Yes! I was reminded of this book looking at the website.
|
| I bought it 15 years ago and my eyes glossed over the CPU arch
| section, but maybe I am ready now. I bought 2e recently.
| bmitc wrote:
| 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/
| joshvm wrote:
| While these are great projects, they're for very different
| audiences. Code is a really well written pop-science book
| that goes into logic circuits. The Nand2Tetris book comments
| for example that:
|
| > The HDL that we will use is documented in appendix 2 and
| can be learned in about one hour
|
| which about as meaningful as saying you can learn X's syntax
| in an hour. Nand2tetris is a serious investment of time and
| if you've never done something like FPGA design (VHDL etc) or
| assembly, it takes a bit of getting your head around.
|
| It's also worth mentioning Shenzhen IO as an interesting take
| on this (edutainment for programmers)
| https://www.zachtronics.com/shenzhen-io/
| bfay1 wrote:
| I was about halfway through chapter 3 and thought to myself, "I
| haven't listened to In the End by Linkin Park in a while, let's
| spin that up". my reaction when I scrolled down ten seconds
| later...XD
| fredfoobar wrote:
| Where did you hear Linkin Park?
| firebirdn99 wrote:
| There's a teens react to LP video on YT. It's refreshing. It's
| how previous generations discovered older music. Also the one
| on Blink 182...is like, "my Mom loves that song"...so a lot of
| times that's how.
| Dwedit wrote:
| Then there's the OTHER side, Flipflops, MUXes, ALUs, register
| files, combinational logic, yadda yadda, then you have your CPU.
| lordnacho wrote:
| What's your advice on how to teach programming to my kid? Curious
| to hear what another young person thinks. Kid is 11, has all the
| basics, knows how to type, knows how to open a terminal.
|
| What things did you think were important to learn, what kinds of
| things motivated you most? What did you do when you got stuck?
| freedomben wrote:
| IME the key is to give them a problem they are excited about,
| and have them solve it. Much easier said than done :-)
| archmaster wrote:
| I taught myself everything -- my parents are not technical and
| sorta disliked computers (which I'm sure helped motivate me
| lol).
|
| So what helped me most was just experimenting a lot, banging my
| head against a wall repeatedly. When I got stuck I just had to
| keep trying. Knowing I could Google problems was really
| helpful, but I also had to learn how to Google. I was motivated
| by the amazing feeling of finishing something I built, and also
| the fun of learning and then applying that knowledge.
|
| It's hard to remember my tiny self so I wish I could give
| better advice. I most of all wish that I had a mentor figure,
| someone I could ask for questions or who could show me where to
| look, or even just be a role model. Getting into open source
| and talking to people online was amazing, although I didn't
| start that until I was ~12.
|
| It took me a really long time to get where I am. There are
| probably more efficient ways to do so other than banging my
| head against things. But it does work! So just encourage them
| to keep going, and MOST IMPORTANTLY, FOLLOW THEIR INTERESTS!
| ethbr0 wrote:
| Not author, but I've always wanted to approach programming from
| an algorithms-first perspective with younger kids. Not called
| algorithms, of course.
|
| If they can create/combine algorithms to solve a problem...
| that's most of programming.
|
| I'd start with the "robot" problem: have them write a set of
| steps to complete a simple task, and then have them (or better,
| someone else) go through the steps _precisely_ (no cheating and
| assuming they meant something they didn 't write!). Then
| iterate and add/remove steps until the task is actually doable.
| (Disclaimer: idea cribbed from someone else)
|
| That gets them to grok the "everything needs to be in a
| program, and a program is only everything that's in it" idea.
|
| The traveling salesman problem (recast in whatever form would
| be most interesting to the kids) and graph theory problems are
| also especially visual and explorable.
| archmaster wrote:
| Interesting! I've always been most interested in conveying
| information to people -- human-computer interactions,
| interface and app design, educational writing like this
| article. Before I got into programming I was OBSESSED with
| this amazing circuit-building thing called Snap Circuits as a
| kid (highly recommend, definitely get a starter set for your
| kid if you haven't already), but even with that I just wanted
| to build fun systems -- intercoms, doorbells, security
| systems, robots. From that I did more advanced electronics
| stuff with Arduino, and that's how I got introduced to real
| programming.
| ethbr0 wrote:
| Snap Circuits looks awesome! LEGO + breadboarding
|
| To date myself, for me it was the computer game _The
| Incredible Machine_ , which was a Rube Goldberg physics
| puzzle game... in 1993 on DOS. ;)
|
| Critically, the failure-iteration loop was tight, which
| really impressed "if at first you don't succeed, try try
| again" on my younger self.
|
| https://m.youtube.com/watch?v=pTbSMKGQ_rU&t=27s
| camdenlock wrote:
| [flagged]
| globular-toast wrote:
| Facts. What I wonder is if everyone else wants to believe or
| really just doesn't care. For some reason, I really hate being
| lied to.
| sethrin wrote:
| The author uses the pronouns "she/her".
| yakkomajuri wrote:
| This is awesome, and so is your website. Programming, writing,
| flying, music, that 's wild. Congrats!
| yakkomajuri wrote:
| Note, in response to the title, that I don't mean "awesome for
| a 17yo", I mean awesome, period.
| vpastore wrote:
| [dead]
| linux2647 wrote:
| > The envp argument contains another null-terminated list of
| environment variables used as context for the application.
| They're... conventionally KEY=VALUE pairs. Conventionally.
|
| TIL! It seems a lot of (newer) programming languages make this
| assumption.
|
| > ...I love computers.
|
| Me too, kid. Me too.
| yveezy wrote:
| Yo this is fantastic! Keep doing work like this :-)
___________________________________________________________________
(page generated 2023-08-09 23:01 UTC)