PLxPLs FREEDOMS is a lib used to manage lua modules. It contains two parts:

  • a boot loader which helps load the applications
  • application and plugin managers which maintain the dependencies among different lua modules

PLxPLs FREEDOMS is a native lib written in C++ and ported to Lua. The management of applications and plugins is organised by a fixed file system structure. A typical structure is looks like follows:

dictionary structure

The directory structure can be considered as three kinds:

  1. platform independent directories:
    • docs: all the documents for the applications and plugins are in this directory
    • independent: this directory includes all the lua-written system indenpendent parts of module
    • plugindesc: stores all the plugin description files
  2. platform dependent directories/files:
    • ubuntu: the specific lib or plugins for system ubuntu
    • windows: the specific lib or plugins for system windows
    • depending on your system, there might be other directories here, for example, mac
    • depending on your system, the loader could be different, for example, in windows it is FREEDOMS.exe while in ubuntu it is
  3. mixed type directories:
    • app: all the applictions are included in this directory. There might be some system independent codes, for example, the application entry and application written by Lua. It could contain the system dependent lib or code too. Some applications use the lib may not compatible to the local lib. A good way is to put the customized lib into application directory to avoid affect the other application which uses the default local lib.

To run an FREEDOMS supported application, just run the command line: (this example is for ubuntu)

./ –A<applicationName> <parameters>

The usage is listed below:

FREEDOMS  –A<app> [–V<version>][–B][–T] [args*]
–A<app>: the application name
–V<version>: platform version
–B: run in boot loader only mode, no plugin manager loaded
–T: run in TEST mode
args: application arguments

NOTE: FREEDOMS will automatically change Lua environment. But It will try its best to reduce this change. In current version 0.61, there is only one global table added in the environment. This table is called ‘global’, see the following code snap:


By default, the “global” table contains the information of the application name, platform type, platform version, the running mode and the application arguments. All these could be accessed in your lua application codes.

Concepts in PLxPLs FREEDOMS

Three concepts in PLxPLs FREEDOMS


A lib in PLxPLs FREEDOMS  is a system dependent dynamic lib. This lib might be called by the plugin. Usually, these libs can be accessed by specifying the OS environment variable, for example, the PATH. To make the PLxPLs FREEDOMS can work in a portable device (Ex: a USB storage device), the libs required by the plugins need to be managered by the PLxPLs FREEDOMS system.  Put the lib into the lib directory under its corresponding system directory (FREEDOMS_ROOT/windows/lib). If your lib only serves your own application, you can put it into the lib directory under your app folder.


A plugin is a lua module, which can be implemented by Lua or any other languages. The interfaces exported must be in Lua. Some time a plugin will contains two parts. One part is the native code implementation, for example, a C implementation of socket. Another part is the Lua wrapper which is implemented in Lua to export the high level Lua API. The first part some times will be confused with Lib. The difference between the Lib and the native code implementation of plugin is the former exports non-Lua interface, while the latter exports Lua interface. The job of Lua wrapper is not make these low level Lua interface much more usable.


All the application are located in the app folder. Each one has a single directory. The entry of the application is called entry.lua. Of course, you can use a byte code version, but the name should be entry.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s