# ECL programming language

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/ECL_programming_language
> Markdown URL: https://mediated.wiki/source/ECL_programming_language.md
> Source: https://en.wikipedia.org/wiki/ECL_programming_language
> Source revision: 1071126855
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Extensible programming language system

Not to be confused with [ECL (data-centric programming language)](/source/ECL_(data-centric_programming_language)).

This article includes a list of references, related reading, or external links, but its sources remain unclear because it lacks inline citations. Please help improve this article by introducing more precise citations. (September 2017) (Learn how and when to remove this message)

The **ECL** programming language and system were an [extensible](/source/Extensible_programming) high-level [programming language](/source/Programming_language) and [development environment](/source/Integrated_Development_Environment) developed at [Harvard University](/source/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.

ECL was an interactive system where programs were represented within the system; there was a compatible [compiler](/source/Compiler) and [interpreter](/source/Interpreter_(computing)). It had an [ALGOL](/source/ALGOL)-like syntax and an extensible [data type](/source/Data_type) system, with data types as [first-class citizens](/source/First-class_citizen). Data objects were values, not references, and the calling conventions gave a choice between [call by value](/source/Call_by_value) and [call by reference](/source/Call_by_reference) for each argument.

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

## Procedures and bind-classes

An ECL procedure for computing the [greatest common divisor](/source/Greatest_common_divisor) of two integers according to the [Euclidean algorithm](/source/Euclidean_algorithm) could be defined as follows:

 gcd <-
   EXPR(m:INT BYVAL, n: INT BYVAL; INT)
   BEGIN
     DECL r:INT;
     REPEAT
       r <- 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-class* BYVAL in each parameter declaration indicates that that parameter is passed [by value](/source/Call_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](/source/Parameter) is to be passed [by reference](/source/Call_by_reference). Bind-class LIKE causes a parameter to be passed [by reference](/source/Call_by_reference) if possible and [by value](/source/Call_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](/source/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](/source/Varargs) in [C](/source/C_(programming_language)): 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](/source/Abstract_syntax_tree) representations, one for each remaining actual parameter. ECL has an EVAL built-in function for evaluating an [abstract syntax tree](/source/Abstract_syntax_tree); alternatively, there are functions by which programmers can explore the nodes of the [abstract syntax tree](/source/Abstract_syntax_tree) and process them according to their own logic.

## See also

- [Fexpr](/source/Fexpr)

## References

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

- Benjamin M. Brosgol, "An implementation of ECL data types", PISEL, pp. 87–95.

- [Thomas E. Cheatham, Jr.](https://en.wikipedia.org/w/index.php?title=Thomas_E._Cheatham,_Jr.&action=edit&redlink=1), Glenn H. Holloway, Judy A. Townley, "Program refinement by transformation", *Proceedings of the 5th international conference on Software engineering*, 1981, pp. 430–437. [ISBN](/source/ISBN_(identifier)) [0-89791-146-6](https://en.wikipedia.org/wiki/Special:BookSources/0-89791-146-6)

- Glenn H. Holloway, "Interpreter/compiler integration in ECL", PISEL, pp. 129–134.

- Charles J. Prenner, "The control structure facilities of ECL", PISEL, pp. 104–112.

- Ben Wegbreit, "An overview of the ECL programming system", PISEL, pp. 26–28.

- Ben Wegbreit, "Studies in extensible programming languages." Technical Report ESD-TR-70-297. Harvard University, Cambridge, Massachusetts, May 1970.

- Glenn Holloway, Judy Townley, Jay Spitzen, Ben Wegbreit, "ECL Programmer's Manual", Report 23-74, Center for Research in Computing Technology, Harvard University, December 1974.

- Larry Denenberg, "The implementation of PDP-11 ECL", Technical Report 29-77, Center for Research in Computing Technology, Harvard University, June 1977.

---
Adapted from the Wikipedia article [ECL programming language](https://en.wikipedia.org/wiki/ECL_programming_language) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/ECL_programming_language?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
