Computer Languages & its genearations.pptx

RituSachdeva 22 views 20 slides Oct 14, 2024
Slide 1
Slide 1 of 20
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20

About This Presentation

The presentation is about computer languages & its generation. It also differentiates between compiler and interpreter.


Slide Content

Computer Languages & Programming Methodologies Presented by Dr Ritu Sachdeva Assistant Professor, MRIIRS

Natural Languages These include the language that people speak in their daily lives These can include: English Spanish German French Italian The idea is to use one’s natural language to give the computer orders This has only limited use today

Computer Languages A Way to Talk to a Computer!

Computer Languages The languages which are used to communicate with a computer are called computer languages. 

Definition of a Computer Language A computer language is a group of instructions that are used to create computer programs. The main goal is to achieve human-computer interaction. 

Generations of computer Languages Machine Language Assembly Language C, C++, Java, Java Script, Python, C # PHP Perl, Python , Ruby, SQL , MatLab Mercury, OPS5, Prolog

Low level Language The first two generations are called low-level languages. A Low-level computer language includes only 1’s and 0’s. This language was used in first and second generation computers. A Low level language is very easily understood by a computer but hard to understand for Humans.  Low level languages are designed to interact with computer hardware, which are categorized into two types: Machine level language and Assembly level language.

Machine Level Language Being a low level language, this language is a first-level of generations. Machine language is considered to be the oldest computer language. Machine language is developed by only using binary numbers i.e., 0 and 1. So, the instructions or the statements in this language use a sequence of 0’s and 1’s.

Assembly Language Assembly level language in computer programming has evolved with the advancements in the machine language. Assembly language uses symbols, which are popularly known as mnemonics in computer terminology to write the instructions. So, comparatively writing a program in Assembly language is more understandable to the Human than Machine Language . Being a low level language, this language belongs to the second level languages The Assembly language code will be converted into a Machine language code with the help of an Assembler so that the computer can understand the binary converted Assembly Language. 

High Level Language High Level computer languages are the advanced development languages in the evolution of computer languages. These languages are designed to make the programming easier and less error-free . The rest of the generations i.e. third, fourth and fifth generations belong to the high level language High level language uses words and commands along with symbols and numbers.   The keywords used in High level languages are similar to English words and can be easily understood by Humans when compared to a Low level language. 

High-Level Languages Developed to improve programmer efficiency from symbolic languages & to change focus from the computer to the problem being solved They’re portable to different computers They still need to be converted to machine languages in a process called compilation Examples include: BASIC COBOL Pascal Ada C

Fourth Generation Languages : These are languages that consist of statements that are similar to statements in the human language. These are used mainly in database programming and scripting. Examples of these languages include Perl, Python, Ruby, SQL, and MatLab ( MatrixLaboratory ). Fifth Generation Languages : These are the programming languages that have visual tools to develop a program. Examples of fifth-generation languages include Mercury, OPS5, and Prolog.  

Why study programming languages? Become a better software engineer Understand how to use language features Appreciate implementation issues Better background for language selection Familiar with range of languages Understand issues / advantages / disadvantages Better able to learn languages You might need to know a lot Better understanding of implementation issues How is “this feature” implemented? Why does “this part” run so slowly? Better able to design languages Those who ignore history are bound to repeat it…

Compiler VS Interpreter

Why are there so many programming languages? Easy to use Especially for teaching / learning tasks Ease of implementation Easy to write a compiler / interpreter for Good compilers Fortran in the 50’s and 60’s Economics, patronage Cobol and Ada, for example

Building a Program Writing and Editing Programs: Use a text Editor to write programs When you’re done you save your program to the disk (known as a source file ) and it will be input to the compiler Compiling Programs: Translates inf in a source file into machine language Made of 2 separate programs: the preprocessor & the translator Preprocessor : reads the source code and prepares it for the translator. While preparing the code it scans for special commands ( preprocessor directives ) that tell it to look for special code libraries, make substitution in the code, & other ways to prepare the code for translation into machine language. The result of this processing is called the translation unit . Translator : converts the translation unit into machine language. This code in machine language is called the object module Linking Programs: A high-level language has many subprograms , some of which are written in the program & some exist elsewhere and have to be attached to the program (ex: I/O processes) The linker assembles all of these functions into the final executable function.

Program Execution Use the Operating System (OS) command (ex.: run) to load the program into primary memory & execute it. Loader : it is an OS program responsible for loading the program into the memory Program reads data for processing either from the user or from a file After the program processes the data it prepares the output to either the monitor or to a file When the program is finished it tells the OS, which removes the program from memory

Debug VS Error