(edited 1-Jun) (Choosing a Programming Language\int_lang_chap)

Whenever you plan to write a program, you must first decide on the programming language that you will use, since most computer systems support several. After you have chosen the language, you must design and code your program using appropriate language statements, carefully following formatting rules and restrictions. Finally, you must use the corresponding language processor to convert your program statements into a format suitable for execution. (High-Level Versus Machine-Level Languages )

Hundreds of programming languages have been developed for computer systems. Some languages can be used only for specific applications or with a particular computer system. Other languages are general purpose; they are suitable for a variety of problem-solving situations and, in addition, are easier to learn and use. The languages demonstrated in this manual include two well-known and widely used high-level programming languages (BASIC--PLUS and FORTRAN) and one RT--11 system-specific machine-level programming language (MACRO--11). Throughout the (int_book), FORTRAN means FORTRAN IV and FORTRAN--77. Information that applies to both compilers uses the term FORTRAN. Information specific to either compiler uses the specific compiler name.

Also, references to FORTRAN--77 mean FORTRAN--77/RT--11 and references to BASIC--PLUS mean BASIC--PLUS/RT--11.

High-level languages, like BASIC--PLUS and FORTRAN, are easier to learn and use. You write programs by using language statements that need not deal with the specifics of the computer system. The language processor -- and perhaps other utility programs as well -- handles all conversions that are necessary for program execution. Since a single high-level language statement may perform several computer operations and, since you need not be concerned or familiar with the structure of the computer and peripheral devices, you can concentrate solely on solving the problem at hand. The language processor takes care of translating the statements into computer information.

Thus, high-level languages are considered machine-independent because a program written in the language can usually be compiled, linked, and executed on a different computer system (that supports the language) with few, if any, modifications.

Machine-level languages, on the other hand, such as the assembly language MACRO--11, require that you know about the computer and the peripheral devices and how they work together. You write programs in formats that are closer to those required for execution. Since a single machine-level language statement usually performs only one computer operation, you must account in your program for each computer operation that will be required.

For this reason, machine-level languages are machine-dependent languages. The program is coded in a format that is not usually interchangeable among systems. Machine-level language programs can be more efficient because the knowledgeable programmer can choose the fastest and most precise instructions for getting a job done.

(lang_comp_tab) lists a comparison of high-level versus machine-level languages. (Language Comparisons\lang_comp_tab) (2\30) (High-Level\Machine-Level) (Easy to learn and use; no experience required\More difficult to learn and use; familiarity with the computer system required) (Machine-independent\Machine-dependent) (Many hidden conversions necessary for program execution; more computer memory is used\Only direct translation is necessary for program execution; less computer memory is used) (Slower execution time\Faster execution time) (Less efficient; the system makes decisions concerning computer operations\More efficient; the programmer makes decisions concerning computer operations) (Easier to debug (find and fix errors)\Harder to debug (find and fix errors)) (Easier to understand programs; functions added with less difficulty\Harder to understand programs; functions added with greater difficulty)

Beginning programmers, students, commercial applications programmers, and the casual computer user prefer high-level languages because they are less difficult to learn and to use, and they produce fast results. System programmers, on the other hand, may prefer machine-level languages for writing programs (those that make up an operating system, for example) that must often be as fast and efficient as possible.

The designers of a computer system generally select programming languages that will satisfy and suit the current (or perhaps potential) system user environment. The RT--11 computer system is used in many environments: education, business, laboratory, and so on. Some of its applications include data acquisition and analysis, record keeping, control systems, and learning through computer simulation. RT--11 programmers and users include both the very knowledgeable and the student/beginner.

To satisfy the varied requirements of these environments, several programming languages run under RT--11:

(2\20) (High-Level\Machine-Level) (BASIC--PLUS\MACRO--11) (C\) (DIBOL\) (FORTRAN IV\) (FORTRAN--77\) (PASCAL\)

Whenever you choose one or more of these programming languages for your own use, consider the following criteria: (unnumbered) What is your programming experience? What languages do you already know? How much time do you have to learn a new language? For what applications will you use the language? How important are program speed and efficiency? Will you use your program on any other computer systems?

If you are already familiar with a language supported by the system, you may prefer to continue using that language rather than spend time learning a new one. However, if you want to learn a language, consider your application. High-level languages handle most programming jobs. Unless you plan to write extremely detailed or time-critical programs, you should select a high-level language.

If you are a beginning programmer, you may prefer to start with a language like BASIC--PLUS, which is a conversational, interactive language. Language statements are simple, English-like words and common mathematical expressions. You can request immediate answers to problems by using the immediate modes of the language or you can create detailed programs by combining single language statements into larger segments. BASIC--PLUS is a superset of the industry-standard BASIC developed at Dartmouth College. (int_bas_chap) of this manual describes BASIC--PLUS in more detail.

FORTRAN has long been recognized for its use in the scientific field; in addition, it is one of the most commonly supported languages across systems. You may decide to choose FORTRAN because it is a more powerful language than BASIC--PLUS. (int_fort_chap) describes FORTRAN in more detail.

Finally, if you are an experienced user, you may select the machine-level programming language MACRO--11. This powerful language lets user programs access and utilize every feature available on the RT--11 computer system. The language requires a considerable amount of computer experience and knowledge to be used effectively, however. The MACRO--11 language is best for you if you are a system programmer or an experienced high-level language programmer. It is described in more detail in (int_macro_chap). (Choosing a Language for the Demonstration\lang_choos_sec )

Three RT--11 programming languages are demonstrated in the following chapters: FORTRAN, BASIC--PLUS, and MACRO--11. Each language requires that one or more files reside on your system. Only the files required to demonstrate MACRO--11 are distributed with RT--11. The other language processors are optional, and you should be sure your system includes the appropriate files before attempting the demonstration for a programming language.

The required files for each programming language are:

(3\16\16) (Language\Required Files\Description) (FORTRAN IV\FORTRA.SAV\Compiler for FORTRAN IV) (\FORLIB.OBJ\Routine library for FORTRAN IV) (\SYSLIB.OBJ\RT--11 subroutine library) (\LINK.SAV\RT--11 linker) (FORTRAN--77\F77XM.SAV\Compiler for FORTRAN--77 under mapped monitors) (\F77.SAV\Compiler for FORTRAN--77 under unmapped monitors) (\F77COM.MSG\Error message file) (\F77OTS.OBJ\Routine library for FORTRAN--77) (\SYSLIB.OBJ\RT--11 subroutine library) (\LINK.SAV\RT--11 linker) (BASIC--PLUS\BASIC.SAV\Interpreter (compiler) for BASIC--PLUS) (MACRO--11\MACRO.SAV\Assembler for MACRO--11) (\SYSMAC.SML\Routine library for MACRO--11) (\LINK.SAV\RT--11 linker) (\CREF.SAV\Cross-reference table utility)

Select one or more languages to continue the demonstration. If you choose FORTRAN, see (int_fort_chap). If you choose BASIC--PLUS, see (int_bas_chap). If you choose MACRO--11, see (int_macro_chap).