Loading…
Transcript

PiCloud

> def func():

do_compute ()

> import cloud

> cloud.call(func)

AppEngine

class Location(db.Model):

loc = db.GeoPtProperty()

date = db.DateTimeProperty()

accuracy = db.FloatProperty()

Amazon EC2

function (doc) {

if (doc.Type == "customer")

emit(doc.name, {name: doc.name });

}

iPhone

No background processes

Objective C only for UI

Push support for incoming messages

Android

Background processes

Java or native ARM code

JSON/RPC function call bridge

let rec me = { name="Anil";

age=Some 30; friends=[mothy] }

and mothy = { name="Mothy";

age=None; friends=[me] } in

let db = t_init "friends.db" in

t_save db me;

let a = t_get ~name:(`Contains "A") db in

...

type t =

| Unit | Bool

| Float | Char

| String | Int of int option

| Enum of t

| Tuple of t list

| Option of t

| Dict of (string * [`RO|`RW] * t) list

| Sum of (string * t list) list

| Rec of string * t | Var of string

| Ext of string * t

| Arrow of t * t

type t =

| Unit | Int of Int64

| Bool of bool | Float of float

| String of string

| Enum of t list

| Tuple of t list

| Dict of (string * t) list

| Sum of (string * t list)

| Null | Value of t

| Arrow of string

| Rec of (string * int64) * t

| Var of (string * int64)

| Ext of (string * int64) * t

Xen Cloud

Dust Clouds

Dyntype/ML

AppEngine

"Using Dust Cloud to Enhance Anonymous Communication"

Security Protocols Workshop 2010

name: java.lang.String

age: java.lang.Integer

friends: ListProperty<t>

Uses Cadmium to convert

OCaml to Java

http://avsm-ocaml1.appspot.com/

Cloud

Anil Madhavapeddy

Type

AppEngine

Shelf

Systems Research Group,

University of Cambridge

ORM

let type_of_t =

Rec ("t",

Dict(

("name", `RO, String);

("age", `RO, Option(Int 63));

("friends", `RO, Enum (Var "t"))

))

type t = {

name: string;

age: int option;

friends: t list;

} with type_of

type t = {

name: string;

age: int option;

friends: t list;

} with json

type t = {

name: string;

age: int option;

friends: t list;

} with orm

Bytecode converts to Java via Cadmium

Quite slow, but it's freeeeeee!

Very limited APIs (HTTP/XMPP)

No threading allowed, but cothreads work

Desktop

Windows

Linux

MacOS X

Value

json_of_t : t -> string

t_of_json : string -> t

{ name: "Anil",

age: 30,

friends: [

{ name: "Bob", friends: [] }

]

}

t_init: string -> (t, [`RW]) Db.t

t_init_ro : string -> (t, [`RO]) Db.t

t_save (t,[`RW]) Db.t -> t -> unit

t_get: ?name:[<`Contains of string

|`Eq of string] ->

?age:[< `Null | `Eq int |

`Gt int (...) ]

(t, [< `RO|`RW ]) Db.t -> unit

t_delete: (t,[`RW]) Db.t -> t -> unit

value_of_t me :

Ext ("t", 3,

Dict(

("name", String "Anil");

("age", Value (Int 63));

("friends",

Ext("t", 2,

Dict(

("name", String "Bob");

("age", Null), ...

let me = {

name="Anil";

age=Some 30;

friends: [bob];

}

Mobile

EuroSys 2007

Melange: Creating a "functional" Internet

http://github.com/avsm/melange

Personal

Containers

SQL

  • Every individual has their own VM
  • Data logically centralised
  • Privacy-sensitive distribution

Android

CREATE TABLE types (n TEXT, t TEXT);

CREATE TABLE t_friends (

id INT, next INT, size INT, val INT);

CREATE TABLE t (id, name TEXT

age_isset INT, age INT, friends INT);

CREATE UNIQUE INDEX idx_1

ON t_friends (id, next);

CREATE TRIGGER t_friends_clean

AFTER UPDATE OF friends ON t (...);

http://perscon.net/

  • Can run native ARM or Java
  • ORM bridges both

SQLite or Java

  • Android Scripting environment

uses JSON/RPC