Notes Information Apocalypse

Ambient Oriented Programming

Interesting research is emerging that explores new programming models for mesh connected mobile devices. The experimental language called AmbientTalk is a prototype based object oriented language on the JVM with special support for the unique demands of peer-to-peer mobile networks. It's obviously heavily influenced by Smalltalk and Self, but what is most interesting is the way they have adapted features of actor concurrency specifically for mobile communication.

The demand for event driven feedback leads to the concept of ambient references - a method of remote object discovery and asynchronous communication between devices. Rather than a direct link to an object over the network, the ambient reference points to a volatile set of nearby objects which will be constantly updated as devices roam. This enables the possibility of one-to-many messaging as well as point-to-point messaging. The idea of AmbientTalk is to explore these asynchronous and temporal ideas through language syntax and semantics. Broadcast models are implemented using the operator, signifying an asynchronous message being sent, and use of the annotations of @One and @All to distinguish between point-to-point and many-to-many messages.

def peers := ambient: ChatPeer;

def messageFuture := peers// process the reply
}

This snippet broadcasts a text message to an ambient reference pointing to all the chat peers on the network that the code-executing device can see. The possibility of multiple peers returning multiple results is handled by the concept of a multifuture - denoted here by the messageFuture object.

Temporal constructs such as when becomes: and whenEach becomes: are used to receive and process the message responses. This is a much more natural way to handle asynchronous messaging, and is based on the programming concept of futures which first emerged in the 1970's, but thus far, has not been widely explored in mainstream languages which are heavily based on imperative processing. Naturally, these future constructs can also be extended to device discovery and disconnection/reconnection:

def sub := when: Type discovered: { |obj|
  // code to execute upon discovery
}

def sub := when: Type disconnected: { |obj|
  // code to execute upon disconnection
}

def sub := when: Type reconnected: { |obj|
  // code to execute upon reconnection
}

What is lacking from this model is a lack of clarity surrounding proximity awareness. This is something I believe is a double edged sword for mobile application designers. Location aware devices begin to enable a whole new range of applications and communications triggered by proximity based information - yet when personal social networks are embedded in such devices, often a network is defined in a way that is completely non-spatial. In other words, ones friends could be anywhere in the world at any time. Indeed, this has been a key part of the revolution of communications technology since the time of the telegraph - the breaking down of spatial boundaries and the shift away from location being the key determinant in the ability to share information.

The real question surrounds the emergence of mob rules, in the form of wireless mesh networking for mobile phones.

An encouraging sign is the willingness of the ambient-oriented researchers to learn from biologically inspired programming models. This is a another strand of computer science which dates back to fundamental ideas from the 1970's that have been largely ignored by the mainstream computer industry.

At the very least, embedding some little awareness of the fallacies of distributed computing into the language itself is a very useful idea.