ArticleslgStudy

science

Extensible programming

Extensible programming is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Extensible programming rather than just read about it. In short: In computer science, extensible programming is a style of computer programming that focuses on mechanisms to extend the programming language, compiler, and runtime system (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.

Key takeaways

  • Extensible programming belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Extensible programming to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Extensible programming from memory before moving on to harder problems.

Reference excerpt

In computer science, extensible programming is a style of computer programming that focuses on mechanisms to extend the programming language, compiler, and runtime system (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. Extensible programming has become a topic of renewed interest in the 21st century.

Historical movement The first paper usually associated with the extensible programming language movement is M. Douglas McIlroy's 1960 paper on macros for high-level programming languages. Another early description of the principle of extensibility occurs in Brooker and Morris's 1960 paper on the compiler-compiler. The peak of the movement was marked by two academic symposia, in 1969 and 1971. By 1975, a survey article on the movement by Thomas A. Standish was essentially a post mortem. The Forth was an exception, but it went essentially unnoticed.

Character of the historical movement As typically envisioned, an extensible language consisted of a base language providing elementary computing facilities, and a metalanguage able to modify the base language. A program then consisted of metalanguage 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 formalisms. The Lisp language community remained separate from the extensible language community, apparently because, as one researcher observed,

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. At the 1969 conference, Simula was presented as an extensible language. Standish described three classes of language extension, which he named paraphrase, orthophrase, and metaphrase (otherwise paraphrase and metaphrase being translation terms).

Paraphrase defines a facility by showing how to exchange it for something formerly 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 input/output (I/O) system to a base language formerly with 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. This corresponds to the modern notion of plug-ins. Metaphrase modifies the interpretation rules used for pre-existing expressions. This corresponds to the modern notion of reflective programming (reflection).

Death of the historical movement Standish attributed the failure of the extensibility movement to the difficulty of programming successive extensions. A programmer might build a first shell of macros around a base language. Then, if a second shell of macros is built around that, any subsequent programmer must be intimately familiar with both the base language, and the first shell. A third shell would require familiarity with the base and both the first and second shells, and so on. Shielding a programmer from lower-level details is the intent of the 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 until then, made no mention of macros, and gave no hint that the extensible languages movement had ever occurred. 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.

Modern movement In the modern sense, a system that supports extensible programming will provide all of the features described below.

Extensible syntax

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 Rocq, Racket, Camlp4, OpenC++, Seed7, Red, Rebol, and 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 In extensible programming, a compiler is not a monolithic program that converts source code input into binary executable output. The compiler itself must be extensible to the point that it is really a collection of plugins that assist with the translation of source language input into anything. For example, an extensible compiler will support the generation of object code, code documentation, re-formatted source code, or any other desired output. The architecture of the compiler must permit its users to "get inside" the compilation process and provide alternative processing tasks at every reasonable step in the compilation process. For just the task of translating source code into something that can be executed on a computer, an extensible compiler should:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Extensible programming

Start with the simplest possible case. Write down what Extensible programming claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Extensible programming before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Extensible programming ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Extensible programming

In research
Extensible programming appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Extensible programming in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Extensible programming is common in secondary-school and first-year university syllabi. It links to neighbouring topics Extensible syntax programming languages, Programming paradigms, so understanding it makes those chapters shorter.
In everyday life
Look for Extensible programming outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Extensible programming” →

How to study Extensible programming in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Extensible programming means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Extensible programming out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Extensible programming in simple terms?

In computer science, extensible programming is a style of computer programming that focuses on mechanisms to extend the programming language, compiler, and runtime system (environment). Extensible programming languages, supporting this style of programming, were an active area of work in the 1960s…

Why does Extensible programming matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Extensible programming?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Extensible programming.

Tags

  • Extensible syntax programming languages
  • Programming paradigms

Keep exploring