Extensible programming: Difference between revisions

Content deleted Content added
 
(46 intermediate revisions by 27 users not shown)
Line 1:
{{short description|Style of computer programming}}
In [[computer science]], '''Extensibleextensible programming''' is a term used in [[computer science]] to describe a style of computer programming that focuses on mechanisms to extend the [[programming language]], [[compiler]], and [[Run-time system|runtime environmentsystem]]. (environment). Extensible programming languages, supporting this style of programming, were an active area of work in the 1960s, but the movement was marginalized in the 1970s.<ref name="Standish1975"/> Extensible programming has become a topic of renewed interest in the 21st century.<ref name="Wilson2005">Gregory V. Wilson, "[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.453.3676&rep=rep1&type=pdf Extensible Programming for the 21st Century]", ''ACM Queue'' 2 no. 9 (Dec/Jan 2004–2005).</ref>
 
== Historical movement ==
The first paper usually<ref name="Standish1975">Standish, Thomas A., "[https://pdfs.semanticscholar.org/7f11/082b409647e8d50dadd3a369a10278b5890f.pdf Extensibility in Programming Language Design]", ''SIGPLAN Notices'' 10 no. 7 (July 1975), pp. 18–21.</ref><ref name="Sammet1969">Sammet, Jean E., ''Programming Languages: History and Fundamentals'', Prentice-Hall, 1969, section III.7.2</ref> associated with the extensible programming language movement is [[Douglas McIlroy|M. [[Douglas McIlroy]]'s]] 1960 paper on [[Macro (computer science)|macros]] for higher[[high-level programming languageslanguage]]s.<ref name="McIlroy1960">McIlroy, M.D., "[https://dl.acm.org/citation.cfm?id=367223 Macro Instruction Extensions of Compiler Languages]", ''Communications of the ACM'' 3 no. 4 (April 1960), pp. 214–220.</ref> Another early description of the principle of extensibility occurs in Brooker and Morris's 1960 paper on the [[Compilercompiler-compiler|Compiler-Compiler]].<ref name="Brooker&Morris1962">Brooker, R.A. and Morris, D., "[https://dl.acm.org/citation.cfm?id=321106 A General Translation Program for Phrase Structure Languages]", ''Journal of the ACM'' 9 no. 1 (January 1962), pp. 1–10. The paper was received in 1960.</ref> The peak of the movement was marked by two academic symposia, in 1969 and 1971.<ref name="Christensen&Shaw1969">Christensen, C. and Shaw, C.J., eds., Proceedings of the Extensible Languages Symposium, ''SIGPLAN Notices'' 4 no. 8 (August 1969).</ref><ref name="Schuman1971">Schuman, S.A., ed., Proceedings of the International Symposium on Extensible Languages, ''SIGPLAN Notices'' 6 no. 12 (December 1971).</ref> By 1975, a survey article on the movement by Thomas A. Standish<ref name="Standish1975"/> was essentially a post mortem. The [[Forth (programming language)|Forth]] was an exception, but it went essentially unnoticed.
 
=== Character of the historical movement ===
As typically envisioned, an extensible programming language consisted of a base language providing elementary computing facilities, and a meta-language[[metalanguage]] capableable ofto modifyingmodify the base language. A program then consisted of meta-languagemetalanguage modifications and code in the modified base language.
 
The most prominent language-extension technique used in the movement was macro definition. Grammar modification was also closely associated with the movement, resulting in the eventual development of [[adaptive grammar|adaptive]] grammar[[Formalism (philosophy of mathematics)|formalisms]]. The [[Lisp (programming language)|Lisp]] language community remained separate from the extensible language community, apparently because, as one researcher observed,
 
<blockquote>any programming language in which programs and data are essentially interchangeable can be regarded as an extendible [sic] language. ... this can be seen very easily from the fact that Lisp has been used as an extendible language for years.<ref name="Harrison1969">Harrison, M.C., in "Panel on the Concept of Extensibility", pp. 53–54 of the 1969 symposium.</ref></blockquote>
 
At the 1969 conference, [[Simula]] was presented as an extensible programming language.
 
Standish described three classes of language extension, which he callednamed ''[[paraphrase]]'', ''orthophrase'', and ''metaphrase'' (otherwise paraphrase and metaphrase being [[translation]] terms).
 
* [[Paraphrase]] defines a facility by showing how to exchange it for something previouslyformerly defined (or to be defined). As examples, he mentions macro definitions, ordinary procedure definitions, grammatical extensions, data definitions, operator definitions, and control structure extensions.
* Orthophrase adds features to a language that could not be achieved using the base language, such as adding an i[[input/output]] (I/oO) system to a base language thatformerly previously hadwith no iI/oO primitives. Extensions must be understood as orthophrase ''relative'' to some given base language, since a feature not defined in terms of the base language must be defined in terms of some other language. OrthophraseThis corresponds to the modern notion of [[plugPlug-in (computing)|plug-ins]].
 
* Metaphrase modifies the interpretation rules used for pre-existing expressions. ItThis corresponds to the modern notion of [[Reflectionreflective programming]] (computer sciencereflection)|reflection]].
* Orthophrase adds features to a language that could not be achieved using the base language, such as adding an i/o system to a base language that previously had no i/o primitives. Extensions must be understood as orthophrase ''relative'' to some given base language, since a feature not defined in terms of the base language must be defined in terms of some other language. Orthophrase corresponds to the modern notion of [[plug-in (computing)|plug-ins]].
 
