Answers.Body: <p>I am a retired software engineer with a CS degree who participated in the development of both hardware and software at various Silicon Valley companies. I have owned multiple editions of TAOCP over four decades, starting with when I was an undergrad.</p>
  <p>TAOCP is special in that it offers enormous depth in addition to considerable breadth, and it is basically free of errors. It is a reliable <em>reference</em> that provides an authoritative and comprehensive overview of the state of the art at the time of publication. It is therefore an excellent starting point for one's own research, even more so because it also provides a plethora of references to original publications. There are probably some people who utilize TAOCP in the manner of a text book, but this is not something I could recommend. From a didactic standpoint I have always considered the reliance on MIX a sub-optimal choice, but I can understand Knuth's motivation for choosing that path.</p>
  <p>I have programmed professionally in various assembly languages (Z80, x86, SPARC, ARM) and do not see their utility in the area of memory management, unless we have different ideas of what that entails. Knowledge of assembly languages is useful in performance-focused software work, such as high-performance libraries and optimizing compiler code generation. It can also be useful when interfacing directly with computer hardware, for example in driver software or embedded products. In addition, such knowledge is helpful when designing or extending an instruction set architecture as part of processor designs such as RISC-V.</p>
  <p>The most widely-used assembly languages are currently those for x86-64 and ARM processors in both 32-bit and 64-bit incarnations. Going by my own experience, these are probably best learned from studying relevant open source projects and inspecting compiler-generated code with the vendor documentation in hand, complemented by hands-on experimentation. This latter part I consider essential. Being familiar with MIX from TAOCP does not really add value. In addition to the utilitarian benefits enumerated above, having knowledge of assembly-language programming enhances one's overall understanding (mental model) of how high-level software constructs ultimately are mapped to the underlying processor hardware. In that sense one could claim that it makes one a better programmer or software engineer overall.</p>
  <p>While knowledge of assembly-language programming was a bit of a necessity in the early days of computing (the first computer I worked with sported a 2 <strong>MHz</strong> processor and a whopping 16 <strong>KB</strong> of system memory), the importance of such knowledge has decreased over time. For example, the last performance libraries I worked on before retiring were written entirely in a subset of C++. You may discover that in addition to some  practical benefits there is also a certain <em>fun</em> aspect to assembly-language programming, but I suspect that is very much a matter of individual tastes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-08T14:56:33.137Z
Answers.Text: Thank you for your time. Here is my roadmap for now : learn about computer architecture and how it works completely(basically how to make a computer from scratch) -> learn mmix -> and then selectively study from taocp to better understand topics as need arises. Also I have been studying concrete maths because as far as i have heard it's mathematical preliminary for studying taocp. Is this approach correct or does it require some changes?
Answers.UserDisplayName: gunslinger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-08T19:22:48.043Z
Answers.Text: @gunslinger I don't think there is *the* right approach, it depends on your interests. My approach to self learning and private research generally has been driven by curiosity. Already as a young child I was fascinated by numbers and to this day I am most passionate about all kinds of numerical computation. I also enjoy making things go fast, so I have focused on anything from algorithmic optimizations to low-level assembly language tweaking.
Answers.UserDisplayName: njuffa
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-07T11:39:48.420Z
Answers.LastActivityDate: 2023-10-07T11:39:48.420Z
Answers.UserDisplayName: njuffa
Answers.Body: <p>The Art of Computer Programming is commonly known to be a hard read and  demanding to study fully. Very few have actually done so. Many just use it as a reference to occasionally get a deep understanding of a specific subject, for example a sorting algorithm. That said, it's a very thorough work of extremely high quality.
  Knuth chose a very-close-to-the-machine language because he wanted to give algorithm examples free from ambiguities as is often the case using higher level languages, if you don't know them fully.
  If your primary aim is to learn assembly language and accompanying hardware functionality, you are probably better off going elsewhere. Take a look at
  <em>Code: The Hidden Language of Computer Hardware and Software</em>
  by Charles Petzold
  or
  <em>The Elements of Computing Systems: Building a Modern Computer from First Principles</em>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-08T14:58:24.000Z
