Docsity

Evolution of Programming Languages: From Machine Language to High-Level Languages, Essays (university) of Programming Languages

Partial preview of the text

Download Evolution of Programming Languages: From Machine Language to High-Level Languages and more Essays (university) Programming Languages in PDF only on Docsity!

Programming

Languages

LECTURE 8

Objectives

Describe the evolution of programming languages from machine language to high-level languages. ❑ Understand how a program in a high-level language is translated into machine language using an interpreter or a compiler. ❑ Learn about computer language paradigms. ❑ Introducing Python programming and arithmetic expressions ❑

Introduction

Introduction  To write a program for a computer, we must use a computer language.  A computer language is a set of predefined words that are combined into a program according to predefined rules (syntax).  Over the years, computer languages have evolved from machine language to assembly languages to high-level languages.

Programming Languages

 Programming language: A set of rules, words, symbols,

and codes used to write computer programs

 To write a program, you need appropriate software for the programming language you will be using 7

Programming Languages

 Categories of programming languages

 Low-level languages: Difficult to code in; machine

dependent

Machine language: 1 s and 0 s Assembly language: Includes some names and other symbols to replace some of the 1 s and 0 s in machine language  High-level languages: Closer to natural languages  Machine independent  Includes 3 GLs (FORTRAN, BASIC, COBOL,C, etc.) and object-oriented languages (Visual Basic, C#, Python, Java, etc.)  Visual or graphical languages: Use graphical interface to create programs 8

Low-Level

Programming

Languages

11 Low-Level Programming Languages Machine language and Assembly language

Code in Assembly Language to Add Two Integers

High-Level

Programming

Languages

Code in High Level Languages (in C)

#include <stdio.h>
int main( )
int num1, num2, sum;
printf("Enter two integers: ");
scanf("%d %d",&num1,&num2);
sum=num1+num2;
printf("Sum: %d",sum);
return 0;

Code in High Level Languages (in Python)

print("Enter two integers: ")

num1=int(input())

num2=int(input())

sum=num1+num

print("Sum: ", sum)

Languages

Translators

Translation

  • Programs today are normally written in one of the high-level languages.
  • To run the program on a computer, the program needs to be translated into the machine language of the computer on which it will run.
  • The program in a high-level language is called the source program.
  • The translated program in machine language is called the object program.