* Metaphrase modifies the interpretation rules used for pre-existing expressions. It corresponds to the modern notion of [[Reflection (computer science)|reflection]].
 
=== Death of the historical movement ===
Standish attributed the failure of the extensibility movement to the difficulty of programming successive extensions. An ordinaryA programmer might build a singlefirst shell of macros around a base language. Then, but if a second shell of macros was to beis built around that, theany subsequent programmer would have tomust be intimately familiar with both the base language, and the first shell;. aA third shell would require familiarity with the base and both the first and second shells;, and so on. Shielding (Note that shielding thea programmer from lower-level details is the intent of the [[Abstraction (computer science)|abstraction]] movement that supplanted the extensibility movement.)
 
Despite the earlier presentation of Simula as extensible, by 1975, Standish's survey does not seem in practice to have included the newer abstraction-based technologies (though he used a very general definition of extensibility that technically could have included them). A 1978 history of programming abstraction from the invention of the computer tountil the (then) present day, made no mention of macros, and gave no hint that the extensible languages movement had ever occurred.<ref name="Guarino1978">Guarino, L.R., "[https://cds.cern.ch/record/119689 The Evolution of Abstraction in Programming Languages]", ''CMU-CS-78-120'', Department of Computer Science, Carnegie-Mellon University, Pennsylvania, 22 May 1978.</ref> Macros were tentatively admitted into the abstraction movement by the late 1980s (perhaps due to the advent of [[hygienic macros]]), by being granted the pseudonym ''syntactic abstractions''.<ref name="Gabriel1989">Gabriel, Richard P., ed., "[https://dl.acm.org/citation.cfm?id=66092 Draft Report on Requirements for a Common Prototyping System]", ''SIGPLAN Notices'' 24 no. 3 (March 1989), pp. 93ff.</ref>
 
== Modern movement ==
In the modern sense, a system that supports extensible programming will provide ''all'' of the features described below{{Citation needed|reason=Reliable source needed for this definition|date=October 2017}}.
 
