Notes/ProgrammingLanguageThoughts

edit
revisions

what's new
search
help

kiwi


Orientation

I would like a programming language that would put the stress and software engineering:

  • Reification of design pattern
  • Expression of pre/post conditions and invariants
  • Meta-information to ensure semantic and behavioural coherence

I would also like the language to be well suited for concurrent processing, heavily message-based interaction, and last but not least allow description of dynamic behaviour. Classes are nice to express the structure of entities and their relations, but fail to describe how these relations can evolve, or a least what kind of "communication patterns" can happen between two entities.

A good application example would be to try to formally express most common "dynamic" design patterns. For instance, the Observer-Observable design pattern.

We could inspire from network communication and reify the notions of protocols and transaction, where messages in a specific transaction should satify a certain set of criteria.

I would also like the language to separate meta-information from information. Meta-information is information that is not vital to running the program, but is valuable to it. For instance type information or constraints are part of the meta-information. In this respect, a program could be run with and without additional checkins, and the meta-information could be processed by other programs.

I would also like the program to easily interact with other languages, such as C, and support basic messaging protocol (D-BUS or Scop).

1. Object adjectives

Objects could be assigned a set of adjectives each expressing a specific characteristic of an object. These characteristics could be

  • Structural characteristics, regarding the encapsulated object state or the object interface
  • Behavioural characteristics, like what the object does and how it interacts

Adjectives could be used to express constraints on object. For example a statement expressing " a = small object" would for instance guarantee that the object does not consumes mor than N kbytes in memory.

Conversely, adjectives could be used to bind strucural or behavioural traits to objects: "a = small immutable collection object" would create an object a, which should respond to the criteria that "collection" describes, should respond to the "immutable" criteria (data cannot be mutated) and should be small.

Adjectives could be used instead of using constructors or cloning by composing different traits into a new object. This means of course that it should be possible to define new adjectives.

Adjectives should also share the same semantics, and should then be identifiable as compatible or not. The language should be able to interpret the following:

 small object has:
     object memorySize() < Resources:/System/SmallThreshold?

 immutable object has:
     object respondedMessages() filter:[mutator] = Nil

2. Perspectives

It is sometimes useful to weave in a code some elements that belong to different semantic groups, or to consider a given element under different perspectives.

The notion of perspective allows to express in the code that a given information (part of statement) has to be considered in a specific point of view.

For instance:

  Type:object --> Manipulates the object from a type perspective
  filter:[mutator] --> Interprets the given array as a filter with specific adjectives
  Resources:/System/SmallThreshold? --> The "/System/SmallThreshold?" expression has to be interpreted as a resource path

Perspectives can be used to locally introduce a semantic different from the current semantic, giving the same expression a different meaning and interpretation.

3. Pertinent examples

  • Geometrical figures
  • Communication (contract-based negociation)
  • Concurrency

Links

 Design Guidelines: http://www.ai.mit.edu/~gregs/ll1-discuss-archive-html/msg04323.html.....
last modified on September 27, 2005, at 07:35 PM

© type-z.org and its contributing authors, 2001-2004.
Content is licensed under a Creative Commons License.