Comparison of ALGOL 68 and C

del.icio.us del.icio.us
Digg Digg
Furl Furl
Reddit Reddit
Rojo Rojo
Add to OnlyWire
This article is part of the
Programming Language Comparison
series.
General Comparison
Basic Syntax
Basic Instructions
Arrays
Associative arrays
String Operations
String Functions
List comprehension
Object-oriented programming
Object-oriented constructors
Database access

Evaluation strategy
List of "hello world" programs

Comparison of ALGOL 68 and C++
Compatibility of C and C++
Comparison of Pascal and Borland Delphi
Comparison of Pascal and C
Comparison of Java and C++
Comparison of Java and C#
Comparison of C# and Visual Basic .NET
Comparison of ABAP and Java

The nearest living sibling to ALGOL 68 may be C++, making this a good comparison candidate:

C++ doesn't have:

  • PROC - nested functions,
  • OP and PRIO - definable operator symbols and priorities,
  • garbage collection,
  • use before define,
  • formatted transput using complex formatting declarations,
  • := - assignment operation symbol (to avoid confusion with equal sign),
  • array (and slice operations on them, but in layered libraries),
  • automatic UNIONs,
  • CASE expressions,
  • nonlocal GOTO
  • intuitive declaration syntax due to its origin from C.

ALGOL 68 doesn't have:

Code Example

Mode declaration

A new mode (type) may be declared using a mode declaration:

int max=99;
mode newtype = [0:9][0:max]struct (
   long real a, b, c, short int i, j, k, ref real r
);

This has the similar effect as the following C++ code:

const int max=99;
typedef class 
{ 
    double a, b, c; short i, j, k; float &r;
} newtype[9+1][max+1];

Note that for ALGOL 68 only the newtype name appears to the left of the equality, and most notably the construction is made - and can be read - from left to right without regard to priorities.

External references

This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.


Giant Panda

Mercedes Car
James Bond Guide
This site monitored by SitePinger.net