Intentional programming

In computer programming, intentional programming is a collection of concepts which enable software source code to reflect the precise information, called intention, which programmers had in mind when conceiving their work. By closely matching the level of abstraction at which the programmer was thinking, browsing and maintaining computer programs becomes easier.

The term was introduced by long-time Microsoft employee Charles Simonyi, who led a team in Microsoft Research which developed an Integrated Development Environment known as IP that demonstrates these concepts.

Contents

Separation of source code storage and presentation

Key to the benefits of IP (and a likely barrier to acceptance from the programming community) is that source code is not stored in text files, but in a proprietary binary file that bears a resemblance to XML. As with XML, there is no need for a specific parser for each piece of code that wishes to operate on the information that forms the program, lowering the barrier to writing analysis or restructuring tools. The video demonstrates how the system handles languages that use a text-based preprocessor by surveying the specific usages of macros in a body of code to invent a more hygienic abstraction.

Tight integration of the editor with the binary format brings some of the nicer features of database normalization to source code. Redundancy is eliminated by giving each definition a unique identity, and storing the name of variables and operators in exactly one place. This means it's also possible to intrinsically distinguish between declarations and references, and the environment shows declarations in boldface type. Whitespace is also not stored as part of the source code, and each programmer working on a project can choose an indentation display of the source that they like. More radical visualizations are demonstrated in the video, such as showing statement lists as nested boxes, editing conditional expressions as logic gates, or re-rendering names in Chinese.

The project appears to standardize a kind of XML Schema for popular languages like C++ and Java, while allowing users of the environment to mix and match these with ideas from Eiffel and other languages. Often mentioned in the same breath as aspect-oriented programming, IP purports to provide some breakthroughs in Generative programming. These techniques allow developers to extend the language environment to capture domain-specific constructs without the investment in writing an entire compiler and editor for these new languages. In this way, it seems comparable to the Synthesizer Generator (http://www.grammatech.com/products/sg/overview.html).

Example

A program that writes out the numbers from 1 to 10, using a Java-like syntax, might look like this:

for (int i = 1; i <= 10; i++) {
  System.out.println("the number is " + i);
}

The code above contains one of the more common constructs of most computer languages, the bounded loop, in this case represented by the for construct. The code, when compiled, linked and run, will loop 10 times, incrementing the value of i each time and then printing it out.

However this code does not truly capture the intentions of the programmer, which was, simply, "print the numbers 1 to 10". In this simple case, a programmer asked to maintain the code could likely figure out what it is trying to do, but this is not always the case.

In intentional programming systems the above loop could be represented, at some level, as something as obvious as "print the numbers 1 to 10". The system would then use the intentions to generate source code, likely something very similar to the code above. The key difference is that the source code has lost the semantic level that the intentional programming systems maintain, and in larger programs this can dramatically ease readability.

Although most languages contain mechanisms for capturing this kind of abstraction, IP allows for the evolution of new mechanisms. Thus, if a developer started with a language like C, they would be able to extend the language with features such as those in C++ without waiting for the compiler developers to add them. By analogy, many more powerful expression mechanisms could be used by programmers than mere classes and procedures.

Identity

IP focuses on concept of identity. In most programming languages the same symbolic name may be used to name different variables, procedures, or even types. In code that spans several pages or, for globally visible names, multiple files; it can become very difficult to tell what symbol refers to what actual object. If a name is changed, the code where it is used must carefully be examined.

In an IP system, all definitions not only assign symbolic names, but also separate, private unique identifiers to objects. The IP system would track each, and can tell at any time what object refers to what definition. If a variable has to be renamed, IP "knows" all of the uses of that variable and could change them without confusing them with other variables that could have been given the same name. The ability of the compiler to distinguish these instances is especially important if the code has been generated by an automated process, or is in an intermediate phase of being restructured.

Levels of detail

IP systems also offer several levels of detail, allowing the programmer to "zoom in" or out. In the example above, the programmer could zoom out to get a level that would say something like:

<<print the numbers 1 to 10>>

Thus IP systems are self-documenting to a large degree, allowing the programmer to keep a good high-level picture of the program as a whole.

See also

External links

pl:Programowanie intencyjne

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools