the history of programming languages. introducing programming languages a programming language is an...

17
The History of Programming Languages

Upload: regina-jane-warren

Post on 12-Jan-2016

225 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

The History of Programming Languages

Page 2: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Introducing Programming languages

A programming language is an artificial language that can be used to control the behaviour of a machine, particularly a computer. Programming languages, like human languages are defined through the use of syntactic and semanticrules, to determine structure and meaning respectively.Programming languages are used to facilitate communication about the task of organizing and manipulating information, and to express algorithms precisely. Some authors restrict the term "programming language" to those languages that can express all possible algorithms; sometimes the term "computer language" is used for more limited artificial languages.Thousands of different programming languages have been created, and new languages are created every year.

Page 3: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

There have been five generations of programming language

The first generation is called machine code.This is almost impossible to read. It consists of digits 0 + 1

Page 4: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Jay or Ryan DECODE THIS 1GL

Page 5: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

http://en.wikipedia.org/wiki/First-generation_programming_language

A first-generation programming language is a machine-level programming language. It consists of 1s and 0s.

Originally, no translator was used to compile or assemble the first-generation language. The first-generation programming instructions were entered through the front panel switches of the computer system.The main benefit of programming in a first-generation programming language is that the code a user writes can run very fast and efficiently, since it is directly executed by the CPU. However, machine language is somewhat more difficult to learn than higher generational programming languages, and it is far more difficult to edit if errors occur. In addition, if instructions need to be added into memory at some location, then all the instructions after the insertion point need to be moved down to make room in memory to accommodate the new instructions. Doing so on a front panel with switches can be very difficult. Furthermore, portability is significantly reduced - in order to transfer code to a different computer it needs to be completely rewritten since the machine language for one computer could be significantly different from another computer. Architectural considerations make portability difficult too. For example, the number of registers on one CPU architecture could differ from those of another.

Page 6: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Current uses1GL is mainly used on now very ancient computers, machine level programming still finds a use in several areas of modern programming. First and foremost, any native-code compiler creates machine language. This is done without user interaction, usually from a higher-level language such as Fortran /C++ or Pascal often with intermediate byte code or assembly code.Occasionally, IBM Mainframe software fixes are distributed in the form of ZAPs, which are bare machine code distributed as hexadecimal text. Thus, the creation of a zap is 1st generation programming.Another use is for so-called virtual machines. In essence, each virtual machine just creates a translation bridge between machine code and byte code. The byte code is the same across all platforms and the translator module of the virtual machine then translates just-in-time each byte to the corresponding native machine instruction.Computer viruses often inject code in a certain spot in memory. When tracing the logs of your web server, you may find several entries of very long urls. Often, the encoded part of the url is equal to a certain set of machine level instructions which an attacker hopes will be executed on your computer. It is notoriously hard to create such pieces of code, unless the coder makes use of assemble and disassemble helper programs.

Page 7: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Second Generation Language 2GL

Computer programmers soon became frustrated by the 1GL and so developed second generation programming which resembles human language

assembly language

Page 8: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the
Page 9: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

second-generation programming language is a term usually used to refer to some form of assembly language. Unlike first-generation programming languages, the code can be read and written fairly easily by a human, but it must be converted into a machine readable form in order to run on a computer. The conversion process is simply a mapping of the assembly language code into binary machine code (the first-generation language). The language is specific to and dependent on a particular processor family and environment. Since it is a one-to-one mapping to the native language of the target processor it has significant speed advantages, but it requires more programming effort and is difficult to use effectively for large applications.

Page 10: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Assembly languages were first developed in the 1950s, when they were referred to as second generation programming languages. They eliminated much of the error-prone and time-consuming first-generation programming needed with the earliest computers, freeing the programmer from tedium such as remembering numeric codes and calculating addresses. They were once widely used for all sorts of programming. However, by the 1980s (1990s on small computers), their use had largely been supplanted by high-level languages, in the search for improved programming productivity. Today, assembly language is used primarily for direct hardware manipulation, or to address critical performance issues. Typical uses are device drivers, low-level embedded systems, and real-time systems.A utility program called an assembler, is used to translate assembly language statements into the target computer's machine code. The assembler performs a more or less isomorphic translation (a one-to-one mapping) from mnemonic statements into machine instructions and data. (This is in contrast with high-level languages, in which a single statement generally results in many machine instructions. A compiler, analogous to an assembler, is used to translate high-level language statements into machine code; or an interpreter executes statements directly.)

