Software Languages Lab Brussels, Belgium
AmbientTalk
Tom Van Cutsem
A scripting language for mobile phones
AmbientTalk A scripting language for mobile phones Tom Van Cutsem - - PowerPoint PPT Presentation
AmbientTalk A scripting language for mobile phones Tom Van Cutsem Software Languages Lab Brussels, Belgium Mobile Ad Hoc Networks 2 Networks of mobile devices that use wireless p2p communication Mobile Ad Hoc Networks 2 Networks of mobile
Software Languages Lab Brussels, Belgium
Tom Van Cutsem
A scripting language for mobile phones
Mobile Ad Hoc Networks
Networks of mobile devices that use wireless p2p communication
2
Mobile Ad Hoc Networks
Networks of mobile devices that use wireless p2p communication
2
Zero Infrastructure
Mobile Ad Hoc Networks
Networks of mobile devices that use wireless p2p communication
2
Volatile Connections Zero Infrastructure
Mobile Ad Hoc Networks
Networks of mobile devices that use wireless p2p communication
2
Volatile Connections Zero Infrastructure Local interactions
dynamically typed
AmbientTalk: fact sheet
3
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76
Scheme 1975
ABCL
Smalltalk ‘70s-‘80s
4
Four Decades of Language Research
AmbientTalk 2006 1986 1997 1986 Hewitt’s actors (PLASMA) ‘73-’76 ECMAScript Harmony
How does AmbientTalk help?
5
Volatile Connections Zero Infrastructure
No blocking synchronization receive events, even when disconnected Peer-to-peer service discovery protocol decentralized, location-based Asynchronous, buffered messaging send messages, even when disconnected Network failures ≠ exceptions timeouts & leasing, whether connected or disconnected
Event Loop Concurrency
6
Event Loop Concurrency
6
Event Loop (actor) Message queue
def service := object: { def echo(text) { system.println("Received: "+text); text } } deftype EchoService; def pub := export: service as: EchoService; deftype EchoService; def echoF := when: EchoService discovered: { |echoSvc| system.println("Discovered an echo service"); echoSvc; } within: 2.minutes echoF<-echo("test1"); def resultF := echoF<-echo("test2")@TwoWay; when: resultF becomes: { |value| system.println("Reply: " + value); } echoF<-echo("test3");
EchoServer EchoClient
AmbientTalk = OO + Events
9
when: type discovered: { |ref| ... } when: future becomes: { |result| ... } when: ref disconnected: { ... } when: ref reconnected: { ... } when: ref expired: { ... }
Follow-up on
React to services appearing and disappearing Generate and receive application requests React to references disconnecting, reconnecting, expiring
def msg(param) { ... }
Urbiflock
10
framework
public transport network
Summary
11
Volatile Connections Zero Infrastructure ad hoc
Summary
11
Volatile Connections Zero Infrastructure Android 1.6 J2ME CDC J2SE 1.5 ad hoc
Summary
11
Volatile Connections Zero Infrastructure
Non-blocking Synchronisation Decentralized Discovery Asynchronous Communication Disconnections ≠ Failures
Android 1.6 J2ME CDC J2SE 1.5 ad hoc
Interpreter (MIT License)