The world is the computer and the programmer is you

36
1 Davide Carboni Surfing the 3 rd wave, Internet of Things in Sardinia Workshop Pula 14 04 2010 The World is the Computer and the programmer is You

description

 

Transcript of The world is the computer and the programmer is you

Page 1: The world is the computer and the programmer is you

1

Davide Carboni

Surfing the 3rd wave, Internet of Things in Sardinia Workshop

Pula 14 04 2010

The World is the Computerand the programmer is You

Page 2: The world is the computer and the programmer is you

2

Time

• 1956:There's Plenty of Room at the Bottom -->MEMS (Feynman)

• 1974: TCP/IP (V.Cerf, R Kahn)

• 1990: Web (T.Berners Lee)

• 1993: Vision of Ubiquitous Computing (Weiser)

• 1998: Jini (Sun)

• 1999: Internet of things (AutoID labs)

• 2000: REST (Roy Fielding)

• 2001: Smart Dust (Pister)

• 2003: Project JXTA-C: Enabling a Web of Things

• 2004: Vision of Spime (B. Sterling)

• 2004: Web 2.0 (O'Reilly or DiNucci in 1999)

• 2008: (Restful) Web of Things Manifesto (Trifa et al.)

Page 3: The world is the computer and the programmer is you

3

Models and tools

• to understand Ubiquitous Computing we must make more systematic use of models [...]

• how models can form a hierarchy, allowing them to be combined and higher models to explain lower ones– Robin Milner

Page 4: The world is the computer and the programmer is you

4

Top down Vs bottom up

• Bottom up– Few simple rules, many subjects,

many objects– Integrative levels, emergent

complexity,evolutionary approach

• Top Down– Many complex rules and logic, one

subject, many objects– Creational approach

Page 5: The world is the computer and the programmer is you

5

Projects

• Languages, tools, and models for Web of Things and Wireless Sensor Computing– Hyperpipe (bottom up)– PySense (top down)

Page 6: The world is the computer and the programmer is you

6

Top Down

Page 7: The world is the computer and the programmer is you

7

wireless sensor networking today

Page 8: The world is the computer and the programmer is you

8

PySense

• Wireless Sensor Computing– not only simple sensors connected to

a central computer, but rather elements capable of computation in a distributed system

• Computation Vs Communication– One byte sent demands 100 times the

energy of an integer instruction

Page 9: The world is the computer and the programmer is you

9

Sensing, routing, computing

Page 10: The world is the computer and the programmer is you

10

• given an energy consumption model E and an application code C, there exists a partitioning of code C={c1,c2,...,cn} and a set Tx of transmissions Tx={tx1,tx2,...,txk} which is optimal for E

Page 11: The world is the computer and the programmer is you

11

• Node-level programming– program for each node type (error

prone, difficult, only for geeks)

• Network as DB– Good but limited to queries (TinyDB)

• Macroprogramming– Program the net as a whole, the tool

partition the code on the nodes automatically

Page 12: The world is the computer and the programmer is you

12

PySense

• PySense– Language (hosted on decorators) and

API – Base Runtime Environment (based on

Python 2.6)– Remote Runtime Environment (based

on Python-on-a-chip)

Page 13: The world is the computer and the programmer is you

13

PySense Regions

Region((0,0,100,100)) | Region(“/foo/3/312”)

Page 14: The world is the computer and the programmer is you

14

@moteclass M:  def getX(self):pass  def setY(self,y):pass

m=M()m.getX()

Finds a mote m with X,Y

Read X from m

Page 15: The world is the computer and the programmer is you

15

@moteclass M:

def getX(self):pass

@onboarddef f(self,args):<some code here>

@onbasedef g(self,args):<some code>

@autodef h(self,args):<some code>

Page 16: The world is the computer and the programmer is you

16

Simple program

@mote

class CO2Sense:

  def getConc(self):

    return self.x

values=[c.getConc() for c in region.items(CO2Sense)]

Page 17: The world is the computer and the programmer is you

17

A little better

@mote

class CO2Sense:

  def getConc(self):return self.conc

class CO2Cluster(Cluster)

  @onboard

  def average(self):

    return sum([m.getConc() for m in self.motes]) / len(self.motes)

values=CO2Cluster(region.items(CO2Sense)).average()

Page 18: The world is the computer and the programmer is you

18

Bottom up

Picture released under (CC) attribution share­alike by alasis on Flickr 

Page 19: The world is the computer and the programmer is you

19

Only for geeks

ls ­l | less

curl "http://en.wikipedia.org/wiki/Pipeline_(Unix)" | \

sed 's/[^a­zA­Z ]/ /g' | \

tr 'A­Z ' 'a­z\n' | \

grep '[a­z]' | \

sort ­u | \

comm ­23 ­ /usr/share/dict/words

Page 20: The world is the computer and the programmer is you

20

Also for bloggers

Page 21: The world is the computer and the programmer is you

21

Web 1.0 Pages linked

Web 2.0 People, content, socialWeb 3.0  Structured data and 

services

Web of Things Physical objects,sensors, effectors

Wiki of Things, Physical Mashups

People bend the rules, new unexpected apps

Page 22: The world is the computer and the programmer is you

22

Hyperpipe

• Hyperpipes =architecture for the Web of Things

• Point-select-connect interaction• Based on pi-calculus / SOA

Page 23: The world is the computer and the programmer is you

23

– Every thing is a process– Things have public operations

(channels)– Things exchange data through channels

– Hyper pipes connect objects' channels

– Hyper pipes are processes

Page 24: The world is the computer and the programmer is you

24

src()­>data

sink(data)

f(data)­>data'

sensor

effector

processor

Page 25: The world is the computer and the programmer is you

25

src()­>data sink(data)

Page 26: The world is the computer and the programmer is you

26

src()­>data sink(data')

f(data)­>data'

Page 27: The world is the computer and the programmer is you

27

src()­>video sink(video)

Page 28: The world is the computer and the programmer is you

28

src()­>video sink(video)

Hyper pipe

Page 29: The world is the computer and the programmer is you

29

Page 30: The world is the computer and the programmer is you

30

Page 31: The world is the computer and the programmer is you

31

Page 32: The world is the computer and the programmer is you

32

Page 33: The world is the computer and the programmer is you

33

Selecting two different actions from two different objects(or even from the same object) a pipe can be constructed.

Thanks to Alessandro Giordanoand Alberto Serra for the prototype

Page 34: The world is the computer and the programmer is you

34

stream()­>video sink(video)

snapshot()­>image

faceRecognition()­>event

wsdl

Page 35: The world is the computer and the programmer is you

35

Page 36: The world is the computer and the programmer is you

36

References

• Macroprogramming http://fiji.eecs.harvard.edu/Macroprogramming

• Enowireless - http://opensource.crs4.it/enowireless/

• Wireless Wires: Let the Users Build the Ubiquitous ComputerIn Proc. of MUM 2007 - 6th Int. Conference on Mobile and Ubiquitous Multimedia. ACM Press.

• http://en.wikipedia.org/wiki/Mark_Weiser