REC(ID:5615/rec002)


Regular Expression Compiler


Related languages
CONVERT => REC   Compiler constructed with
REC => REC/C   Extension of
REC => REC/R   Extension of
REC => REC/SM   Implementation

References:
  • McIntosh, H., "A CONVERT Compiler of REC for the PDP-8", Acta Mexicana de Cienciay Tecnologia, Vol. 2, No. 1, Jan-April 1968, pp. 33-43. view details
  • Navlakha, Jainendra K. "REC/SM: a semi structured programming language" view details Abstract: Regular Expression Compiler (REC) is a programming language of extremely simple structure. It is a goto-less language which has very appealing transfer of control operations. It is a generalized language which can be implemented for special purpose applications by a proper choice of operators and predicates. This paper describes REC language and one of its "symbol manipulation" implementations, REC/SM. The language has been enormously successful from the users satisfaction point of view. And like BLISS, it has once again proved that the well-publicized inconvenience of programming without a goto is a myth. Extract: Introduction
    Introduction
    Regular Expression Compiler (REC) language is a generalized programming language which can be implemented in various specific forms as required for special purpose applications. In this paper, we informally describe REC and one of its implementations REC/SM (Symbolic Manipulation) language. REC is a goto-less language which was developed in the late sixties at MIT as part of Project MAC. That means, the language was around when the structured programming concepts were being developed. Unfortunately, it has not been reported well in the literature, and hence the computing community has essentially remained unaware of its presence. REC/SM is being used by computer programmers in various government centers, and by a large group of students in some of the major universities in Mexico for almost a decade.

    It has been noted that the formal systems of computability theory, for example, Church's Lambda Calculus, Markov Algorithms, the Post systems, etc., do not require the notion of a goto-statement. But it has been included in most of the programming languages designed from these theories mainly because it makes programming convenient, or so it seems. However, the success of languages without the goto-statement indicates that once the programmers pass a rather brief and painless adaptation period, they find that lack of goto is not a handicap.

    BLISS was one such language, and its success caused Wulf to report that "the purported inconvenience of programming without a goto is a myth". The experiences of users of REC language, and its special implementations have been similar to that of BLISS users. Because of their familiarity with languages with goto statement, there were minor problems in the adaptation period. But once they were overcome, the users discovered the scope and effect of the language on their thinking process, and found to their amazement that the quality of programs they wrote, was considerably improved. Some of the major programs developed in REC/SM are an IMLAC assembler, a plotter package, a verifier to verify information in a file, scores of systems programs, and so on. Extract: The REC Language
    REC is a programming language of simple structure, which was first developed at MIT as part of Project MAC for PDP-8, but its simple structure makes it adaptible for any digital computer. A REC-program consists of a series of RECexpressions. […]

    Parentheses denote a single REC expression, which is to be treated as one unit. Concatenation is implied by writing expression in sequence, e.g., ~8. Colon [:] implies iteration of all that part of the REC expression which precedes it. Semicolon [;] terminates the concatenation of a string. The large period [o] indicates a choice between continuing to concatenate the following expressions, or to pass over them until the next following colon or semicolon (if any) of the same parenthesis level is reached. Moreover, such a choice is always implied following every parenthesized expression. Thus, parentheses in REC expressions are used in a very technical sense, and are not meant to denote any grouping. In fact, REC parenthesization is nonassociative. Thus, REC has four control characters, ( ) : and ; McIntosh has established a i-I correspondence between a REC expression and a regular expression. This correspondence serves to demonstrate that the totality of REC expressions is no more nor less general than the totality of regular expressions. Our basic aim is to use these REC expressions to control the operation of a digital computer. Towards that end, we let the letters or symbols of the REC alphabet denote individual operations required for a specific application. A sequence of these symbols, or words of the REC alphabet, will then correspond to a sequence of operations, carried out in the order specified. Extract: Conclusions
    CONCLUSIONS:
    Knuth, in one of his famous articles says: "my dream is that by 1984 we will see a consensus developing for a really good programming language (or more likely, a coherent family of languages)." The new language UTOPIA 84 may be designed and developed in time by making use of all the available resources at hand, and perhaps some new radical ideas, too. In my opinion, the structure of REC language has much to offer in achieving such a design.

    The language has been enormously successful from the user'satisfaction point of view. And, it has once again proved the nonessentiality of a goto statement in a programming language. It is one added proof that the well publicized inconvenience of programming without a goto is a myth.

    Some of the shortcomings of the current version of REC/SM as implemented at Centro de Procesamiento, Dr. Arturo Rosenblueth in Mexico City, are discussed below. First, the current version of REC/SM tends to give rise to very cryptic programs. One possible solution is to have multiple character operators and predicates, and names of subroutines. This feature is being implemented presently. I am not very sure that this will eliminate the crytic nature of REC programs totally. Certain documentation criteria must be followed when developing REC programs. Secondly, the REC/SM compiler does not produce any cross reference listing, which makes it very difficult to debug a program. Also, the compiler messages are not accurate enough, and do not pinpoint the statement in error. However, these are implementation details which can be taken care of using existing techniques, and an attempt is being made in that direction. They do not in any way, take anything away from the language itself.
          in Proceedings of the 18th ACM Southeast Regional Conference 1980, Tallahassee, Florida view details
  • McIntosh, Harold V. and Cisneros, Gerardo "The programming languages REC and Convert" pp81-94 view details Abstract: Two symbol manipulation languages are presented. REC (an acronym for Regular Expression Compiler) is a very compact language possessing a simple control structure. CONVERT is a pattern matching and substitution language well suited to problems whose solution may conveniently be expressed in terms of transformation rules. REC is useful when conciseness is required. such as for microcomputers with limited memory, interactive programming via the keyboard, and so on. Its present form was carefully chosen to facilitate the compilation of CONVERT programs while still preserving a universal appearance. In turn, CONVERT is a natural alternative to consider for an application which is already expressed in terms of transformation rules, as are many compilers, assemblers and symbol manipulation systems. This article primarily describes the appearance of these two languages, but some of the applications which they have been given are mentioned.
          in [SIGPLAN] SIGPLAN Notices 25(07) July 1990 view details
  • Cisneros, Gerardo "Configurable REC" view details
          in ACM SIGPLAN Notices 29 May 1995 view details
  • McIntosh, Harold V. "REC/C for Complex Arithmetic" Departamento de Aplicación de Microcomputadoras, Instituto de Ciencias, Universidad Autónoma de Puebla, Puebla, México; January 20, 2001 view details Extract: the programming language REC
    the programming language REC
    The programming language REC was derived from LISP over a period of time, and found to be useful for minicomputers such as Digital Equipment's PDP-8, or early microprocessors such as the IMSAI or Polymorphic 88, given its extreme conciseness. That, in fact, is the reason why it is still preserved as an interface to programs written in other languages running with other operating systems.

    REC itself is strictly a control structure, using parentheses to group sequences of instructions which are supposed to be executed in order -- in other words, programs. The instructions themselves, which are subdivided into operators and predicates, are not part of the control structure, but are always defined separately to create specialized variants on REC.

    Besides the use of parentheses for aggrupation, the two punctuation marks, colon and semicolon, are used for repetition and termination, respectively; they were somewhat borrowed from musical notation. Spaces, tabs, all the C "white space,'' are used for cosmetic purposes and must be ignored.

    There is also a mechanism for defining subroutines; definitions and their associated symbols alternate between a balanced pair of curly brackets, terminating in a main program which remains nameless. Definitions so introduced are valid only within their braces, permitting symbols to be reused over and over again on different levels and in different places. A subroutine is actually executed by prefacing its name with an "at sign,'' as in @x.

    The distinction between operators and predicates is somewhat artificial, made mostly for convenience; a predicate which is always true is an operator. The values true and false of a predicate govern the sequence of operations, true meaning that the text of the program continues to be read in order, consecutively from left to right.

    But false makes use of the punctuation, implying a skip to the next colon, semicolon, (or right parenthesis, in their absence) at the same parenthesis level. A colon means repetition starting back at the left parenthesis, a semicolon gives a true termination, realized by going forward to the closing right parenthesis, Arriving at a right parenthesis without the benefit of punctuation gives a false termination, but more generally inverts the action of predicates enclosed in such an interval.

    This convention allows negating a predicate: (p) behaves oppositely from p. The other boolean combinations of predicates are easily written; "p and q'' translates into (pq;), "p or q'' into (p;q;). Moreover, all programs are predicates, even the main program, thereby reporting their results to the next higher program level, the one in which they occur as a subroutine.

    REC/C uses about forty operators, of which only the counter !n! and some comparisons are predicates. They are more easily remembered if they are broken down into specific classes, such as the arithmatical operations, or the evaluation of some predefined functions. The central operating element of REC/C is a pushdown list onto which complex constants will be gathered, later to be evaluated, consulted, or replaced by the results of diverse calculations. The flow of data in and around the stack is shown in figure 7.
          in ACM SIGPLAN Notices 29 May 1995 view details
  • McIntosh, Harold V. "REC-R for Second Order Real Differential Equations" Departamento de Aplicación de Microcomputadoras, Instituto de Ciencias, Universidad Autónoma de Puebla, Puebla, México; January 8, 2001 view details
          in ACM SIGPLAN Notices 29 May 1995 view details
    Resources