ECL programming language

Last updated

The ECL programming language and system were an extensible high-level programming language and development environment developed at Harvard University in the 1970s. The name 'ECL' stood for 'Extensible Computer Language' or 'EClectic Language'. Some publications used the name 'ECL' for the system as a whole and EL/1 (Extensible Language) for the language.

Contents

ECL was an interactive system where programs were represented within the system; there was a compatible compiler and interpreter. It had an ALGOL-like syntax and an extensible data type system, with data types as first-class citizens. Data objects were values, not references, and the calling conventions gave a choice between call by value and call by reference for each argument.

ECL was primarily used for research and teaching in programming language design, programming methodology (in particular programming by transformational refinement), and programming environments at Harvard, though it was said to be used at some government agencies as well. It was first implemented on the PDP-10, with a later (interpreted-only) implementation on the PDP-11 written in BLISS-11 and cross-compiled on the PDP-10.

Procedures and bind-classes

An ECL procedure for computing the greatest common divisor of two integers according to the Euclidean algorithm could be defined as follows:

gcd<-EXPR(m:INTBYVAL,n:INTBYVAL;INT)BEGINDECLr:INT;REPEATr<-rem(m,n);r=0=>n;m<-n;n<-r;END;END

This is an assignment of a procedure constant to the variable gcd. The line

EXPR(m:INT BYVAL, n: INT BYVAL; INT)

indicates that the procedure takes two parameters, of type INT, named m and n, and returns a result of type INT. (Data types are called modes in ECL.) The bind-classBYVAL in each parameter declaration indicates that that parameter is passed by value. The computational components of an ECL program are called forms. Some forms resemble the expressions of other programming languages and others resemble statements. The execution of a form always yields a value. The REPEAT ... END construct is a loop form. Execution of the construct

r = 0 => n

when the form r = 0 evaluates to TRUE causes execution of the loop to terminate with the value n. The value of the last statement in a block (BEGIN ... END) form becomes the value of the block form. The value of the form in a procedure declaration becomes the result of the procedure call.

In addition to the bind-class BYVAL, ECL has bind-classes SHARED, LIKE, UNEVAL, and LISTED. Bind-class SHARED indicates that a parameter is to be passed by reference. Bind-class LIKE causes a parameter to be passed by reference if possible and by value if not (e.g., if the actual parameter is a pure value, or a variable to which a type conversion must be applied). Bind-class UNEVAL specifies that an abstract syntax tree for the actual parameter is to be passed to the formal parameter; this provides extraordinary flexibility for programmers to invent their own notations, with their own evaluation semantics, for certain procedure parameters. Bind-class LISTED is similar to UNEVAL, but provides a capability similar to that of varargs in C: the LISTED bind-class can only appear in the last formal parameter of the procedure, and that formal parameter is bound to a list of abstract syntax tree representations, one for each remaining actual parameter. ECL has an EVAL built-in function for evaluating an abstract syntax tree; alternatively, there are functions by which programmers can explore the nodes of the abstract syntax tree and process them according to their own logic.

See also

Related Research Articles

Scheme (programming language) Dialect of Lisp

Scheme is a minimalist dialect of the Lisp family of programming languages. Scheme consists of a small standard core with several tools for language extension.

In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer.

GNU Bison, commonly known as Bison, is a parser generator that is part of the GNU Project. Bison reads a specification in the BNF notation, warns about any parsing ambiguities, and generates a parser that reads sequences of tokens and decides whether the sequence conforms to the syntax specified by the grammar.

In computer programming, the interpreter pattern is a design pattern that specifies how to evaluate sentences in a language. The basic idea is to have a class for each symbol in a specialized computer language. The syntax tree of a sentence in the language is an instance of the composite pattern and is used to evaluate (interpret) the sentence for a client. See also Composite pattern.

A method in object-oriented programming (OOP) is a procedure associated with a message and an object. An object consists of data and behavior; these compose an interface, which specifies how the object may be utilized by any of its various consumers.

An attribute grammar is a formal way to supplement a formal grammar with semantic information processing. Semantic information is stored in attributes associated with terminal and nonterminal symbols of the grammar. The values of attributes are result of attribute evaluation rules associated with productions of the grammar. Attributes allow to transfer information from anywhere in the abstract syntax tree to anywhere else, in a controlled and formal way.

