Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
CLU (programming language)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Type of programming language}} {{more citations needed|date=February 2013}} {{Infobox programming language |name = CLU |logo = |paradigm = [[Multi-paradigm programming language|multi-paradigm]]: [[Object-oriented programming|object-oriented]], [[Procedural programming|procedural]] |released = {{Start date and age|1975}} |designer = [[Barbara Liskov]] and her students |developer = [[Massachusetts Institute of Technology]] |latest release version = Native CLU 1.5 ([[SPARC]], [[VAX]]) / {{Start date and age|1989|05|26}}<ref name="Native">{{cite web |url=http://pmg.csail.mit.edu/~dcurtis/clu/ |title=CLU home page |website=Programming Methodology Group, Computer Science and Artificial Intelligence Laboratory |publisher=Massachusetts Institute of Technology |first=Dorothy |last=Curtis |date=2009-11-06 |access-date=2016-05-26}}</ref><br /> Portable CLU / {{Start date and age|2009|11|06}}<ref name="Portable">{{cite web |url=ftp://ftp.lcs.mit.edu/pub/pclu |title=Index of /pub/pclu |website=Programming Methodology Group, Computer Science and Artificial Intelligence Laboratory |publisher=Massachusetts Institute of Technology |first=Dorothy |last=Curtis |date=2009-11-06 |archive-url=https://web.archive.org/web/20210621151848/ftp://ftp.lcs.mit.edu/pub/pclu |archive-date=2021-06-21 |url-status=dead |access-date=2016-05-26}}</ref> |latest release date = |typing = [[Strong typing|strong]] |website = {{URL|pmg.csail.mit.edu/CLU.html}} |implementations = PDP-10 CLU,<ref>{{cite web |title=CLU files, 1976β1989 |work=Tapes of Tech Square (ToTS) collection, MC-0741 |publisher=Department of Distinctive Collections, Massachusetts Institute of Technology |url=https://github.com/MITDDC/clu-1976-1989 |id=[https://archive.softwareheritage.org/swh:1:dir:5dc935d1c236b15a99b0750cf236b2d89ec951d0 swh:1:dir:5dc935d1c236b15a99b0750cf236b2d89ec951d0]}}</ref> Native CLU,<ref name="Native" /> Portable CLU,<ref name="Portable" /> clu2c<ref name="clu2c">{{cite web |url=http://woodsheep.jp/clu2c.html |title=clu2c |website=clu2c |publisher=woodsheep.jp |first=Tetsu |last=Ushijima |date=<!--Likely embedded in downloadable target or zip files.--> |access-date=2016-05-26}}</ref> |dialects = |influenced by = [[ALGOL 60]], [[Lisp (programming language)|Lisp]], [[Simula]], [[Alphard (programming language)|Alphard]] |influenced = [[Ada (programming language)|Ada]], [[Argus (programming language)|Argus]], [[C++]],<ref name="history-of-cpp">{{cite book |last1=Stroustrup |first1=Bjarne |title=A History of C++: 1979--1991 |date=1996 |publisher=Association for Computing Machinery |location=New York, NY, USA |pages=699β769 |doi=10.1145/234286.1057836 |url=https://doi.org/10.1145/234286.1057836 |access-date=25 March 2022}}</ref> [[Lua (programming language)|Lua]], [[Python (programming language)|Python]],<ref name="effbot-call-by-object">{{cite web |url=http://effbot.org/zone/call-by-object.htm |title=Call By Object |work=effbot.org |last=Lundh |first=Fredrik |quote=replace "CLU" with "Python", "record" with "instance", and "procedure" with "function or method", and you get a pretty accurate description of Python's object model. |access-date=21 November 2017 |archive-date=23 November 2019 |archive-url=https://web.archive.org/web/20191123043655/http://effbot.org/zone/call-by-object.htm |url-status=dead }}</ref> [[Ruby (programming language)|Ruby]], [[Sather]], [[Swift (programming language)|Swift]]<ref name="lattner2014">{{cite web |url=http://nondot.org/sabre/ |title=Chris Lattner's Homepage |last=Lattner |first=Chris |date=2014-06-03|access-date=2014-06-03 |publisher=Chris Lattner |quote=The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.}}</ref> }} '''CLU''' is a [[programming language]] created at the [[Massachusetts Institute of Technology]] (MIT) by [[Barbara Liskov]] and her students starting in 1973.<ref name="History">Liskov, Barbara (1992). "A history of CLU". The second ACM SIGPLAN conference on History of programming languages.</ref> While it did not find extensive use, it introduced many features that are used widely now, and is seen as a step in the development of [[object-oriented programming]] (OOP). Key contributions include [[abstract data type]]s,<ref>{{Cite conference |doi= 10.1145/800233.807045 |chapter= Programming with abstract data types |title= Proceedings of the ACM SIGPLAN symposium on Very high level languages |pages= 50β59 |year= 1974 |last1= Liskov |first1= Barbara |author-link1= Barbara Liskov |last2= Zilles |first2= Stephen |citeseerx= 10.1.1.136.3043 }}</ref> [[call-by-sharing]], [[iterator]]s, multiple return values (a form of [[parallel assignment]]), type-safe [[parameterized type]]s, and type-safe [[variant type]]s. It is also notable for its use of [[Class (computer programming)|classes]] with [[Constructor (object-oriented programming)|constructors]] and methods, but without [[Inheritance (object-oriented programming)|inheritance]]. == Clusters == The [[syntax]] of CLU was based on [[ALGOL]], then the starting point for most new language designs. The key addition was the concept of a ''cluster'', CLU's type extension system and the root of the language's name (CLUster).<ref name=Liskov1977>{{Cite journal |last1= Liskov |first1= B. |author-link1= Barbara Liskov |last2= Snyder |first2= A. |last3= Atkinson |first3= R. |last4= Schaffert |first4= C. |title= Abstraction mechanisms in CLU |doi= 10.1145/359763.359789 |journal= [[Communications of the ACM]] |volume= 20 |issue= 8 |pages= 564β576 |date=August 1977 |citeseerx=10.1.1.112.656 |s2cid= 17343380 }}</ref> Clusters correspond generally to the concept of a "class" in an OO language. For instance, here is the CLU syntax for a cluster that implements [[complex number]]s: <!-- Not actually Algol 68, but this attribute is required--> <syntaxhighlight lang="text"> complex_number = cluster is add, subtract, multiply, ... rep = record [ real_part: real, imag_part: real ] add = proc ... end add; subtract = proc ... end subtract; multiply = proc ... end multiply; ... end complex_number; </syntaxhighlight> A cluster is a module that encapsulates all of its components except for those explicitly named in the "is" clause. These correspond to the public components of a class in recent OO languages. A cluster also defines a type that can be named outside the cluster (in this case, "complex_number"), but its representation type (rep) is hidden from external clients. Cluster names are global, and no namespace mechanism was provided to group clusters or allow them to be created "locally" inside other clusters. In a cluster, the explicit type conversions ''up'' and ''down'' change between the abstract type and the representation; implicit conversions between these types are signified using the special type ''cvt''. CLU does not otherwise perform [[implicit type conversion]]s. There is a universal type ''any'', and a procedure force[] to check that an object is a certain type. Objects may be mutable or immutable, the latter being ''base types'' such as integers, booleans, characters and strings.<ref name=Liskov1977/> == Other features == Another key feature of the CLU type system are ''[[iterator]]s'', which return objects from a collection serially, one after another.<ref name=Liskov1977 /> Iterators offer an identical [[application programming interface]] (API) no matter what data they are being used with. Thus the iterator for a collection of <code>complex_number</code>s can be used interchangeably with that for an array of <code>integer</code>s. A distinctive feature of CLU iterators is that they are implemented as coroutines, with each value being provided to the caller via a ''yield'' statement. Iterators like those in CLU are now a common feature of many modern languages, such as C#, Ruby, and Python, though recently they are often referred to as generators. CLU also includes [[exception handling]], based on various attempts in other languages; exceptions are raised using <code>signal</code> and handled with <code>except</code>. Unlike most other languages with exception handling, exceptions are not implicitly resignaled up the calling chain. Also unlike most other languages that provide exception handling, exceptions in CLU are considered part of ordinary execution flow and are considered a "normal" and efficient type-safe way to break out of loops or to return from functions; this allows for direct assignment of return values "except when" other conditions apply. Exceptions that are neither caught nor resignaled explicitly are immediately converted into a special failure exception that typically terminates the program. CLU is often credited as being the first language with type-safe [[variant type]]s, called ''oneofs'', before the language [[ML (programming language)|ML]] had them. A final distinctive feature in CLU is [[parallel assignment]] (multiple assignment), where more than one variable can appear on the left hand side of an [[Assignment (computer science)|assignment]] operator. For instance, writing <code>x,y := y,x</code> would exchange values of <code>x</code> and <code>y</code>. In the same way, functions could return several values, like {{CLU|1=x,y,z := f(t)}}. Parallel assignment (though not multiple return values) predates CLU, appearing in [[CPL (programming language)|CPL]] (1963), named ''simultaneous assignment'',<ref>{{cite journal |first1= D. W. |last1= Barron |first2= J. N. |last2= Buxton |first3= D. F. |last3= Hartley |first4= E. |last4= Nixon |first5= C. |last5= Strachey |title= The main features of CPL |journal= Computer Journal |volume= 6 |issue= 2 |pages= 134β143 |date= 1963 |doi= 10.1093/comjnl/6.2.134|doi-access= free }}</ref> but CLU popularized it and is often credited as the direct influence leading to parallel assignment in later languages. All objects in a CLU program live in the heap, and memory management is automatic. CLU supports [[generic programming|type-parameterized]] user-defined data abstractions. It was the first language to offer type-safe bounded parameterized types, using ''where clauses'' to express constraints on actual type arguments. Unlike in languages with template-based generics, a use of such a data abstraction can be type-checked without access to the implementation of the abstraction. == Influence == CLU and [[Ada (programming language)|Ada]] were major inspirations for [[C++]] [[Template (C++)|templates]].<ref name="history-of-cpp"/> CLU's exception handling mechanisms influenced later languages like C++,<ref name="history-of-cpp"/> [[Java (programming language)|Java]] and many others.{{Citation needed|date=August 2020}} [[Sather]], [[Python (programming language)|Python]], and [[C Sharp (programming language)|C#]] include [[iterator]]s, which first appeared in CLU.<ref name="History"/> [[Perl]] and [[Lua (programming language)|Lua]] took multiple assignment and multiple returns from function calls from CLU.<ref>{{Cite conference |last1= Ierusalimschy |first1= R. |last2= De Figueiredo |first2= L. H. |last3= Celes |first3= W. |doi= 10.1145/1238844.1238846 |chapter= The evolution of Lua |title= Proceedings of the third ACM SIGPLAN conference on History of programming languages β HOPL III |pages= 2-1β2-26 |year= 2007 |isbn= 978-1-59593-766-7 |chapter-url=http://www.lua.org/doc/hopl.pdf |archive-url=https://web.archive.org/web/20100703022703/http://www.lua.org/doc/hopl.pdf |archive-date=2010-07-03 |url-status=live}}</ref> [[Python (programming language)|Python]] and [[Ruby (programming language)|Ruby]] borrowed [[call by sharing]], the ''yield'' statement,<ref name="Appfolio">{{cite web |url=https://engineering.appfolio.com/appfolio-engineering/2019/7/3/rubys-roots-and-matzs-leadership |title=Ruby's Roots and Matz's Leadership |website=Appfolio Engineering |quote=Matz feels that blocks are the greatest invention of Ruby (I agree.) He got the idea from a 1970s language called CLU from MIT, which called them 'iterators'... |date=2019-11-08 |access-date=2019-11-15}}</ref> and multiple assignment.<ref>{{Cite web|title=Functional Programming HOWTO β Python 3.8.3 documentation|url=https://docs.python.org/3/howto/functional.html|website=docs.python.org|access-date=2020-05-25}}</ref> == References == {{Reflist}} == External links == * {{Official website|pmg.csail.mit.edu/CLU.html}} * {{cite web |url=http://www.lcs.mit.edu/publications/pubs/pdf/MIT-LCS-TR-561.pdf |title=A History of CLU |first=Barbara |last=Liskov |date=April 1992 |archive-url=https://web.archive.org/web/20030917041834/http://www.lcs.mit.edu/publications/pubs/pdf/MIT-LCS-TR-561.pdf |archive-date=2003-09-17 |id=MIT-LCS-TR-561 }} * [http://woodsheep.jp/clu2c.html clu2c]: a program to compile CLU code to [[C (programming language)|C]] * [http://cgibin.erols.com/ziring/cgi-bin/cep/cep.pl?_key=CLU Dictionary of Programming Languages] * [http://99-bottles-of-beer.net/language-clu-133.html CLU] comparison at '99 bottles of beer' multi-language demo algorithm site * {{cite book |first1=B. |last1=Liskov |first2=R. |last2=Atkinson |first3=T. |last3=Bloom |first4=E. |last4=Moss |first5=J.C. |last5=Schaffert |first6=R. |last6=Scheifler |first7=A. |last7=Snyder |title=CLU Reference Manual |publisher=Springer |date=1981 |isbn=9783540108368 |series=Lecture Notes in Computer Science |volume=114 |doi=10.1007/BFb0035014|s2cid=27382594 }} {{Authority control}} {{DEFAULTSORT:Clu (programming language)}} [[Category:Academic programming languages]] [[Category:Class-based programming languages]] [[Category:Massachusetts Institute of Technology software]] [[Category:Procedural programming languages]] [[Category:Programming languages created in 1975]] [[Category:Programming languages created by women]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:CLU
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite conference
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Infobox programming language
(
edit
)
Template:More citations needed
(
edit
)
Template:Official website
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)