0478 Computer Science
Chpater 1 Number System
1.1 Number systems
1.2 Text, sound and images
1.3 Data storage and compression
Chapter 2 Data transmission
2.1 Types and methods of data transmission
2.2 Methods of error detection
2.3 Encryption
Chapter 3 Hardware
3.1 Computer architecture
3.2 Input and output devices
3.3 Data storage
3.4 Network hardware
Chapter 4 Software
4.1 Types of software and interrupts
4.2 Types of programming language, translators and integrated development environments (IDEs)
Chapter 5 The internet and its uses
5.1 The internet and the World Wide Web (WWW)
5.2 Digital currency
5.3 Cyber security
Chapter 6 Automated and emerging technologies
6.1 Automated systems
6.2 Robotics
6.3 Artificial intelligence (AI)
Chapter 7 Algorithm design and problem solving
7.1 The program development life cycle
7.2 Computer systems, sub-systems anddecomposition
未命名
未命名
Chapter 8 Programming
8.1 Programming concepts
8.2 Arrays
Mr. Theo
-
+
首页
4.2 Types of programming language, translators and integrated development environments (IDEs)
# Types of programming language ## High-level language - Makes use of words // close to human language - Machine independent // portable - Problem / logic focussed - Needs to be translated/interpreter/compiled (to low-level for processing bycomputer) // needs converting to machine code ## Low-level language - May use mnemonics助记符 - Have direct access to memory locations/registers - Closer to machine code - Machine dependent # Translators - compiler - interpreter - assembler | | compiler | interpreter | | ----------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------- | | similarity | Both translate high level / source code to machine code | | | | They both report/check for errors | | | differences | translates the whole code at the same time (before executing it) | translates the code line by line and executes each line immediately, | | | produces an executable file | does not | | | not | is required to run the code each time if used | | | creates a report of all errors at the end of translation | stops and reports an error as it is encountered, correct errors in real-time | | | will not run the code at all if an error is found | will run code up to the point it finds an error | ### How a compiler translates - Translates high-level language into machine code/low level language - Translates (the source code) all in one go/all at once - Produces an executable file - Produces an error report ### How an interpreter translates - Translates high-level language into machine code/low level language - Translates (the source code) line by line/statement by statement - Stops if it finds an error - Will only continue when error is fixed ## Reason to use compiler to publish software: - Creates an executable file - … so, would not release source code - … so, the source code cannot be stolen/edited. - … so, would not need to be translated every time // so, translator is not required - … making it machine independent - Does not require recompilation // compiled program can be executed without a compiler therefore, allows faster execution - Provides an executable file therefore, allows him to just send machine code - Dimitri’s friend does not need translation/compilation software to execute the program interpreter Development // when writing the program // when debugging - … easier to debug - …stops when an error is detected - …reports one error at a time - …can correct errors in run-time // correct the line and then continue running from that point - …can test one section without the rest of the code being completed compiler After completion // For distribution // For final/repeated testing After completion - It creates an executable file - …than can be distributed without source code - …so that other people cannot edit/view the code - …so end users do not need translator software // so end users do not need to compile/interpret each time - …so it is machine/platform independent (usually) In final testing - It creates an executable file - …do not need to retranslate for each test sequence - …can test repeatedly with different data faster Compiler • Checks all code **before** executing any code • Produces error report with all errors found for the whole code (before translating/running any of the code) • Produces executable file It translates the (high-level language) to low-level language/object code/machine code It translates all the code before it is executed It creates an executable file It creates an error report after trying to compile … displaying all errors in the code … that require correction before execution can take place Interpreter • Checks/translates one line of code **and then** executes it before moving on to the next line • Stops when an error is found • … when corrected the program can be run from the same position // allows error correction in real time High-level • Easier for programmer to read/write/understand/edit • … therefore, the programmer is less likely to make mistakes // can write in shorter timeframe • Easier to **debug** // Easier to find/correct **errors** • …so, the programmer can find and correct errors in less time • Game will be machine independent // Game will be portable (between hardware) • …the game can be used on any computer without a need for understanding of the hardware / compilation for that hardware • Programmer can focus on the problem instead of the manipulation of memory/hardware Low-level • More **memory/RAM** efficient • … 3D graphics will have high memory consumption anyway • Allows direct manipulation of memory • … allows for more efficient control/response time • Allows for use of specialised hardware high-level language - Makes use of words // close to human language - Machine independent // portable - Problem / logic focussed - Needs to be translated/interpreter/compiled (to low-level for processing bycomputer) // needs converting to machine code Benifits - Easier to understand // Don’t know assembly code - Easier to debug - Easier to maintain - Portable - Knowledge of manipulating memory locations/registers not required - Can use an IDE - Greater range of languages Closer to/is machine code May use mnemonics May need an assembler to be translated One line of code represents a single instruction Machine dependent Have direct access to memory locations/registers examples - Assembly code - Machine code Drawback - It is more difficult to understand - Error prone - Have to manipulate memory locations - Machine dependent #### Why a programmer would make use of both an interpreter and a compiler - To translate the high-level language into low-level language - Interpreter used whilst writing the program - Interpreter used to debug code line by line - Compiler used when program completed - Compiler used to create separate executable file (so compiler no longer needed) - If it runs first time in a compiler there are no syntax errors IDE - It is a piece of software - … that has an editor where code can be entered / amended - It has features that can help the programmer write the code - … such as auto-completion // any suitable example Functions - Code editors - Run-time environment - Built-in interpreter - Error diagnostics - Auto-completion - Auto-correction - Prettyprint
Theo
2025年9月25日 15:34
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
Markdown文件
Word文件
PDF文档
PDF文档(打印)
分享
链接
类型
密码
更新密码
有效期