In computer programming, ?: is a ternary operator that is part of the syntax for basic conditional expressions in several programming languages. It is commonly referred to as the conditional operator, inline if (iif), or ternary if. An expression a ? b : c evaluates to b if the value of a is true, and otherwise to c. One can read it aloud as "if a then b otherwise c".

IMP is an early systems programming language that was developed by Edgar T. Irons in the late 1960s through early 1970s, at the National Security Agency (NSA). Unlike most other systems languages, IMP supports syntax-extensible programming.

In mathematics and in computer programming, a variadic function is a function of indefinite arity, i.e., one which accepts a variable number of arguments. Support for variadic functions differs widely among programming languages.

The computer programming languages C and Pascal have similar times of origin, influences, and purposes. Both were used to design their own compilers early in their lifetimes. The original Pascal definition appeared in 1969 and a first compiler in 1970. The first version of C appeared in 1972.

Recursion (computer science) Use of functions that call themselves

In computer science, recursion is a method of solving a computational problem where the solution depends on solutions to smaller instances of the same problem. Such problems can generally be solved by iteration, but this needs to identify and index the smaller instances at programming time. Recursion solves such recursive problems by using functions that call themselves from within their own code. The approach can be applied to many types of problems, and recursion is one of the central ideas of computer science.

The power of recursion evidently lies in the possibility of defining an infinite set of objects by a finite statement. In the same manner, an infinite number of computations can be described by a finite recursive program, even if this program contains no explicit repetitions.

S-algol is a computer programming language derivative of ALGOL 60 developed at the University of St Andrews in 1979 by Ron Morrison and Tony Davie. The language is a modification of ALGOL to contain orthogonal data types that Morrison created for his PhD thesis. Morrison would go on to become professor at the university and head of the department of computer science. The S-algol language was used for teaching at the university at an undergraduate level until 1999. It was also the language taught for several years in the 1980s at a local school in St. Andrews, Madras College. The computer science text Recursive Descent Compiling describes a recursive descent compiler for S-algol, implemented in S-algol.

In functional programming, a generalized algebraic data type is a generalization of parametric algebraic data types.

In computer programming, an anonymous function is a function definition that is not bound to an identifier. Anonymous functions are often arguments being passed to higher-order functions or used for constructing the result of a higher-order function that needs to return a function. If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in functional programming languages and other languages with first-class functions, where they fulfil the same role for the function type as literals do for other data types.

This article describes the syntax of the C# programming language. The features described are compatible with .NET Framework and Mono.

In Lisp programming languages, a fexpr is a function whose operands are passed to it without being evaluated. When a fexpr is called, only the body of the fexpr is evaluated; no other evaluations take place except when explicitly initiated by the fexpr. In contrast, when an ordinary Lisp function is called, the operands are evaluated automatically, and only the results of these evaluations are provided to the function; and when a (traditional) Lisp macro is called, the operands are passed in unevaluated, but whatever result the macro function returns is automatically evaluated.

Nemerle is a general-purpose, high-level, statically typed programming language designed for platforms using the Common Language Infrastructure (.NET/Mono). It offers functional, object-oriented and imperative features. It has a simple C#-like syntax and a powerful metaprogramming system. In June 2012, the core developers of Nemerle were hired by the Czech software development company JetBrains. The team is focusing on developing Nitra, a framework to implement extant and new programming languages. This framework will likely be used to create future versions of Nemerle.

In computer programming, a subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed.

PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM DB 2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.

Seed7 is an extensible general-purpose programming language designed by Thomas Mertes. It is syntactically similar to Pascal and Ada. Along with many other features, it provides an extension mechanism. Seed7 supports introducing new syntax elements and their semantics into the language, and allows new language constructs to be defined and written in Seed7. For example, programmers can introduce syntax and semantics of new statements and user defined operator symbols. The implementation of Seed7 differs significantly from that of languages with hard-coded syntax and semantics.

References

PISEL = Proceedings of the international symposium on Extensible languages, Grenoble, France, 1971, published in ACM SIGPLAN Notices6:12, December 1971.