=== Extensible syntax ===
{{category see also|Extensible syntax programming languages}}
This simply means that the source language(s) to be compiled must not be closed, fixed, or static. It must be possible to add new keywords, concepts, and structures to the source language(s). Languages which allow the addition of constructs with user defined syntax include [[Coq (software)|Coq]],<ref>{{Cite web |title=Syntax extensions and notation scopes – Coq 8.17.0 documentation |url=https://coq.inria.fr/refman/user-extensions/syntax-extensions.html |access-date=2023-05-25 |website=coq.inria.fr}}</ref> [[Racket (programming language)|Racket]], [[Camlp4]], [[OpenC++ (software tool)|OpenC++]], [[Seed7]],<ref name="Zingaro2007">Zingaro, Daniel, "[http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.69.2848&rep=rep1&type=pdf Modern Extensible Languages]", SQRL Report 47 McMaster University (October 2007), page 16.</ref> [[Red (programming language)|Red]], [[Rebol]], and [[Felix (programming language)|Felix]]. While it is acceptable for some fundamental and intrinsic language features to be immutable, the system must not rely solely on those language features. It must be possible to add new ones.
 
=== Extensible compiler ===
Line 61 ⟶ 60:
==Examples==
* [[Camlp4]]
* [[Felix]]
* [[OpenC++Nemerle]]
* [[Seed7]]
* [[Red (programming language)]]
* [[Rebol]]
** [[RubyRed (programming language)|Red]] (Metaprogramming)
* [[IMPRuby (programming language)|Ruby]] ([[metaprogramming]])
* [[RedIMP (programming language)|IMP]]
* [[OpenC++]]
* OpenC++
* [[XL (programming language)]]
* [[ForthXL (programming language)|XL]]
* [[XML]]
* [[Scheme (programming language)]]
* [[LispForth (programming language)|Forth]]
* [[Factor (programming language)|Factor]]
* [[XLLisp (programming language)|Lisp]]
** [[Racket (programming language)|Racket]]
** [[Scheme (programming language)|Scheme]]
* [[Lua (programming language)|Lua]]
* [[PL/I]]
* [[Racket (programming language)]]
* [[Smalltalk]]
 
== See also ==
* [[:Category:Extensible syntax programming languages]]
* [[Adaptive grammar]]
* [[Concept programming]]
* [[Dialecting]]
* [[Grammar-oriented programming]]
* [[Language-oriented programming]]
* [[Homoiconicity]]
 
== References ==
{{reflistReflist}}
 
== External links ==
 
=== General ===
# [https://web.archive.org/web/20050209071400/http://www.acmqueue.com/modules.php?name=Content&pa=showpage&pid=247&page=1 Greg Wilson's Article in ACM Queue]
# [http://developers.slashdot.org/article.pl?sid=05/01/18/2157249&from=rss Slashdot Discussion]
# [http://www.cas.mcmaster.ca/sqrl/papers/SQRLreport47.pdf Modern Extensible Languages] {{Webarchive|url=https://web.archive.org/web/20110612014339/http://www.cas.mcmaster.ca/sqrl/papers/SQRLreport47.pdf |date=2011-06-12}} – A paper from [[Daniel Zingaro]]
 
=== Tools ===
# [http://www.meta-language.net/ MetaL] [https://web.archive.org/web/20050220100913/http://pyre.third-bit.com/pipermail/extprog/2005-January/000019.html an extensible programming compiler engine implementation]
# [httphttps://sourceforge.net/projects/extprosys/ XPS] eXtensible Programming System (in development)
# [http://www.jetbrains.com/mps/ MPS] JetBrains Metaprogramming system
 
=== ProgrammingLanguages languageswith extensible syntax ===
# [https://openzz.sourceforge.net/ OpenZz]
# [http://cs.nyu.edu/rgrimm/xtc/ xtc eXTensible C]
#
# [https://github.com/pannous/english-script English-script]
# [http://nemerle.org/Macros Nemerle Macros]{{dead link|date=February 2014}}
# [httphttps://booweb.codehausarchive.org/web/20050622032429/http://nemerle.org/Syntactic+Macros Boo SyntacticNemerle Macros]
# [https://web.archive.org/web/20050817205802/http://boo.codehaus.org/Syntactic+Macros Boo Syntactic Macros]
# [https://web.archive.org/web/20061022071450/http://suif.stanford.edu/ Stanford University Intermediate Format compiler]{{dead link|date=February 2014}}
# [httphttps://seed7.sourceforge.net/ Seed7 - The extensible programming language]
# [https://github.com/chrisseaton/katahdin Katahdin] – a language with syntax and semantics that are mutable at runtime
# [http://www.pi-programming.org/What.html π] – a language with extensible syntax, implemented using an [[Earley parser]]
 
{{Programming languageparadigms navbox}}
{{Types of programming languages}}
 
{{DEFAULTSORT:Extensible Programming}}
* [[:Category:Extensible syntax programming languages]]
[[Category:Programming paradigms]]