Omnia -- Batteries included Lua
Compile Lua, Fennel and MoonScript source code into standalone executables. This makes it easy to use Lua/Fennel/Moonscript for system programming and general purpose scripting.
Another Lua 5.3 build system for standalone executables.
This was made possible by luastatic
Requires: GNU Make, a compiler and binutils (or equivalent). Installing development tools e.g. the package build-essential should have everything you need. Does not require autotools.
Note: Linux and OS X only. xBSD soon.
Download a release or clone the repo:
git clone --depth 1 https://github.com/tongson/omnia
Edit the following space delimited variables in the top-level Makefile
MAIN: The "main" script in the
SRC: Modules that are specific to your application. Copy these to
SRC_DIR: Directories containing modules that are specific to your application. Copy these to
SRC_C: C modules that are specific to your application. Copy these to
VENDOR: 3rd party modules
VENDOR_DIR: directories containing 3rd party modules
VENDOR_C: 3rd party C modules
Copy the main source file into the
Copy modules into
The SRC, VENDOR split is just for organization. Underneath they are using the same Make routines.
make during development or
make release for the final executable without debug symbols in
If you want to link statically run
make release STATIC=1
You can also use omnia as a base of the monorepo of your Lua/Fennel/Moonscript code.
Adding plain Lua, Fennel and MoonScript modules. (NOTE: VENDOR and SRC are interchangeable.)
Adding plain modules is trivial. $(NAME) is the name of the module passed to
- Copy the module to
cp ~/Downloads/dkjson.lua vendor/lua
VENDOR= re dkjson
For modules that are split into multile files, such as Penlight:
- Copy the directory of the Lua module to
cp -R ~/Download/Penlight-1.3.1/lua/pl vendor/lua
For modules with multiple levels of directories you will have to pass each directory. Example:
VENDOR_DIR= ldoc ldoc/builtin ldoc/html
Lua does not have the facilities to traverse directories and I'd like to avoid shell out functions.
Adding C modules
- Provide a Makefile in
vendor/c/$(NAME)/Makefile. See existing modules such as luaposix and lpeg for pointers.
The default make target is development which runs Luacheck against your Lua source code.
Luacov is also integrated. Just run the your test code with Luacov loaded e.g.
bin/lua -lluacov tests.lua. Then
bin/luacov.lua to generate the report.
Example application using omnia
The included Lua script might be too simplistic to demonstrate Omnia. For a more complicated application check my 'fork' of LDoc
Fennel and MoonScript support
Just treat Fennel/MoonScript source the same as Lua source. The Make routines will handle the compilation of Fennel/MoonScript sources and link the appropriate compiled Lua source to the final executable.
The MoonScript standard library is included but you have to add
moon to the
VENDOR line in the Makefile.
A copy of the MoonScript REPL
moor is also included. To compile, run
A copy of the upstream Fennel REPL and compiler is also included. To compile, run
Available modules (Feel free to open a Github issue if you want help with adding a new Lua module.)
 posix.deprecated and posix.compat removed
 Does not include the async resolver