16
Developing M2M apps with Lua Deeopn M2M apps wh Lua Benjamin Cabé – Sierra Wireless

M2M webinar - Developing M2M applications with Lua

Embed Size (px)

DESCRIPTION

Recording available here: http://youtu.be/m7M6kyPvZ0g Lua is a fast, lightweight, embeddable scripting language. Very popular in the gaming industry, Lua is also being used to make smart connections between devices. The Eclipse Koneki project is building Lua development tools to make it easy to develop, debug and deploy M2M applications. This webinar provides a brief introduction to Lua and then demonstrate how Eclipse and Koneki can be used to build great M2M applications.

Citation preview

Page 1: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

De!e"op#n$ M2M apps w#%h Lua Benjamin Cabé – Sierra Wireless

Page 2: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

� Wha% #s M2M?

Technology that supports wired or wireless communication between devices

Page 3: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Communication Infrastructure

Smart Pill Box

Heartbeat Sensor

Weight Scale

Blood Pressure

Medical Services Gateway

Near field

Blood Sugar

In%e&ne% o' Th#n$s

Patient

Clinical Trial

Doctor

Page 4: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Wha% #s Lua? •  A programming language

•  High Level

•  Scripting

•  Extensible

•  Simple

•  Efficient

•  Portable

Page 5: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Wha% #% #s no% •  An acronym

•  A replacement for C (C++)

•  A that recent language (1993)

•  Used only for games – Cisco, Adobe, Oracle, … –  See: http://en.wikipedia.org/wiki/Lua_(programming_language)#Other

Page 6: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Ex%ens#b"e •  Small

– Trivial syntax and reduced keyword set

•  Simple but not stupid –  Simple enough for new user, powerful enough for

advanced users (first-class functions, garbage collection, closures, tail calls, coercion, coroutines)

•  Lua core is tiny – Compiled size is ~150kB

–  Lua uses libraries for its extensions

Page 7: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Po&%ab"e •  The exact same code runs on different targets

•  Lua VM is written in pure C ANSI

Page 8: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

H#$h-"e!e" 'ea%u&e se% •  Easy-to-use high level structures: strings, lists,

tables, sets, hash-tables

•  Automatic memory management with garbage collector

•  Proper error/exceptions management

Page 9: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

H#$h-"e!e" 'ea%u&e se% ((on%’d) •  Easy user interaction and advanced tools

–  console

–  package manager, profilers, unit tests, …

•  Shorter development cycles – write, load without rebooting, look at what

happens interactively, reload etc.

•  Controlled execution model – Prevent pointer arithmetic and memory

management issues

– Graceful handling of incorrect arguments

Page 10: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Lua !s. o%he& h#$h-"e!e" "an$ua$es •  Same core features as Python, Ruby, Javascript

•  Better concurrency management – Built-in – doesn’t rely on OS

•  Cutting-edge execution technology & performances

•  Restricted set of libraries –  Stay simple, the developer brings his own

•  Outstanding Lua/C integration – Performance

–  Legacy

Page 11: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Lua 'o& embedded and M2M •  High-level languages usually trade hardware

resources for development & maintenance resources

•  Transition fully embraced on PC and servers, not yet on embedded devices, largely due to a history of resource scarcity

Lua allows to reconcile high-level languages accomplishments with embedded constraints

Page 12: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Lua app"#(a%#on '&amewo&) 'o& M2M •  User application container, embedded runtime

•  Set of libraries providing building blocks to develop user M2M applications: –  Serial and I/O management,

– Networking (FTP, HTTP, E-mail clients),

– GPS,

– Cryptography,

– Modbus,

–  Local storage,

– M2M server communication…

http://www.eclipse.org/mihini

Page 13: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

IDE 'o& Lua de!e"opmen% •  Project structure

•  Syntax coloring

•  Content assist

•  Code navigation

•  Code formatting

•  Documentation

•  Code templates

•  Debugger

•  Remote development

June 2012: first release (0.8)

Dec. 2012: 0.9 release

June 2013: graduate w/ Kepler

20,000+ installations already!

Page 14: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

IDE 'o& M2M de!e"opmen% •  We started working on Mihini support in

Koneki – Mihini execution environment for code assist

– Target Management for controlling the Application Container, accessing the logs, …

– Creation of software packages

Page 15: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Lua 'o& end-use& app"#(a%#ons? •  Many mobile development frameworks*

– Corona SDK**

– Gideros Mobile

–  LÖVE2D

–  etc.

* guess what? You can use Koneki LDT to develop for these frameworks!

** see http://youtu.be/XOlopalLKeU (« EclipseCon CoronaSDK »)

Page 16: M2M webinar - Developing M2M applications with Lua

Developing M2M apps with Lua

Mo&e #n'o&ma%#on •  M2M Portal

http://m2m.eclipse.org

•  Koneki http://www.eclipse.org/koneki

•  Mihini http://www.eclipse.org/mihini

Than) You!