The use of macro languages is increasingly common in software engineering. Many industrial control systems incorporate one or more such languages for the logical processing of sensory inputs and the setting of outputs. A built-in macro language can perform high level manipulations with relatively simple statements, because of the special assumptions underlying the environments in which they operate. The ultimate value of a macro language in a software product is that it affords the end-user the ability to tailor the product to specific needs that could not be foreseen directly by the designer. The benefits of this accrue both to the designer, who need not maintain myriad versions of the product, and to the end-user, who can obtain specialized benefits from the software without requesting a special development of the designer.
In software engineering, a macro language is simply a procedural language, with its own rules of syntax, in a structured environment. A language such as Java, commonly used for Internet "applets", could also be considered to be a macro language from this standpoint. What is common to virtually all of these situations is that, usually, the language is executed by an interpreter. That is, the program text is parsed at run time, and then, based on the branches taken by the parser, a so-called "interpreter engine" performs the specified logic. There can be advantages to an interpreted language. First, the complexity of the program is defined by the complexity of the parser. The interpreter engine can be written in a higher level language. Second, since text can be ported easily between computer platforms, an interpreted language program can be run without change, on any computer platform or operating system for which there exists an interpreter engine. The primary disadvantage to an interpreted language is slow execution. An alternative and more traditional approach is a so-called "compiled" language. In a compiled language, a pre-processor, called a compiler, parses the program text and produces a so-called "binary executable file" which consists of a sequence of machine language statements that can be executed directly by the CPU. That is, the binary executable file stands alone at execution time. It executes itself. The primary disadvantages of a compiled language are the opposite of the advantages of an interpreted language. First, the machine language syntax that should replace a parsed phrase can be extremely difficult to design. Second, the very nature of the binary executable file is to be computer platform and operating system dependent. The primary advantage of a compiled language over an interpreted one is speed of execution, often by at least an order of magnitude. This can be a critical factor for a procedure.
An intermediate alternative approach is to substitute integer codes (also called byte codes) for different statement types. In this case, a pre-processor performs the language syntax parsing task once and replaces text (or symbolic) statements with the coded versions. This approach requires that an execution "engine" read the integer codes and perform the required actions based on the actual code values. While this algorithm retains platform independence and is faster than an interpreted program, it is somewhat slower than a true compiled version, because of the number of cases that must be traversed during execution of the program.