A History of the C Languages By: Kevin Burnette. Outline History Ancestor languages overview...

14
A History of the C A History of the C Languages Languages By: By: Kevin Burnette Kevin Burnette

Transcript of A History of the C Languages By: Kevin Burnette. Outline History Ancestor languages overview...

Page 1: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

A History of the C A History of the C LanguagesLanguages

By:By:

Kevin BurnetteKevin Burnette

Page 2: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Outline

HistoryAncestor languages overview

Development of C

Development of C++

Page 3: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Where it all began

Combined Programming Language – CPL

Basic Combined Programming Language – BCPL

B

Page 4: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

What’s new in B

+= and -= operators were introduced to the language

++ and -- operators were invented.

Page 5: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

From B to C

New B - NBDennis Ritchie of Bell Labs created an extend

version of B in 1971.Added int, and char types, arrays of them and

pointers to them and rewrote the compiler to create PDP-11 instructions.

NB created programs small and fast enough to compete with assembly written programs.

Page 6: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Questions of design

These questions were asked in designing structure types. “Where could the compiler hide the pointer to name that the

semantics demanded?” (Ritchie 8) “Even if structures were thought of more abstractly, and the

space for pointers could be hidden somehow, how could I handle the technical problem of properly initializing these pointers when allocating a complicated object, perhaps one that specified structures containing arrays containing structures to arbitrary depth?” (Ritchie 8)

Page 7: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Answer:

The solution eliminated the materialization of the pointer in storage, and instead caused the creation of the pointer when the array name is mentioned in an expression.

This provided a large jump in the evolution between typeless BCPL and C.

Page 8: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

More Innovation – Type Structure

“The central notion I captured from Algol was a type structure based on atomic types (including structures), composed into arrays, pointers (references), and functions (procedures).” (Ritchie 8)

Page 9: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

C is officially born “After creating the type system,

the associated syntax, and the compiler for the new language, I felt that it deserved a new name; NB seemed insufficiently distinctive. I decided to follow the single-letter style and called it C, leaving open the question whether the name represented a progression through the alphabet or through the letters in BCPL.” (Ritchie 9)

Page 10: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Further Development

PreprocessorThe preprocessor was originally added as an

optional componentFirst version only provided file including and

simple string replacement Idea was taken from BCPL and PL/I

Page 11: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

C with Classes

Work began in 1979 in attempt to analyze the UNIX kernel to see if it could be distributed over a network

Bjarne Stroustrup begin creating the tools he needed based on his experience with Simula

Page 12: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

C++

Between 1982 and 1984 Stroustrup began to think of C with Classes as a separate language instead of an addition to C.

Version 1.0 was released in 1985 and C++ was officially named.

Page 13: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Code Examples

GET "LIBHDR" MANIFEST $(

BOTTLES = 99 $)LET START() BE $(

LET BEERS(N, S) BE $( TEST N = 0 THEN WRITEF("No more bottles")

ELSE WRITEF("%N bottle%S", N, (N = 1) -> "", "s") WRITEF(" of beer%S", S) $) FOR I = BOTTLES TO 1 BY -1 DO $(

BEERS(I, " on the wall, ") BEERS(I, ".*NTake one down, pass it around.*N") BEERS(I - 1, " on the wall.*N")

$) FINISH $) From: http://www.99-bottles-of-beer.net/language-bcpl-85.html

Page 14: A History of the C Languages By: Kevin Burnette. Outline History  Ancestor languages overview Development of C Development of C++

Sources

“BCPL.” Wikipedia: The Free Encyclopedia. 2006. Wikipedia. 7 Apr 2006. http://en.wikipedia.org/wiki/BCPL

“Combined Programming Language.” Wikipedia: The Free Encyclopedia. 2006. Wikipedia. 7 Apr 2006. http://en.wikipedia.org/wiki/Combined_Programming_Language

Ritchie, Dennis. “The Development of the C Language.” History of Programming Languages-II. Ed. T.J. Bergin, Jr. and R. G. Gibson, Jr. ACM Press (New York) and Addison-Wesley (Reading, Mass), 1996; ISBN 0-201-89502-1.

Stroustrup, Bjarne. “A History of C++: 1979-1991.” History of Programming languages. Ed. T.J.Bergin and R.G. Gibson, Jr. ACM Press (New York) and Addison-Wesley (Reading, Mass), 1996; ISBN 0-201-89502-1.