01 Lesson 2
01 Lesson 2
PROGRAMMING LANGUAGES
LET’S PROCESS
Computer programs, known as software, are instructions that tell a computer what
to do. Computers do not understand human languages; therefore, programs must be written
in languages computers can understand. There are hundreds of programming languages,
developed to make the programming process easier for people. However, all programs must be
converted into the instructions the computer can execute.
1. MACHINE LANGUAGE
A computer’s native language, which differs among different types of computers, is its
machine language—a set of built-in primitive instructions. These instructions are in the form
of binary code, so if you want to give a computer an instruction in its native language, you
have to enter the instruction as binary code. For example, to add two numbers, you might have
to write an instruction in binary code, as follows: 1101101010011010
2. ASSEMBLY LANGUAGE
add 2, 3, result
Assembly languages were developed to make programming easier. However, because the
computer cannot execute assembly language, another program—called an assembler—is used
to translate assembly-language programs into machine code, as shown in Figure 1.8.
Source: https://computationstructures.org/notes/images/assembly-process.png
Figure 1.8. An assembler translates assembly-language instructions into machine code.
3. HIGH-LEVEL LANGUAGE
Page 1 of 3
language are called statements. Here, for example, is a high-level language statement that
computes the area of a circle with a radius of 5:
area = 5 * 5 * 3.1415
There are many high-level programming languages, and each was designed for a specific
purpose. Table 1.1 lists some popular ones.
An interpreter reads one statement from the source code, translates it to the machine
code or virtual machine code, and then executes it immediately, as shown in Figure 1.9b. Note
that a statement from the source code may be translated into several machine instructions. A
compiler translates the entire source code into a machine-code file, and the machine-code file
is then executed, as shown in Figure
1.9a.
Language Description
Named for Ada Lovelace, who worked on mechanical general-purpose
computers. The Ada language was developed for the Department of
Ada
Defense and is used mainly in defense
projects.
Beginner’s All-purpose Symbolic Instruction Code. It was designed to be
BASIC
learned and used easily by beginners.
Developed at Bell Laboratories. C combines the power of an assembly
C
language with the ease of use and portability of a high-level language.
C++ C++ is an object-oriented language, based on C.
Pronounced “C Sharp.” It is a hybrid of Java and C++ and was developed
C#
by Microsoft.
COmmon Business Oriented Language. It is used for business
COBOL
applications.
FORmula TRANslation. It is popular for scientific and mathematical
FORTRAN
applications.
Developed by Sun Microsystems, now part of Oracle. It is widely used for
Java
developing platform-independent Internet applications.
Named for Blaise Pascal, who pioneered calculating machines in the
Pascal seventeenth century. It is a simple, structured, general-purpose
language primarily used for teaching programming.
A simple general-purpose scripting language good for writing short
Python
programs.
Visual Basic was developed by Microsoft and it enables the
Visual Basic
programmers to rapidly develop graphical user interfaces.
Page 2 of 3
Source: https://qph.fs.quoracdn.net/main-qimg-ed43d3565d56e6d317b3a9c408f44e5d
Figure 1.9. (a) A compiler translates the entire source program into a machine-language file for
execution. (b) An interpreter translates and executes a program one statement at a time.
Page 3 of 3