0% found this document useful (0 votes)
21 views

Print

Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
21 views

Print

Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 5
Program Languages What is a program? ‘A computer program is a series of instructions that tell a computer to perform an action. These programming instructions cause the computer to perform arithmetic and logical operations or comparisons. An application or software, is a set of instructions that process input, manipulate data, and output a result. For example, Microsoft Word is a word processing program that allows users to create and write documents. A browser, such as the one you are using to view this page, is a program. (ref -software topic) Programming language ‘As we know, to communicate with a person, we need a specific language, similarly to communicate with computers, programmers also need a language is called Programming language. What is a Programming Language? A programming language is a computer language that is used by programmers (developers) to communicate with computers. It is a set of instructions written in any specific language ( C, C++, Java, Python) to perform a specific task. A programming language is mainly used to develop desktop applications, websites, and mobile applications. Types of programming language 1. Low-level programming language Low-level language is machine-dependent (0s and 1s) programming language. The processor runs low- level programs directly without the need of a compiler or interpreter, so the programs written in low-level language can be run very fast. WOWIEVEIIaRGUAES are languages that si instruction set close to the computer's Low-level language is further divided into two parts - i. Machine Language Machine language is a type of low-level programming language. It is also called as machine code or object code. Machine language is easier to read because it is normally displayed in binary or hexadecimal form (base 16) form. It does not require a translator to convert the programs because computers directly understand the machine language programs. The advantage of machine language is that it helps the programmer to execute the programs faster than the high-level programming language ii, Assembly Language Assembly language (ASM) is also a type of low-level programming language that is designed for specific processors. It represents the set of instructions in a symbolic and human-understandable form. It uses an assembler to convert the assembly language to machine language. The advantage of assembly language is that it requires less memory and less execution time to execute a program. 2. High-level programming language High-level programming language (HLL) is designed for developing user-friendly software programs and websites. This programming language requires a compiler or interpreter to translate the program into machine language (execute the program) spoken and written language of the programmer. The main advantage of a high-level language is that itis easy to read, write, and maintain. High-level programming language includes Python, Java, JavaScript, PHP, C#, C++, Objective C, Cobol, Perl, Pascal, LISP, FORTRAN, and Swift programming language. A high-level language is further divided into three parts — i, Procedural Oriented programming language Procedural Oriented Programming (POP) language is derived from structured programming and based upon the procedure call concept. It divides a program into small procedures called routines or functions. Example: C, FORTRAN, Basic, Pascal, etc. ii. Object-Oriented Programming language Object-Oriented Programming (OOP) language is based upon the objects. In this programming language, programs are divided into small parts callled objects. It is used to implement real-world entities like inheritance, polymorphism, abstraction, etc in the program to makes the program resusable, efficient, and easy-to-use. The main advantage of object-oriented programming is that OOP is faster and easier to execute, maintain, modify, as well as debug Example: C++, Java, Python, Ci, etc. iii, Natural language Natural language is a part of human languages such as English, Russian, German, and Japanese. It is used by machines to understand, manipulate, and interpret human's language. It is used by developers to perform tasks such as translation, automatic summarization, Named Entity Recognition (NER), relationship extraction, and topic ‘segmentation The main advantage of natural language is that it helps users to ask questions in any subject and directly respond within seconds. Program Translators Translators are needed to translate programs written in high level languages into the machine code that a computer understands. Tools exist to help programmers develop error-free code. Any program written in a high level language is known as source code. However, computers cannot understand source code. Before it can be run, source code must first be translated into a form which a computer understands - this form is called object code. A translator is a program that converts source code into object code. Generally, there are three types of translator: ‘compilers interpreters assemblers Compilers ‘A compiler takes the source code as a whole and translates it into object code all in one go. (Once converted, the object code can be run unassisted at any time. This process is called compilation. Compilers have several advantages: Compiled programs run quickly, since they have already been translated, ‘A compiled program can be supplied as an executable file. An executable file is a file that is ready to run. Since an executable file cannot be easily modified, programmers prefer to supply executables rather than source code. Compilers optimise code. Optimised code can run quicker and take up less memory space. Compilers have several disadvantages: Because the source code is translated as a whole, there must be enough memory space to hold the source code, the compiler and the generated object code. There also needs to be temporary working space for the compiler to perform the translation. Modern systems either have enough memory or use virtual memory to hold all the data, Compilers do not usually spot errors - the program has to be compiled and run before errors are encountered. This makes it harder to see where the errors lie. The source code must be re-compiled every time the programmer changes the program. Source code compiled on one platform will not run on another - the object code is specific to the processor's architecture. Interpreters An interpreter translates source code into object code one instruction at a time. It is similar to a human translator translating what a person says into another language, sentence by sentence, as they speak. The resulting object code is then executed immediately. The process is called interpretation. Interpreters have several advantages: Instructions are executed as soon as they are translated. Since instructions are executed once translated, they are not stored for later use. As a result, interpreters require less available memory. Errors can be quickly spotted - once an error is found, the program stops running and the user is notified at which part of the program the interpretation has failed. This makes interpreters extremely useful when developing programs. Interpreters also have several disadvantages: Interpreted programs run more slowly as the processor has to wait for each instruction to be translated before it can be executed. Additionally, the program has to be translated every time it is run. Interpreters do not produce an executable file that can be distributed. As a result, the ‘source code program has to be supplied, and this could be modified without permission. Interpreters do not optimise code - the translated code is executed as it is Assemblers Assemblers are a third type of translator. The purpose of an assembler is to translate assembly language into object code, Whereas compilers and interpreters generate many machine code instructions for each high level instruction, assemblers create one machine code instruction for each assembly instruction

You might also like