realtalk

12
REALTALK A Programming Language for Wireless Embedded Sensor Network Alexandre Bergel Siobhán Clarke Distributed Systems Group Trinity College Dublin

Upload: esug

Post on 18-Dec-2014

451 views

Category:

Technology


0 download

DESCRIPTION

REALTALK A Programming Language for Wireless Embedded Sensor Networks. Alexandre Bergel. ESUG 2006, Prague

TRANSCRIPT

Page 1: REALTALK

REALTALKA Programming Language for Wireless Embedded Sensor

Network

Alexandre BergelSiobhán Clarke

Distributed Systems GroupTrinity College Dublin

Page 2: REALTALK

Alexandre Bergel

Programming wireless sensor devices is difficult

• Embedded sensor systems are difficult to program.

• Power consumption, memory management, hardware abstraction:

– component maintenance: the C programming language prevents software component from being easily maintained.

– sensor asynchronism: sampling is achieved by emitting and receiving events.

2

Page 3: REALTALK

Alexandre Bergel

Sensor sampling creates disruption in the app

3

CPU Sensor

Request for a sampling

answer

measurementOptimizing

resource is critical!

Page 4: REALTALK

Alexandre Bergel

Sensor sampling creates disruption in the app

4

CPU Sensor

Request for a sampling

answer

measurementData

passing is critical!

Page 5: REALTALK

Alexandre Bergel

Realtalk: An Object-based language

Goal: making embedded programming easier and providing advanced hardware abstraction.

Creation of a counter application:RTObject subclass: #Counter

variableNames: ‘leds timer value’.

Counter compile: ‘startvalue := 0.timer invoke: #triggeredMethod every: 500.’

Counter compile: ‘triggeredMethodvalue := value + 1.leds display: value.’

5

Page 6: REALTALK

Alexandre Bergel

Object composition and hybrid type system

Linking the counter to the leds and a timer:

RTObject subclass: #CountervariableNames: ‘leds timer value’.

Counter composeWith: { #leds -> Leds. #timer -> Timer }

Realtalk supports an hybrid type system.

6

Page 7: REALTALK

Alexandre Bergel

Class specialization

Let’s emit a sound at each increment:

Counter subclass: #SoundCountervariableNames: ‘sounder’aliases: { #triggeredMethod -> #incAndDisplay}.

SoundCounter compile: ‘triggeredMethodself incAndDisplay.leds isRedOn

ifTrue: [sounder start]ifFalse: [sounder stop].’

7

Page 8: REALTALK

Alexandre Bergel

Example of Controlled Disruption

Reading two sensors and emitting their sampling:

AnyObject compile: ‘readingTwoSensors| value1 value2 |

leds display: 1.value1 := lightSensor read.

leds display: 2.value2 := soundSensor read.

leds display: 3.radio emit: (value1 + value2).’

8

Page 9: REALTALK

Alexandre Bergel

Method is cut down into pieces...

9

Reading two sensors and emitting their sampling:

AnyObject compile: ‘readingTwoSensors| value1 value2 |

leds display: 1.value1 := lightSensor read.

leds display: 2.value2 := soundSensor read.

leds display: 3.radio emit: (value1 + value2).’

Page 10: REALTALK

Alexandre Bergel

... and those pieces are inserted in a pool

10

...

Page 11: REALTALK

Alexandre Bergel

Implementation based on TinyOS/NesC

11

Mote/Mica/...4k RAM devices

TinyOS

NesC Realtalk

Page 12: REALTALK

Alexandre Bergel

Conclusion

• Realtalk is a scripting language dedicated to small sensor device with high limited resources.

• It provides advanced features regarding:– component interactions– component specialization– sensor programming

• On going work focuses on large software construction.

12