Alevtina Verbovetskaya



Download 38.84 Kb.
Date28.01.2017
Size38.84 Kb.
#9063


Alevtina Verbovetskaya

Professor D. Kopec

CIS 24

Fall 2006



ALGOL 60: How It All Began

ALGOL (ALGOrithmic Language) is an imperative computer programming languages used especially in mathematical and scientific applications. ALGOL 60 was the first language to be designed internationally. In January of 1960, a group of 13 representatives from 7 different countries (Denmark, England, France, Germany, Holland, Switzerland, and the United States) gathered in Paris, France, to discuss the oversights of ALGOL 58 and figure out how to rectify them. They recorded their results in the ALGOL 60 report, which was published in May of 1960. However, some ambiguities still remained. For this reason, another conference was called in Rome, Italy, in April of 1962. The final draft of the ALGOL 60 report was approved in August of 1962. (Baumann 99-101)

The committee specified three different syntaxes: reference syntax, publication syntax, and hardware syntax. The different syntaxes permitted the use of different keyword names and conventions for decimal points (commas vs. periods) for different languages. (Wikipedia) The reference language was depicted in the Backus-Naur Form to allow for ease of comprehension. However, this plan backfired as the concept of BNF was introduced too early in the world of programming; it turned out to be more confusing than useful.

The international council tried to make the language universal. ALGOL’s machine independence permitted the designers to be more creative but it made implementation much more difficult. (Language Guide) ALGOL 60 as officially defined had no I/O facilities – implementations defined their own in ways that were rarely compatible with each other. “The lack of any standard input-output prior to the implementation of the major compiling systems has been a serious drawback in the use of ALGOL 60. The portability of ALGOL 60 programs is severely curtailed unless the input-output is localized.” (Wichmann 251) The creators of C, an imperative language that was first created in 1972, were aware of this issue and therefore equipped C with input/output capabilities. In C, input and output are performed via a group of functions in the standard library.

ALGOL 60 also allowed for two evaluation strategies for parameter passing: the common call-by-value and call-by-name. Call-by-name had certain limitations in contrast to call-by-reference, making it an undesirable feature in language design. For example, “it is impossible in ALGOL 60 to develop a procedure that will swap the values of two parameters if the actual parameters that are passed in are an integer variable and an array that is indexed by that same integer variable.” (Wikipedia) Variables in C are passed by value. This means that the receiving function gets copies of the values and has no way of altering the original variables. To have a function alter variables passed from another function, you pass the address (called a pointer) to it and dereference it in the receiving function. (Pointers don’t exist in ALGOL 60.)

According to Wichmann, one oddity of ALGOL 60 is that comments are not easy to spot and remove, which is unfortunate since any program, other than a compiler, that analyses ALGOL 60 source text will almost certainly want to skip over comments. (125-1


Nothing is more likely to ensure absence of comments than making them inconvenient to write.
Brian A. Wichmann


26) The difficulty arises because there are t

hree different forms of comments, all of which are defined syntactically. There is first an explicit comment, which starts with comment and ends with ;. This doesn’t seem like a bad deal until, of course, you learn that it can only follow begin or ;. Therefore, something like label: comment...; is invalid. The second form of comment is the parameter comment (which is really another way of writing a comma separating formal or actual parameters). This form is of limited context and can only contain letters (for reasons left unspecified). Thirdly, there is the end comment. This is the most dangerous one, as it is the least explicit. (Wichmann 126) Comments in C, on the other hand, are straightforward and easily recognizable. Text starting with /* is treated as a comment and ignored. The comment ends at the next */ and can span multiple lines.

ALGOL is considered to be the most orthogonal programming language. This means that “it has a relatively small number of basic constructs and a set of rules for combining those constructs.” (Language Guide) The language C, on the other hand, is not regarded as orthogonal. For example, C has two kinds of built in data structures: arrays and structs. Structs can be returned from functions, but arrays cannot. A member of a struct can have any type except void or a structure of the same type. An array element can be any data type except void or a function.