Page 11: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Typical applicationsHand-coded assembly language is typically used in a system's boot ROM (BIOS on IBM-compatible PC systems). This low-level code is used, among other things, to initialize and test the system hardware prior to booting the OS, and is stored in ROM . Once a certain level of hardware initialization has taken place, execution transfers to other code, typically written in higher level languages; but the code running immediately after power is applied is usually written in assembly language. The same is true of most boot loaders .Many compilers render high-level languages into assembly first before fully compiling, allowing the assembly code to be viewed for debugging and optimization purposes. Relatively low-level languages, such as </wiki/C_%28programming_language%29>, often provide special syntax to embed assembly language directly in the source code. Programs using such facilities, such as the Linux kernel, can then construct abstractions utilizing different assembly language on each hardware platform. The system's portable code can then utilize these processor-specific components through a uniform interface.Assembly language is also valuable in reverse engineering , since many programs are distributed only in machine code form, and machine code is usually easy to translate into assembly language and carefully examine in this form, but very difficult to translate into a higher-level language. Tools such as the Interactive Disassembler make extensive use of disassembly for such a purpose.A particular niche that makes use of the assembly language is the demoscene. Certain competitions require the contestants to restrict their creations to a very small size(e.g. 1Kb, 4Kbs, 64Kbs), and assembly language becomes the language of choice to achieve this aim.

Page 12: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Third-generation programming language

A third generation language (3GL) is a programming language designed to be easier for a human to understand, including things like named variables. A fragment might be:let b = c + 2 * d Fortran , ALGOL and COBOLare early examples of this sort of language. Most "modern" languages (BASIC, , C++, Delphi , Java, and including COBOL, Fortran, ALGOL are third generation. Most 3GLs support structured programming.

http://en.wikipedia.org/wiki/Fortran_programming_language

Page 13: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

http://en.wikipedia.org/wiki/Fortran_programming_language

http://en.wikipedia.org/wiki/Fortran_programming_language#Fortran_90

Types

Page 14: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k); value n, m; array a; integer n, m, i, k; real y;comment The absolute greatest element of the matrix a, of size n by m is transferred to y, and the subscripts of this element to i and k;begin integer p, q; y := 0; i := k := 1; for p:=1 step 1 until n do for q:=1 step 1 until m do if abs(a[p, q]) > y then begin y := abs(a[p, q]); i := p; k := q endend Absmax

Some Algol 60

Page 15: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

http://en.wikipedia.org/wiki/BASIC_programming_language

BASICIn computer programming , BASIC (an acronym for Beginner's All-purpose Symbolic Instruction Code[1]) refers to a family of high-level programming languages. It was originally designed in 1963 , by John George Kemeny and Thomas Eugene Kurtz at Dartmouth College , to provide access for non-science students to computers. At the time, nearly all computer use required writing custom software, which was something only scientists and mathematicians tended to do. The language (in one variant or another) became widespread on microcomputers in the late 1970s and home computers in the 1980s, and remains popular to this day in a handful of heavily evolved dialects .

Page 16: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Classic BASICNote that this example is actually well structured, demonstrating that use of the GOTO statement does not necessarily lead to an unstructured program.

Page 17: The History of Programming Languages. Introducing Programming languages A programming language is an artificial language that can be used to control the

Modern BASIC"Modern" structured BASICs (for example QuickBASIC and PowerBASIC) support classic commands such as GOTO statements to varying degrees, while adding many more modern keywords.The previous example in QuickBASIC:

INPUT "What is your name"; UserName$PRINT "Hello "; UserName$DO INPUT "How many stars do you want"; NumStars Stars$ = "" Stars$ = REPEAT$("*", NumStars) ' <- ANSI BASIC ''--or--'' Stars$ = STRING$(NumStars, "*") ' <- MS BASIC PRINT Stars$ DO INPUT "Do you want more stars"; Answer$ LOOP UNTIL Answer$ <> "" Answer$ = LEFT$(Answer$, 1)LOOP WHILE UCASE$(Answer$) = "Y"PRINT "Goodbye ";FOR I = 1 TO 200 PRINT UserName$; " ";NEXT IPRINT