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.
A guided tour of Eclipse M2M - EclipseCon Europe 2013
M2M webinar - Developing M2M applications with Lua
1. Developing M2M apps with Lua
Benjamin Cabé – Sierra Wireless
Developing M2M apps with Lua
2. What is M2M?
Technology that supports
wired or wireless
communication
between devices
Developing M2M apps with Lua
3. Smart
Pill
Box
Near field
Patient
Heartbeat
Sensor
Medical
Services
Gateway
Clinical Trial
Weight
Internet
Scale
of Things
Communication
Infrastructure
Doctor
Blood
Pressure
Blood
Sugar
Developing M2M apps with Lua
4. What is Lua?
• A programming language
• High Level
• Scripting
• Extensible
• Simple
• Efficient
• Portable
Developing M2M apps with Lua
5. What it is not
• 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
Developing M2M apps with Lua
6. Extensible
• 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
Developing M2M apps with Lua
7. Portable
• The exact same code runs on different targets
• Lua VM is written in pure C ANSI
Developing M2M apps with Lua
8. High-level feature set
• Easy-to-use high level structures: strings, lists,
tables, sets, hash-tables
• Automatic memory management with garbage
collector
• Proper error/exceptions management
Developing M2M apps with Lua
9. High-level feature set (cont’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
Developing M2M apps with Lua
10. Lua vs. other high-level languages
• 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
Developing M2M apps with Lua
11. Lua for 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
Developing M2M apps with Lua
12. Lua application framework for 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,
http://www.eclipse.org/mihini
– M2M server communication…
Developing M2M apps with Lua
13. IDE for Lua development
• Project structure
• Syntax coloring
• Content assist
• Code navigation
June 2012: first release (0.8)
• Code formatting
Dec. 2012: 0.9 release
June 2013: graduate w/ Kepler
• Documentation
20,000+ installations already!
• Code templates
• Debugger
• Remote development
Developing M2M apps with Lua
14. IDE for M2M development
• 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
Developing M2M apps with Lua
15. Lua for end-user applications?
• 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 »)
Developing M2M apps with Lua
16. More information
• M2M Portal
http://m2m.eclipse.org
• Koneki
http://www.eclipse.org/koneki
• Mihini
http://www.eclipse.org/mihini
Thank You!
Developing M2M apps with Lua