ALGOL 60 was specifically designed to avoid some of the perceived problems with FORTRAN. Its purpose was to describe computational processes using numbers, variables, and functions. One of its main goals was to become a universal and convenient programming tool, not only for professional programmers, but also for engineers and scientists who wished to use modern machines in their work. (Leach) However, it had many downfalls. The lack of input/output statements restricted ALGOL 60 from becoming truly portable. The absence of abstraction made it a very limited language, having arrays as the only composite data types. Additionally, ALGOL 60 “did not permit the declaration of new data ‘types’ or data structures.” (Dictionary of Programming Languages) A programmer was restricted to types Boolean, integer, and real. Those programming in C had the option of using several primitive types, such as int, float, double, and char. Like ALGOL 60, C was unequipped to allow for the declaration of new data types. (This wasn’t fixed until C++ came into the picture.)

A


The success of ALGOL 60 is reflected in
the abundance of programming languages whose basic structure is derived from it.

Brian A. Wichmann






lthough ALGOL never reached the level of commercial popularity of FORTRAN and COBOL, it is considered the most important language of its era in terms of its influence on later language development. (Language Guide) No other language has had such a profound impact on programming language design and definition. ALGOL 60 opened the door for languages such as PL/I, MODULA, C, Pascal, ADA, C++, and Java.
Sample Code: ALGOL1


  1. begin

  2. integer N;

  3. Read Int(N);



  4. begin

  5. real array Data[1:N];

  6. real sum, avg;

  7. integer i;

  8. sum := 0;



  9. for i:=1 step 1 until N do

  10. begin

  11. real val;

  12. Read Real(val);

  13. Data[i] := if val<0 then -val else val

  14. end;



  15. for i:=1 step 1 until N do

  16. sum := sum + Data[i];

  17. avg := sum/N;

  18. Print Real(avg)

  19. end

  20. end



Sample Code: C


  1. #include

  2. #include



  3. int main( ) {

  4. int i, n;

  5. float *array, sum = 0.0;



  6. scanf( "%d", &n );

  7. for( i = 0; i < n; i++ ) {

  8. scanf( "%f", &array[i] );

  9. sum += abs( array[i] );

  10. }

  11. printf( "%f", sum / ( float )n; );



  12. return 0;

  13. }

Both programs compute the averages of the absolute values of the given arrays.



Language Ratings2

ATTRIBUTES

ALGOL 60

C

Abstraction

4

7

Binding

8

6

Clarity of Code

9

6

Conditionals

9

9

Functions

7

9

Input/Output

0

5

Integer Representation

9

8

Libraries

8

9

Object Oriented

0

0

Orthogonality

10

8

Pointers

0

9

Powerful

7

8

Procedures

9

0

Recursion

7

8

Simple Syntax

9

6

Strongly Typed

9

5

Structured

10

8

Type of Computing

Scientific/Mathematical

Scientific/Engineering


Works Cited

“ALGOL.” Dictionary of Programming Languages. Jan. 2000. Ziring MicroWeb Home. 21 Sep. 2006 .

“ALGOL.” Wikipedia, the Free Encyclopedia. 13 Sep. 2006. Wikimedia Foundation, Inc. 21 Sep. 2006 .

“The ALGOL Programming Language.” The Language Guide. 22 Nov. 1996. Department of Computer Science at the University of Michigan, Dearborn. 21 Sep. 2006 .

Baumann, R., M. Feliciano, F. L. Bauer, and K. Samelson. Introduction to ALGOL. New Jersey: Prentice-Hall, 1964.

Leach, Anthony. “ALGOL 60.” CIS 24. Spring 2005. Brooklyn College. 21 Sep. 2006 .



Wichmann, B. A. ALGOL 60 Compilation and Assessment. London: Academic Press, 1973.

1 Code obtained from the University of Michigan’s Department of Computer and Information Science website on ALGOL: http://www.engin.umd.umich.edu/CIS/course.des/cis400/algol/algol.html.

2 All scores are based on a scale of 1 to 10, with 10 being the best. (A zero represents the lack of an attribute.)



Download 38.84 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page