[Santa Clara University]
Department of Mathematics
and Computer Science
[Return to Math 169 Homepage]

Math 169 Notes
Introduction -- II


Contents


A. Language

There are many ways to look at a computer language. What is it? What is it not?

Does a programming environment count as a language? Is MATLAB (``MATrix LABoratory'') a language or a computational environment? One can both write "routines/functions" in MATLAB and also do ad hoc computations. The same is true of LISP.

What about HTML? It is an abbreviation for "HyperText Markup Language" and is used to communicate with computers. So does that make it also a "computer language" in the common use of the term?

By a computer language, most people understand a system of commands and constructs that can be used to communicate with a computer, enabling a programmer to control and sequence the computer's computations and other activities. Usually, "computer language" is used synonymously with "programming language" with the result that a "markup" language or "query" language is seen to be in a different category.

The "ultimate" computer language for any machine is its own binary machine code, with assembly language being a close cousin. In reality, programming languages that are compiled are actually translated into machine code and it is the translation that a computer actually runs, rather than the source code.

B. Paradigms

It is common to categorize programming languages according to different paradigms. Each paradigm approaches programming languages from a different starting point, usually leading to distinctively different styles. The paradigms themselves may be categorized in certain ways so that any specific language may actually be classified according to several paradigms. The following are the common categories.

C. Comments on Paradigms

It is often possible to classify a language according to more than one paradigm, for example, first looking at syntax/form, and then looking at context/function. For example, C, C++, Java, and Perl all bear a striking resemblance to each other. The syntax rules for a for loop is identical in these four languages. In that sense, they are all imperative languages. But C is not object oriented, and thus, in a sense, is more similar to Fortran-77 in this aspect than to Java. In contrast, Java is very object oriented (even main must be a method of a class), and so, in this respect, Java is closer to Smalltalk than to C.

C++ is a hybrid. It has been said that the better one knows C, the less one is able to write object-oriented code in C++ even though C++ has object-oriented features. The language itself is so close to its "parent" language C, that programmers can easily slip into a non-object-orientated programming style even though it is billed as a "object-oriented" language.

There are other terms in common use as well. For example, some authors speak about declarative languages which include logic, functional, and database languages, and use imperative to include object-oriented languages.

There are other languages which bridge various categories and are special purpose. SNOBOL and Icon are geared primarily for character manipulation (e.g., language translation or textual analysis). Both are based on pattern matching in character strings, although Icon looks like a typical imperative language. Database languages such as SQL presuppose a large database.

D. Language Development

The study of programming languages also touches issues regarding the development of languages. Such "development" occurs in various ways. One way is that that the language itself evolves. The classical example of a language that has developed and continues to develop is Fortran. This is a case where most code written in 1956 can still run even using the latest compiler. But even languages such as C, C++, and Java have developed since their first appearance.

Another way in which languages develop is by giving birth to new languages that are inspired by older languages and are similar in syntax but have distinctive differences that make code written in the "parent" language incompatible with code written in "child" language. Such is the case with the Pascal family of languages. Pascal was influenced by Algol-68 (itself derived from Algol-60) in its syntax, but was designed for ease of learning and included strict rules regarding data typing and the creation of new data structures. Modula-2 was built on Pascal, retained much of its syntax, but introduced new features now associated with objects and "data encapsulation." Oberon went further and was redesigned for single user workstations. All three languages bear a striking similarity to each other, but code written in one language cannot be compiled by another language's compiler.

Still another way that languages develop is by continuing the function of a language. SNOBOL4 (derived from SNOBOL) was designed for textual analysis and manipulation. SNOBOL's syntax is unlike any other language since the two basic "operations" are pattern matching (indicated by a blank) and text replacement (indicated by an =), both of which can occur in a single line. In addition, each line can include the equivalent of "GOTOs" that can be used to jump to other sections of code depending on whether the pattern matching was successful or not. SNOBOL's successor language, Icon, was developed based on the "best" features of Pascal and C, yet kept many of the intrinsic functions of SNOBOL geared toward textual analysis. Icon also includes other features, useful for numeric computation, not found in SNOBOL.


This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
Last updated: 5 April 2002, minor correction 13 September 2005.