Changes

2 bytes added ,  02:31, April 28, 2021
m
Added link
Line 25: Line 25:  
| accessdate = 2012-03-27}}</ref>
 
| accessdate = 2012-03-27}}</ref>
   −
Computer users nowadays may not realise the severe technical constraints which applied to programming in the mid 1950's. Modern personal computers have the entire central processing unit on a single chip (integrated circuit), have main memories (RAM) containing many hundred of millions of bytes, and have processing speeds of several million instructions per second. The IBM 704 computer (fairly advanced for its time) had a central processor made up of many thousands of electronic valves (each the size of a light bulb), had a main memory of only four thousand 36-bit words, and had a processing speed of perhaps forty thousand instructions per second (modern mobile phones are more powerful than this).
+
Computer users nowadays may not realise the severe technical constraints which applied to programming in the mid 1950s. Modern personal computers have the entire central processing unit on a single chip (integrated circuit), have main memories (RAM) containing many hundred of millions of bytes, and have processing speeds of several million instructions per second. The IBM 704 computer (fairly advanced for its time) had a central processor made up of many thousands of electronic valves (each the size of a light bulb), had a main memory of only four thousand 36-bit words, and had a processing speed of perhaps forty thousand instructions per second (modern mobile phones are more powerful than this).
   −
Most compilers in the 1950's and 1960's were written in low-level assembly languages; there wasn't much choice at that time since the computer hardware wasn't capable of supporting compilers written in high-level languages. The use of high-level languages for writing compilers became more mainstream with the advent of Pascal in 1970<ref>{{Cite web  
+
Most compilers in the 1950s and 1960s were written in low-level assembly languages; there wasn't much choice at that time since the computer hardware wasn't capable of supporting compilers written in high-level languages. The use of high-level languages for writing compilers became more mainstream with the advent of Pascal in 1970<ref>{{Cite web  
 
| title = Pascal-P: The portable Pascal compiler  
 
| title = Pascal-P: The portable Pascal compiler  
 
| url = http://www.moorecad.com/standardpascal/PascalP.html  
 
| url = http://www.moorecad.com/standardpascal/PascalP.html  
Line 43: Line 43:     
==Outline of the compilation process==
 
==Outline of the compilation process==
−
In the freely available online book "Basics of Compiler Design"<ref>{{cite web
+
In the freely available online book "Basics of Compiler Design",<ref>{{cite web
 
| url = http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/
 
| url = http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/
 
| title = Basics of Compiler Design
 
| title = Basics of Compiler Design
 
| author = Torben Mogensen
 
| author = Torben Mogensen
−
| accessdate = 2012-03-19}}</ref>, Professor Torben Mogensen identifies seven phases within a compiler, with the various phases being performed in one or more passes over the program.  A diagram illustrating these (and other optional optimisation) phases is shown on the last page of Professor Frank Pfenning's "Lecture Notes on Compiler Design: Overview"<ref>{{cite web
+
| accessdate = 2012-03-19}}</ref> Professor Torben Mogensen identifies seven phases within a compiler, with the various phases being performed in one or more passes over the program.  A diagram illustrating these (and other optional optimisation) phases is shown on the last page of Professor Frank Pfenning's "Lecture Notes on Compiler Design: Overview"<ref>{{cite web
 
| url = http://www.cs.cmu.edu/~fp/courses/15411-f09/lectures/
 
| url = http://www.cs.cmu.edu/~fp/courses/15411-f09/lectures/
 
| format = pdf
 
| format = pdf
Line 89: Line 89:  
</ref> Some compilers can optionally generate extra code to check for many of these errors, and there are some software packages which can provide the same effect. Unfortunately this extra checking code can slow a program down by a factor of 10 or 20 times.
 
</ref> Some compilers can optionally generate extra code to check for many of these errors, and there are some software packages which can provide the same effect. Unfortunately this extra checking code can slow a program down by a factor of 10 or 20 times.
   −
Research is continuing on the problem of proving that a program is correct. This is an extremely difficult problem - it has been shown that proving whether or not a program actually stops is [[undecidable]]. Furthermore the proofs are often a lot longer than the programs being proved so there is the additional problem of checking that the proof itself is correct. Bruce Schneier reports <ref>
+
Research is continuing on the problem of proving that a program is correct. This is an extremely difficult problem - it has been shown that proving whether or not a program actually stops is [[undecidable]]. Furthermore, the proofs are often a lot longer than the programs being proved so there is the additional problem of checking that the proof itself is correct. Bruce Schneier reports <ref>
 
{{cite web
 
{{cite web
 
| url=http://www.schneier.com/blog/archives/2009/10/proving_a_compu.html
 
| url=http://www.schneier.com/blog/archives/2009/10/proving_a_compu.html
Line 105: Line 105:     
==Optimisation==
 
==Optimisation==
−
In a long-running calculation, the choice of a good algorithm is essential. Changing to a better algorithm can often provide much better performance gains than is possible with compiler optimisation.
+
In a long-running calculation, the choice of a good [[algorithm]] is essential. Changing to a better algorithm can often provide much better performance gains than is possible with compiler optimisation.
    
Programs often obey the 80-20 rule, where 20% of the code accounts for 80% of the CPU usage. Programmers usually do a poor job of guessing as to which 20% of the code is causing performance problems, so before doing any hand optimisation it is crucial to (use a tool to) measure the program performance and identify the hot spots.
 
Programs often obey the 80-20 rule, where 20% of the code accounts for 80% of the CPU usage. Programmers usually do a poor job of guessing as to which 20% of the code is causing performance problems, so before doing any hand optimisation it is crucial to (use a tool to) measure the program performance and identify the hot spots.
SkipCaptcha
293

edits