Liberty App Engine

Liberty App Engine is a virtual machine running inside Liberty IoT Hub, as part of the Liberty-IoT-OS.

Lua Virtual Machine

Although theoretically the Liberty App Engine can be any virtual machine, or native engine, the current implementation chooses LuaJIT, a just-in-time virtual machine for Lua Programming Language.

Learning Lua

Lua is probably the simplest programming language that offers both imperative and functional programming paradigm.

For experienced programmer, this page “Learn Lua in 15 Minutes” is a good source to learn the basics of the language.

Lua is a lot like JavaScript, but with a lot less keywords. A JavaScript programmer can adopt Lua almost immediately.

Our App Engine is compatible with Lua 5.2. You can read the Lua 5.2 Reference Manual from official site.

Liberty-IoT-OS Restrictions

We intentionally disabled a few features listed below. The changes enhanced the security and simplicity of the App Engine.

  • Coroutine; App Engine offers its own API to start and stop coroutines.
  • User defined metatable, i.e. getmetatable and setmetatable.
  • rawget and rawset.
  • Global variables; App code is not allowed to modify top level global variables. Global variables can still be defined or read, but can’t be overwritten once defined. Any attempt to do so will result in termination of the app task.