Answers.Text: thank you. "The Elements of Computing Systems: Building a Modern Computer from First Principles." looks like a good resource to gain deeper understanding about how computers actually works.
Answers.UserDisplayName: gunslinger
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-06T19:55:17.020Z
Answers.LastActivityDate: 2023-10-06T20:39:37.263Z
Answers.LastEditDate: 2023-10-06T20:39:37.263Z
Answers.UserDisplayName: jonsen
Body: <p>I am a cse undergrad currently in my second year
  I know C,C++ and Python.
  and have basic understanding of datastructures and algos
  and I am currently reading concrete maths to better understand Taocp by knuth.</p>
  <p>I want to start with assembly because I want to understand Memory management and
  I have heard it makes you better at writing programs in general.</p>
  <p>I am a bit confused where to start and what resources to learn from.
  I aim to read and understand Taocp
  and from what I have learned so far the book uses mix and mmix assembly which are hypothetical languages used only in book.</p>
  <p>should I learn mix and continue taocp or should I learn other assembly languages and come back to taocp when I will have better understanding of programming overall.</p>
  <p>so far what I have learned is there are different assembly for different architectures of cpu. which one will be better suited for me and will learning one assembly give me overall idea and make learning other assembly relatively easy? or other assembly are completely different on their own and will take same amount of efforts?</p>
  <p>and Is learning from Taocp a realistic goal for me? will it do me any good to try to learn from it with my current knowledge? should I continue to read it, or stop and come back later and if yes when?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-12T07:53:22.400Z
