Feature Post


Intentional Programming: Whats your intent?

While browsing the wiki some time back, I came across Intentional Programming (IP); as any enthusiantic technologist I wanted to look further into it as to what and how can we use it.

What is it?
Intentional programming is a new way of programming. Easier, quicker, requires less coding; something new in rapidly growing software technology, that allows programming languages to be implemented in a highly extensible manner. In particular, the programmer can specify new abstractions that are specific to his problem domain, while simultaneously recording any domain specific optimizations that may apply to such new abstractions.

Though it is still in research, development, and initial alpha versions of its usage, even at the industry wide level, the core problem that it addresses are the aspects of making developers more productive and software more trustworthy.

It includes programming-language design, compilers, specification and verification, development environments and tools, runtime environments, formal models of systems, performance monitoring and optimization, and quality improvement

Computer programs have been traditionally represented as a stream of characters, usually referred to as code files. The Intentional Programs are represented not only as text but as a database; note that its not the database of the program or database about the program, but rather the database that “is” the program itself.

Lost already? (0: Hold on, following is fairly simple lingo.

Cruel Intentions?
The key to the new representation is the concept of identity - Identity; every object with unique identifier.

The idea of intents is that a representation of the 'intent' of the programmer should be the best way to store the code, and these 'intents' should also be 'viewable' in the language of your choice. In this system, source code as we know it today is just how you view and edit the intents.

Why IP?
Yep, I have thought about this question as well; the key difference with other approaches lies in the way the order of transformation of code that is controlled; in IP, the emphasis is placed on specifying that order in a compositional fashion (like composing an MS Word Document in tree structure - have ever switched to Outline View option?), so that transformations are easily re-used.

"Intents", ultimately, are high-level programming language with tools to automate the it’s writing and translation to lower-level languages, with an attendant loss of information and adding of noise in the process. Noise, that is, may be the additional layers that mediate between frontend and backend.

The independence and self-sufficiency of intentions might well create first a market in abstractions or "language features", followed by the long sought-after dream of a software componentization market.

Some shops (IntentSoft, company owned by Charles Simonyi, a former Microsoftee, who introduced the concept) introduced the IP as a visual tree of boxes editor that stores the abstract syntax tree in a sort of source code database. This concept is critical to power of language-oriented programming, but I believe changing the storage of source code is simply too radical of a change.

Well, actually, usually, source code is routinely stored in databases for IDE features, but the authoritative storage always remains text files, that is, the code files (.cs, .java, etc). All of programmers most trusted tools operate at the string level – at the core – and it is simply impractical to throw everything out at once.

This may be one of the problems of intentional programming, that we're basically creating a new programming language for every domain specific application.

What I'd really like to see is having a core set of abstractions (such as classes, methods, properties, and events) and then applying them in each domain—but in a way that preserves familiarity to existing coding practices.

Some day we may see a new editor which uses an abstract syntax tree box editing model, but preserves the source as text? who knows!

I do realize that visual editors are a bit less efficient than text editors for programming purposes. But the power that comes along with the IDE, Visual Studio, or myEclipse for instance, is far beyond compared to text editors; even those hi-fi text editors that comes with de/attachable compilers options.

Though, to some, boxes may convey less meaning than symbols in a text editor. The boxes and connections are also symbols, but they take up far more screen space than text, so you see much less code simultaneously, which makes the box editor less efficient.

But there are clear benefits to a box editor even in the absence of language-oriented features. For example, navigation of source code by parent, child, or sibling relationships instead of by word or by line; thinking out loud!

Sounds like a tangent?! Well, my thoughts.

References:Following are worthy of reading to get a good grasp of how it works.

Microsoft Research Intentional Programming Video, pretty old but informative. 
Microsoft Research Intentional Programming Article