Classic Computer Magazine Archive START VOL. 4 NO. 1 / AUGUST 1989

Tools of the
Trade

Programming Languages Explored

BY CHARLES JACKSON
START Charts compiled by Marta Deike, START Editorial Coordinator

Programming is like any other craft; in order to get a job done right, you need to use the right tools. And the most important tool a programmer has is a language-a way to get an unambiguous series of instructions to the computer's central processor. In this article, Charles Jackson examines computer languages and discusses which are best suited to which tasks.

In the earliest days of computing, programmers had no choice of languages: a program was hard-wired -physically- into a computer. To change a program, a programmer had to remove the existing connections and add new ones. It was an arduous and painstaking task.

When computers became a bit more sophisticated, programmers were able to write programs in machine language and pass the instructions to the computer via punch cards. Then Fortran, COBOL and other higher level languages appeared on the scene-so called because they were one step removed from machine language. Other languages that appeared later such as BASIC and Pascal, were originally designed to teach programming but evolved into powerful programming tools in their own right.

Now, programmers can choose from a wide range of languages - each best suited to a different task. Which language you should use for an application depends on what your program will be designed to do. The START Charts accompanying this article will give you up-to-date information on ST language implementations, including version numbers, company addresses and prices.

C
Since its introduction in the early 1970s, C has become the software developer's language of choice. Having only 32 reserved words, C is a small, flexible language that combines the power and portability of high-level structured languages with the speed and efficiency of low-level assembly languages. There are C compilers available for nearly every brand and type of computer from 8-bit Ataris to Unix mainframes.

This portability makes C a leading choice for developing networking software for local and wide area networks (LANs and WANs), particularly for networks designed to join different brands of computers. Some software engineers rely heavily on C, reserving assembly language for such operations as time-critical computations. A descendent of a programming language called B, C was developed in the early 1970's by Dennis Ritchie at AT&T Bell Laboratories.

At the time Unix was written, most operating systems were written in assembly language; thus chaining the operating system to the machine for which it was written, but more than 90 percent of Unix was written in C. This has enabled Unix to be ported to many different types of computers.

The C Programming Language by Brian Kemighan and Dennis Ritchie is the definitive reference manual for the language. Often called simply the "K and R," this 220-page manual has been guiding C programmers for more than 10 years.

C for the ST
Product Price Ver.
C
Mark Williams
Upgrage policy varies; call Mark Williams.
$179.95 3.0.9
C
Prospero Software
To upgrade send in original disk.
$199 1.13
Laser C
Megamax
To upgrade send in original disk. +$10 (+$3 s/h).
$199.95 2.0
Aztec C
Manx
Upgrade policy varies; call Manx.
$199 3.6
Alcyon C
Atari Corp.
Upgrade for registered developers only.
Call Atari none
HiSoft C Sceduled for release in May

Assembly Language
Assembly language is a machine-specific, low-level language. Each instruction can be translated quickly into one or two bytes of machine code. And with a little more effort, a machine-language program can be translated into assembly language source code.

Assembly language programs run fast and are invaluable for time-critical operations. Assembly language programmers know exactly how many machine cycles each instruction requires and can write routines that run with split-second precision.


Assembly language
programs run fast
and are invaluable
for time-critical
operations.

On the down side, assembler source code is long and not very readable. A one-line PRINT statement in BASIC, for example, would require about a dozen assembly language commands.

Macro assemblers make programming somewhat easier Macro assemblers let you extend your assembly language package to include any assembler subroutines you write. You could write a PRINT macro, for example; that would print information on the screen. This PRINT macro would contain the dozen-or-so assembler instructions you need to print something on the screen. Once defined as a macro, though, you can call PRINT each time you want something printed on the screen. When you assemble the program, the assembler will expand each occurrence of the macro into its original, unabbreviated form. Seasoned assembly language programmers often have collected large libraries of macros.

Assembly language is slipping in popularity. Faster machines and high-level languages such as C and Modula-2 are making assembly language nearly obsolete in all but the most time-critical applications.

Assembly Language for the ST
Product Price Ver.
DevPac 2
MichTron
To upgrade send in original (1.0) disk + $40.
$99.95 2.08
AssemPro
Abacus
To upgrade send in original disk + $15 (+ $2 s/h).
$59.95 1.0
GFA Assembler
Antic Software
Upgrade policy varies; call Antic.
Call Antic 1.2
MadMac
Upgrade for developers only.
Call Atari  

BASIC
BASIC (Beginner's All-purpose Symbolic Instruction Code) is a computer language developed in 1967 at Dartmouth College by John Kemeny and Thomas Kurtz. BASIC is an interpreted programming language-you get immediate response to what you type at the terminal. Designed for beginning programmers, BASIC is one of the easiest languages to learn. Newer, more powerful versions are commonly seen in microcomputers; the most powerful BASICs for the ST don't require line numbers and offer support for structured programming.

BASIC for the ST
Product Price Ver.
HiSoft BASIC
MichTron
$79.95 1.23
HiSoft BASIC Pro.
MichTron
$159.95 1.23
GFA BASIC
Antic Software
Upgrade policy varies; call Antic.
$99.95 3.05
ST BASIC
Atari
Upgrade policy varies; call Atari.
$29.95 D

Modula-2
Modula-2 was introduced in 1985 by Swiss professor Niklaus Wirth. Programmers unfamiliar with Modula-2 often look at the Pascal-like appearance of Modula-2 source code and dismiss the language as a "warmed-over" Pascal.

Although many Pascal and Modula-2 programs look alike; the applications for which they were designed are quite different. Wirth developed Pascal to teach programming skills. He developed Modula (now called Modula-1) and Modula-2 for real-world programming jobs.

Modula-2 is a general-purpose high-level programming language that combines the readability of Pascal with the strength of C, and then some More and more programmers are finding Modula-2 to be slightly more powerful than C. Modula-2 features both multi-tasking and multi-processing capabilities. It is used for writing compilers, operating systems and application programs.

It has also become an efficient development tool. Modula-2 lets you break large programming projects into separate pieces, or modules, which may then be distributed among several teams of software engineers. Modula-2 lets these teams work independently of each other so that smaller program modules can be designed, tested and debugged before the larger modules are complete.

Modula-2 is a small language-only 40 keywords-and is very portable Modula-2 source code written on your ST will often run on mainframe systems. Modula-2's secret is external I/O (input/output) libraries. Like C, Modula-2 doesn't have its I/O routines hard-wired into the language. These I/O functions, usually the most machine-dependent elements of a language, are stored in separate library files. As long as your source code is compiled and linked with the appropriate I/O library, it should operate on nearly any machine.

Modula 2 for the ST
Product Price Ver.
Modula 2
ana-systems
Modula 2 is supported on BBS
Shareware 1.0

Pascal
Pascal, named for the mathematician and philosopher Blaise Pascal, is a high. level compiled computer language designed by Niklaus Wirth at Zurich in 1968. it was never designed for programming, but for teaching structured programming. The first Pascal compilers didn't appear until the early 1970s.

Based on ALGOL (ALGOrithmic Language), Pascal was designed to be a small, easily learned, machine-independent language. As one of the first languages to use control structures such as BEGIN and END, its syntax demanded a rigid, structured approach to programming. Towards this end, Pascal provides a rich variety of data types, including abstract and user-defined data types.

Unfortunately, Pascal is weak in arithmetic. Standard Pascal lacks an exponential operator and insists that loops may not be incremented or decremented by any number but 1. Extensions to Pascal have solved this problem; however, many of these extensions are not compatible with all Pascal compilers and will not run on all machines.

Pascal for the ST
Product Price Ver.
Pascal for GEM
Prospero Software
To upgrade send in original dik + $39.
$149 2.14
ALICE (Pascal)
Looking Glass Software
To upgrade send in original disk + $15.
$79.95 1.5
Personal Pascal
ICD
To upgrade send in original disk + $10.
$99.95 2.05
UCSD Pascal
Pecan Software
To upgrade send in original disk + $79.95.
$249.95 4.22

FORTRAN
FORTRAN (FORmula TRANslation language) was one of the first computer languages designed to be machine-independent. Developed in the mid1950s by IBM as a tool for simplifying scientific programming, FORTRAN lets programmers write program code that resembles algebraic notation. As one of the oldest computer languages, it is still one of the most widely used for technical programming and teaching. FORTRAN is a high-level compiled language which efficiently handles lengthy scientific computations. As a result, math-intensive programs written in FORTRAN require relatively little computer time. The American National Standards Institute (ANSI) first standardized the language in 1966. Newer versions of FORTRAN include IF-THEN-ELSE blocks and CHARACTER data types.

FORTRAN for the ST
Product Price Ver.
Pro-Fortran 77
Prospero Software
To upgrade send in original disk + $59.
$199 2.14

APL
APL (A Programming Language) is an interpreted computer language developed at IBM by Kenneth Iverson in 1962. Iverson's book, APL, is still the definitive text on the language Like Pascal, APL was not developed for programming, but for teaching programming concepts.

At first glance, it's difficult to read and understand an APL program. Standard APL is read from right to left and uses special symbols such as inverted triangles, boxes and arrows in place of keywords and commands. (You need a special keyboard to enter these symbols.) For these reasons, APL has been called a "write-only" language.


A 20-line FORTRAN
program could be
written in 15
keystmkes in APL.

APL also requires more memory than most BASIC interpreters and FORTRAN compilers and is most commonly found on larger computers.

Once you've become familiar with APL, though, you can write extraordinarily powerful programs in a line or two of code APL instructors often hold programming contests, awarding prizes to the student who can write the most powerful APL program in a single line of code.

APL's power comes from its use of arrays - nearly every element of an APL program is considered an array, and all of APL's operators are designed to work with single- or multi-dimensional arrays. Consider a program which multiplies two 100-by-100 matrices together, then prints the sum of all the elements in the resulting matrix. A sharp FORTRAN programmer could write this program in about 20 lines of code. An average APL student could write the same program in 15 keystrokes.

APL for the ST
Product Price Ver.
APL.68000
Specer Organization
Upgrade policy varies: call Spencer
$149 6.05C

FORTH
FORTH is a medium-level interpreted language that combines the speed of low-level languages with the readability of high-level languages.


Fourth Was created to
control telescopes
at Kitt Peak Observatory.

Charles More created FORTH to control telescopes at Kitt Peak Observatory. FORTH programmers write their own commands (or functions), which are then used repeatedly in writing new programs. Thus, it is an economical language that uses a small number of subroutines to build an entire program.

FORTH for the ST
Product Price Ver.
Forth/MT
Abacus Software
To upgrade send in original disk + $15.
$49.95 1.0
4xForth Plus
Dragon Group
To upgrade from 1.1 send in registration card.
$69.95 3.03

LISP
Lisp (LISt Processing) is a high-level interpreted language used to study and develop artificial intelligence applications. Designed by John McCarthy in the late 1950s, Lisp became popular with researchers at MIT, who used it to study properties of artificial intelligence. Lisp is an interactive language in which you create complicated command lists by combining a series of related words, called "S-expressions" (short for "symbolic expressions'). An S-expression can be an atom (a single word or number) or a list of atoms enclosed in parentheses.

As an associative language, Lisp doesn't rely on specific memory addresses. References to specific pieces of information are made by partial descriptions of their contents. The procedure is very similar to using an index or telephone directory; if you have a piece of the information you need, Lisp helps you find all list entries which contain that piece One of the best introductory texts to the language is The Little Lisper.

Lisp for the ST
Product Price Ver.
X-LISP Public Domain  

Prolog
Prolog, (PROgramming LOGic), is a high-level language commonly used for expert systems and artificial intelligence applications. Prolog was designed by French computer scientists in the early 1970s and was selected as the language of choice for fifth-generation computers.

Like Lisp, Prolog is a symbolic language it uses words (called "atoms") to represent and manipulate concepts.

Prolog for the ST
Product Price Ver.
Extended Prolog
Rational Vision
No further upgrades planned.
$39.95 4.1

Logo
Logo is a high-level interpreted language developed in the 1970s by Seymour Papert of MIT. Like Pascal and APL, Logo was designed to teach programming concepts. Papert, however, had a very different audience in mind. Logo was developed to introduce children to programming concepts. Using sound, color and turtle-shaped cursors, Logo develops a child's creativity, planning and problem-solving skills.

The earliest versions of Logo controlled a simple; dome-shaped robot. Students pasted a tail to the back of it and called it a turtle Later versions depicted a triangular cursor that could draw simple pictures. Current implementations use several turtle-shaped cursors which can be programmed to draw multi-color pictures.

Much more than a vehicle for artistic amphibians, Logo is a very close relative of Lisp. If you're familiar with Lisp, you can learn Logo in a day or less. Once we leave the turtles, Logo's command set looks and performs very much like its Lisp counterpart.

See Seymour Papert's Mindstonns for a detailed look at the theories and concepts behind Logo.

(Editor's Note: Logo was shipped with the earlier versions of the ST; however, Atari is no longer supporting this product.)

COBOL
COBOL (COmmon Business Oriented Language) is a popular high-level compiled language used widely in businesses. Developed in the late 1950s, it was one of the first languages designed to run on a variety of machines.

COBOL statements are written in abbreviated English. A sample statement might look like this:

MULTIPLY TIME-SPENT BY VELOCITY GIVING DISTANCE ROUNDED


COBOL
statements
are easily
understood but
produce mammoth
listings.

Such statements are easily understood but produce mammoth listings. Back in the days of Hollerith punch cards, the APL programmer could carry a program in a shirt pocket; the COBOL programmer needed two or three large boxes.

A COBOL program has four parts: an Identification Division, an Environment Division, a Data Division and a Procedure Division. The Identification Division is one line which contains the name of the program. The Environment Division links the Data Division and the Procedure Divisions with whatever equipment will be used (such as disk drive C:\ or Laser Printer#5). The Data Division names all the files to be used in the program, and also describes the file format. The Procedure Division contains the instructions to be performed.

COBOL for the ST
Product Price Ver.
Cobol/MST
Castech Software
for further information, contact Castech.
N/A N/A

If Done, Then End Article
Just as human languages in many ways project a cultural world view, computer languages inherently represent an approach to solving a problem. Understanding the paradigms of each language is the first step in successful programming.

Charles Jackson is the former Technical Editor of Antic Magazine and Online Editor of Antic Online. He is now a Staff Editor for the Technical Publications division of Excelan Corp. in San Jose, California.

REFERENCES
The C Programming Language, $26.67, by Brian W. Kernighan and Dennis M. Ritchie, 1978. Prentice-Hall, Inc., Route 9W, Englewood Cliffs, NJ 07632, (201) 592-2000.

APL, by Ken Iverson. No longer in print.

The Little Lisper, $12.95. MIT, 55 Hayward Street, Cambridge, MA 02142, (800) 356-0343.

Mindstorms, $8.95,
Basic Books (a subdivision of Harper and Row), 10 E. 53rd Street, New York, NY 10022, (800) 424-7734.

PRODUCTS MENTIONED

Abacus, 5370 57th St., SE, Grand Rapids, Ml 49512, (616) 698-0330.
CIRCLE 172 ON READER SERVICE CARD

ana-systems, 1155 Chess Drive, Bldg. D, Suite E, Foster City, CA 94404, (415) 341-1768.
CIRCLE 173 ON READER SERVICE CARD

Antic Software, 544 Second Street, San Francisco CA 94107, (415) 957-0886, (800) 234-7001.

Atari Corp., 1196 Borregas Ave., Sunnyvale CA 94086, (408) 745-2000.

Castech Software Systems, P.O. Box 147, Grand-view, MO 64030, (816) 767-1233.
CIRCI.E 178 ON READER SERVICE CARD

Dragon Group, 148 Poca Folk Road, Elkview, WV 25071, (304) 965-5517.
CIRCLE 176 ON READER SERVICE CARD

lCD, 1220 Rock Street, Rock-ford, IL 61101, (815) 968-2228.
CIRCLE 180 ON READER SERVICE CARD

Looking Glass Software, 124 King Street N., Waterloo, Ontario, Canada N2J 2X8, (519) 884-7473.
CIRCLE I77 ON READER SERVICE CARD

Manx, Box 55, Shrewsbury, NJ 07702, (201) 542-2121.
CIRCLE 179 ON READER SERVICE CARD

Mark Williams, 601 N. Skoki Hwy., lake Bluff, IL 60044, (312) 689-2300.
CIRCLE 169 ON READER SERVICE CARD

Megamax, 1200 E. Collins, Suite 214, Richardson, TX 75081, (214) 699-7400.
CIRCLE 171 ON READER SERVICE CARD

MichTron, 5765. Telegraph, Pontiac, Ml 48053, (313) 334-5700.
CIRCLE 162 ON READER SERYICE CARD

Pecan, 1410 39th Street, Brooklyn, NY 11218, (718) 851-3100.
CIRCLE 181 ON READER SERVICE CARD

Prospero Software, 100 Commercial Street, Suite 306, Portland, ME 04101. (207) 874-0382.
CIRCLE 170 ON READER SERVICE CARD

Rational Vision, 7111 W. Indian School Road, Phoenix, AZ 85033, (602) 846-0371.
CIRCLE 175 ON READER SERVICE CARD

Spencer Organization, 366 Kinderkamack Road, Westwood, NJ 07675, (201) 666-6011.
CIRCLE 174 ON READER SERVICE CARD