Comments.Text: "Memory management" is an extremely general & broad concept that encompasses many cases that are both similar & different. So like many topics if you "want to understand" you are better off beginning with reading multiple introductory textbook presentations & posting a question giving your specific goals & viewpoint. For hands-on experience you need something executable which means specifically not MIX & ideally the language from some presentation/reference that "manages" "memory" at the level you are interested in.
Comments.UserDisplayName: philipxy
Tags: <self-learning><assembly>
Title: Learning Assembly and Taocp
ThreadText: # Learning Assembly and Taocp
  
  (Asked by: username_0 on 2023-10-05)
  
  I am a cse undergrad currently in my second year
  I know C,C++ and Python.
  and have basic understanding of datastructures and algos
  and I am currently reading concrete maths to better understand Taocp by knuth.
  
  I want to start with assembly because I want to understand Memory management and
  I have heard it makes you better at writing programs in general.
  
  I am a bit confused where to start and what resources to learn from.
  I aim to read and understand Taocp
  and from what I have learned so far the book uses mix and mmix assembly which are hypothetical languages used only in book.
  
  should I learn mix and continue taocp or should I learn other assembly languages and come back to taocp when I will have better understanding of programming overall.
  
  so far what I have learned is there are different assembly for different architectures of cpu. which one will be better suited for me and will learning one assembly give me overall idea and make learning other assembly relatively easy? or other assembly are completely different on their own and will take same amount of efforts?
  
  and Is learning from Taocp a realistic goal for me? will it do me any good to try to learn from it with my current knowledge? should I continue to read it, or stop and come back later and if yes when?
  
  **Tags:** self-learning, assembly
  
  > **Comments:**
  > **username_1**: "Memory management" is an extremely general & broad concept that encompasses many cases that are both similar & different. So like many topics if you "want to understand" you are better off beginning with reading multiple introductory textbook presentations & posting a question giving your specific goals & viewpoint. For hands-on experience you need something executable which means specifically not MIX & ideally the language from some presentation/reference that "manages" "memory" at the level you are interested in.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2023-10-06. Score: 3 | Accepted answer
  
  The Art of Computer Programming is commonly known to be a hard read and demanding to study fully. Very few have actually done so. Many just use it as a reference to occasionally get a deep understanding of a specific subject, for example a sorting algorithm. That said, it's a very thorough work of extremely high quality.
  Knuth chose a very-close-to-the-machine language because he wanted to give algorithm examples free from ambiguities as is often the case using higher level languages, if you don't know them fully.
  If your primary aim is to learn assembly language and accompanying hardware functionality, you are probably better off going elsewhere. Take a look at
  *Code: The Hidden Language of Computer Hardware and Software*
  by Charles Petzold
  or
  *The Elements of Computing Systems: Building a Modern Computer from First Principles*.
  
  > **Comments:**
  > **username_0**: thank you. "The Elements of Computing Systems: Building a Modern Computer from First Principles." looks like a good resource to gain deeper understanding about how computers actually works.  
  
  ---
  
  ### Answer by username_2 on 2023-10-07. Score: 2
  
  I am a retired software engineer with a CS degree who participated in the development of both hardware and software at various Silicon Valley companies. I have owned multiple editions of TAOCP over four decades, starting with when I was an undergrad.
  
  TAOCP is special in that it offers enormous depth in addition to considerable breadth, and it is basically free of errors. It is a reliable *reference* that provides an authoritative and comprehensive overview of the state of the art at the time of publication. It is therefore an excellent starting point for one's own research, even more so because it also provides a plethora of references to original publications. There are probably some people who utilize TAOCP in the manner of a text book, but this is not something I could recommend. From a didactic standpoint I have always considered the reliance on MIX a sub-optimal choice, but I can understand Knuth's motivation for choosing that path.
  
  I have programmed professionally in various assembly languages (Z80, x86, SPARC, ARM) and do not see their utility in the area of memory management, unless we have different ideas of what that entails. Knowledge of assembly languages is useful in performance-focused software work, such as high-performance libraries and optimizing compiler code generation. It can also be useful when interfacing directly with computer hardware, for example in driver software or embedded products. In addition, such knowledge is helpful when designing or extending an instruction set architecture as part of processor designs such as RISC-V.
  
  The most widely-used assembly languages are currently those for x86-64 and ARM processors in both 32-bit and 64-bit incarnations. Going by my own experience, these are probably best learned from studying relevant open source projects and inspecting compiler-generated code with the vendor documentation in hand, complemented by hands-on experimentation. This latter part I consider essential. Being familiar with MIX from TAOCP does not really add value. In addition to the utilitarian benefits enumerated above, having knowledge of assembly-language programming enhances one's overall understanding (mental model) of how high-level software constructs ultimately are mapped to the underlying processor hardware. In that sense one could claim that it makes one a better programmer or software engineer overall.
  
  While knowledge of assembly-language programming was a bit of a necessity in the early days of computing (the first computer I worked with sported a 2 **MHz** processor and a whopping 16 **KB** of system memory), the importance of such knowledge has decreased over time. For example, the last performance libraries I worked on before retiring were written entirely in a subset of C++. You may discover that in addition to some practical benefits there is also a certain *fun* aspect to assembly-language programming, but I suspect that is very much a matter of individual tastes.
  
  > **Comments:**
  > **username_0**: Thank you for your time. Here is my roadmap for now : learn about computer architecture and how it works completely(basically how to make a computer from scratch) -> learn mmix -> and then selectively study from taocp to better understand topics as need arises. Also I have been studying concrete maths because as far as i have heard it's mathematical preliminary for studying taocp. Is this approach correct or does it require some changes?  
  > **username_2**: @username_0 I don't think there is *the* right approach, it depends on your interests. My approach to self learning and private research generally has been driven by curiosity. Already as a young child I was fascinated by numbers and to this day I am most passionate about all kinds of numerical computation. I also enjoy making things go fast, so I have focused on anything from algorithmic optimizations to low-level assembly language tweaking.  
  
  ---
  
  