User Tools

Site Tools


at:introduction

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
at:introduction [2007/06/19 16:48]
tvcutsem
at:introduction [2008/07/15 12:19] (current)
tvcutsem *
Line 6: Line 6:
   * **dynamically typed**, which is **not** the same as being untyped: AmbientTalk //values// are typed, but //variables// are not   * **dynamically typed**, which is **not** the same as being untyped: AmbientTalk //values// are typed, but //variables// are not
   * object-oriented, but prototype-based: AmbientTalk provides full support for objects, **delegation** (a form of inheritance) and polymorphic message dispatch. Objects are not instantiated from classes, as in Smalltalk, but rather cloned from existing objects or created //ex-nihilo//, as in Self.   * object-oriented, but prototype-based: AmbientTalk provides full support for objects, **delegation** (a form of inheritance) and polymorphic message dispatch. Objects are not instantiated from classes, as in Smalltalk, but rather cloned from existing objects or created //ex-nihilo//, as in Self.
-  * flexible: like Smalltalk, Self and Ruby, AmbientTalk embraces the use of elegant and expressive **block closures** to achieve a level of reusability far exceeding that of Java or similar languages lacking true closures.+  * flexible: like Scheme, Smalltalk, Self and many other languages, AmbientTalk embraces the use of elegant and expressive **block closures** to achieve a level of reusability far exceeding that of Java or similar languages lacking true closures.
   * event-driven: AmbientTalk has built-in support for **actor**-based concurrency, which operates based on entirely //asynchronous// and //event-driven// communication. No threads, no locks, no deadlock and no data-level race conditions!   * event-driven: AmbientTalk has built-in support for **actor**-based concurrency, which operates based on entirely //asynchronous// and //event-driven// communication. No threads, no locks, no deadlock and no data-level race conditions!
-  * distributed: AmbientTalk has built-in natives to make objects discover and talk to one another in a **peer-to-peer** manner across a TCP/IP network.+  * distributed: AmbientTalk has built-in language constructs to make objects discover and talk to one another in a **peer-to-peer** manner across a TCP/IP network.
   * **symbiotic**: built on top of the Java Virtual Machine, AmbientTalk exploits the Java reflection API to enable AmbientTalk objects to collaborate with Java objects. This enables reuse of existing Java libraries while not abandoning the dynamic programming style of AmbientTalk.   * **symbiotic**: built on top of the Java Virtual Machine, AmbientTalk exploits the Java reflection API to enable AmbientTalk objects to collaborate with Java objects. This enables reuse of existing Java libraries while not abandoning the dynamic programming style of AmbientTalk.
  
Line 132: Line 132:
  
 <code> <code>
-  defstripe InstantMessenger;+  deftype InstantMessenger;
   export: remoteInterface as: InstantMessenger;   export: remoteInterface as: InstantMessenger;
   whenever: InstantMessenger discovered: { |messenger|   whenever: InstantMessenger discovered: { |messenger|
Line 152: Line 152:
 </code> </code>
  
-The ''whenever:discovered:'' method takes a stripe and a one-argument closure as parameters. It invokes the closure every time a remote object exported as the given stripe is discovered. The first thing to do when a new messenger is discovered is to ask it for its name, by sending it the ''getName'' message. If the messenger was not previously discovered (i.e. its name is not in the buddy list), the messenger is added and the user is notified of the presence of the new buddy.+The ''whenever:discovered:'' method takes a type tag and a one-argument closure as parameters. It invokes the closure every time a remote object exported with (a subtype of) the given type tag is discovered. The first thing to do when a new messenger is discovered is to ask it for its name, by sending it the ''getName'' message. If the messenger was not previously discovered (i.e. its name is not in the buddy list), the messenger is added and the user is notified of the presence of the new buddy.
  
 Finally, notice how AmbientTalk allows you to deal with //partial failures//: you can register two kinds of //observers// on remote references which are triggered when the remote reference becomes disconnected (because of e.g. network partitions) and when it becomes reconnected. The second argument to ''when:disconnected:'' and ''when:reconnected:'' is a zero-arity closure. In this example, all we do is notify the user that a buddy when offline or came online. AmbientTalk's default semantics is to buffer messages sent to disconnected remote references internally, and to flush such messages if the remote reference should become reconnected. This provides the nice property that we can send messages to disconnected buddies and rest assured that the messages will arrive when the buddy rejoins the ad hoc network. Finally, notice how AmbientTalk allows you to deal with //partial failures//: you can register two kinds of //observers// on remote references which are triggered when the remote reference becomes disconnected (because of e.g. network partitions) and when it becomes reconnected. The second argument to ''when:disconnected:'' and ''when:reconnected:'' is a zero-arity closure. In this example, all we do is notify the user that a buddy when offline or came online. AmbientTalk's default semantics is to buffer messages sent to disconnected remote references internally, and to flush such messages if the remote reference should become reconnected. This provides the nice property that we can send messages to disconnected buddies and rest assured that the messages will arrive when the buddy rejoins the ad hoc network.
Line 172: Line 172:
 Of course, we are not claiming that AmbientTalk is a good replacement for distributed computing standards such as CORBA or Jini, which are much more flexible, at the cost of increased complexity. AmbientTalk is simply a lightweight alternative for doing experimental research. Of course, we are not claiming that AmbientTalk is a good replacement for distributed computing standards such as CORBA or Jini, which are much more flexible, at the cost of increased complexity. AmbientTalk is simply a lightweight alternative for doing experimental research.
  
-So, you read the introduction and are interested in all of the gory details of the language? In that case, you can go ahead and [[at:download|download]] AmbientTalk and read the [[at:tutorial:tutorial|tutorial]] which explains the language in much more detail.+===== Moving on ===== 
 + 
 +So, you read the introduction and are interested in all of the gory details of the language? In that case, you can go ahead and [[at:download|download]] AmbientTalk and read the [[at:tutorial:tutorial|tutorial]] which explains the language in much more detail. You can also {{http://prog.vub.ac.be/amop/presentations/SCCC-AT2.html|watch}} an introductory presentation on AmbientTalk (in flash format).
at/introduction.1182264501.txt.gz · Last modified: 2007/06/19 16:49 (external edit)