170 likes | 301 Views
Ch .4 Software. BIT 1003 - Presentation 6. Contents. GENERATIONS OF LANGUAGES COMPILERS AND INTERPRETERS VIRTUAL MACHINES OBJECT-ORIENTED PROGRAMMING SCRIPTING LANGUAGES FUNCTIONAL LANGUAGES LANGUAGE DESIGN LANGUAGE SYNTAX AND SEMANTICS. GENERATIONS OF LANGUAGES.
E N D
Ch.4 Software BIT 1003- Presentation6
Contents • GENERATIONS OF LANGUAGES • COMPILERS AND INTERPRETERS • VIRTUAL MACHINES • OBJECT-ORIENTED PROGRAMMING • SCRIPTING LANGUAGES • FUNCTIONAL LANGUAGES • LANGUAGE DESIGN • LANGUAGE SYNTAX AND SEMANTICS
GENERATIONS OF LANGUAGES • Each computer is wired to perform certain operations in response to instructions. • An instruction is a patternof ones and zeros stored in a word of computer memory. • By the way, a “word” of memory is the basic unit ofstorage for a computer. A 16-bit computer has a word size of 16 bits, or two bytes. A 32-bit computer hasa word size of 32 bits, or four bytes. A 64-bit computer has a word size of 64 bits, or eight bytes. • When a computeraccesses memory, it usually stores or retrieves a word of information at a time.
instruction set -architecture • Each computer is wired to interpret a finite set of instructions. • Most machines today have 75 to150 instructions in the machine “instruction set.” • Much of the “architecture” of a computer design isreflected in the instruction set, and the instruction sets for different architectures are different. • Forexample, the instruction set for the Intel Pentium computer is different from the instruction set for the Sun SPARC.
Theearliestcomputers • Theywere programmed directly in the machineinstruction set. • The programmer worked with ones and zeros to code each instruction. • As an example,here is code (and an explanation of each instruction), for a particular 16-bit computer.
Assemblylanguages • An early improvement in programming productivity was the assembler. • Assembly languages are called second-generation languages. • An assembler can read mnemonics(letters and numbers) for the machine instructions, and for each mnemonic generate the machine language in onesandzeros.
FORTRAN • In 1954 the world saw the first third-generation language. • The language was FORTRAN, devised by JohnBackus of IBM. • FORTRAN stands for FORmulaTRANslation. • example: X = Y + Z
procedurallanguage • FORTRAN is a “procedural language”. • The computer is a flexible tool, and the programmer’s job is to lay out thesequence of steps necessary to accomplish the task. • The program is like a recipe that the computer will followmechanically.
LISP (forLIStProcessing) • In 1958, John McCarthy at MIT developed a very different type of language. • It is a particularly good language for workingwith lists of numbers, words, and objects, and it has been widely used in artificial intelligence (AI) work. • In mathematics, a function takes arguments and returns a value. • LISP works the same way, and LISP iscalleda “functionallanguage” • example: (+ 2 5)
Cobol(COmmercialandBusiness-OrientedLanguage) • In 1959 a consortium of six computer manufacturers and three US government agencies released Cobol asthe computing language for business applications. • Cobol, likeFORTRAN, is an imperative, procedural language. • To make the code more self-documenting, Cobol was designedto be a remarkably “wordy” language. • The following line adds two numbers and stores the result in a third variable: ADD Y, Z GIVING X.
PL/1 and BASIC • Both PL/1 and BASIC were introduced in 1964. • These, too, are procedural, imperative languages. • IBMdesigned PL/1 with the plan of “unifying” scientific and commercial programming. • PL/1 was part of the IBM360 project, and PL/1 was intended to supplant both FORTRAN and Cobol
BASIC (Beginner’s All-purpose Symbolic Instruction Code) • BASIC was designed at Dartmouth by professors Kemeny and Kurtz as a simple language for beginners. • Over time, however, an almost countless number of variations of BASIC have been created, andsome are very rich in programming power. • Microsoft’s Visual Basic, for example, is a powerful language rich in modern features.
C • Dennis Ritchie created the very influential third-generation language C in 1971. • C was developed as a languagewith which to write the operating system Unix, and the popularity of C and Unix rose together. • C is also animperative programming language. • An important part of C’s appeal is its ability to perform low-level manipulations,such as manipulations of individual bits, from a high-level language.
Smalltalk • During the 1970s, the language Smalltalk popularized the ideas of object-oriented programming. • Object-orientedlanguages are another subcategory of imperative languages. • Both procedural and object-orientedlanguages are imperative languages. • The difference is that object-oriented languages support object-orientedprogramming practices such as inheritance, encapsulation, and polymorphism.
C++ • In the mid-1980s, BjarneStroustrup, at Cambridge University in Britain, invented an object-orientedlanguage called C++. • C++ is a superset of C; any C program is also a C++ program. • C++ provides a full set ofobject-oriented features, and at one time was called “C with classes.”
Java • The most popular object-oriented language today is Java, which was created by James Gosling and hiscolleagues at Sun Microsystems. • Java was released by Sun in 1994, and became an immediate hit due to itsappropriateness for web applications, its rich language library, and its hardware independence. • Java’s growth inuse among programmers has been unprecedented for a new language. • Today Java and C are the languages mostfrequently chosen for new work.