Re: Chapter 1 Complete!
Posted by
WBahn on
Jan 07, 2023; 9:55pm
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Chapter-1-Complete-tp4037022p4037031.html
a1ph4byte wrote
You, know, I graduated with my CS a little over a decade ago, but going back to the fundamentals is so worthwhile. It kinda broke my brain that someone on Reddit asked... why, if I had been in cyber security for 20 years, I would need to bother with completing this book. I'm kinda blown away at the lack of their understanding of how broad the career field is and how far a given specialty can take you away from the basics.
Very true.
When I was first introduce to this course (i.e., when I learned that I would be teaching it a couple weeks before the beginning of the semester) I made it through the first five chapters in an hour and a half and had the sixth done an hour after that. But my background lent itself to the hardware aspects. Even so, when I did the adder I thought I saw a fatal flaw because it had no carry-in bit and how could you possibly do two's complement arithmetic without that? The solution was SO clever and, in figuring out exactly why it works, I learned a way to relate the arithmetic to the logic that had never occurred to me before and that I have used occasionally since.
The assembler was nothing, but the VM took quite a bit longer even though I was familiar with the notion of stack frames and how arguments and local variables are handled by functions. But actually implementing the full details really cemented it in place -- and seeing how it could be implemented on a processor that has absolutely zero support for it natively. Then the compiler again introduced the details to make stuff that I already "knew" much more solid -- plus seeing how it leveraged the VM implementation instead of generating native processor code directly really drove home the value of well-layered abstractions (even though that had been a pretty strong bedrock in my problem solving skills already). Implementing the OS was a LOT of fun. I especially liked having to do the implementation of the dynamic memory allocation -- that took all the mystery out of it (at least in its most simple version). Most people get a lot out of implementing the character map, but that was something that I had had to deal with on a smaller scale in implementing code to drive a custom LCD module from a brain-dead PIC microcontroller years ago. The graphics and math functions are also something that turn on a lot of people, but that I already had the relevant experience to do handily, though I still learned a few clever tricks.
While I can't stop saying enough about this course, I really want to see a Part II follow-on that focuses on the hardware that we don't see here, namely the keyboard driver, the display driver, some kind of external storage, and a basic terminal program akin to the old DOS/BIOS days. I know some people have done those things and they are things that are best done with actual hardware, which makes it a lot harder to design a course that had wide acceptance.
I'd also like to see a SuperHack processor that has some additional bells and whistles that would make it suitable for a compiler course that wants to get into things like register assignment and various optimization strategies. I don't think it would take much.