Git Product home page Git Product logo

omnia's Introduction

No longer maintained.

Focused on the LuaJIT implementation at omniajit.

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

Similar projects:
LuaDist
luabuild

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.

Getting started

  1. Download a release or clone the repo: git clone --depth 1 https://github.com/tongson/omnia

  2. Edit the following space delimited variables in the top-level Makefile
    MAIN: The "main" script in the bin/ directory
    SRC: Modules that are specific to your application. Copy these to src/lua.
    SRC_DIR: Directories containing modules that are specific to your application. Copy these to src/lua.
    SRC_C: C modules that are specific to your application. Copy these to src/c.
    VENDOR: 3rd party modules
    VENDOR_DIR: directories containing 3rd party modules
    VENDOR_C: 3rd party C modules

  3. Copy the main source file into the bin/ directory.

  4. Copy modules into src/lua/ or vendor/lua/.

The SRC, VENDOR split is just for organization. Underneath they are using the same Make routines.

Run make during development or make release for the final executable without debug symbols in bin/.
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 VENDOR.

  1. Copy the module to vendor/lua/$(NAME).{lua,fnl,moon}
    example: cp ~/Downloads/dkjson.lua vendor/lua
  2. Add $(NAME) to VENDOR
    example: VENDOR= re dkjson

For modules that are split into multile files, such as Penlight:

  1. Copy the directory of the Lua module to vendor/lua/$(NAME)
    example: cp -R ~/Download/Penlight-1.3.1/lua/pl vendor/lua
  2. Add $(NAME) to VENDOR_DIR
    example: VENDOR_DIR= pl

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

  1. Provide a Makefile in vendor/c/$(NAME)/Makefile. See existing modules such as luaposix and lpeg for pointers.
  2. Add $(NAME) to VENDOR_C

Development

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 make bin/moor. A copy of the upstream Fennel REPL and compiler is also included. To compile, run make bin/fennel.

Included projects

Project Version License
Lua 5.3.5 MIT
luastatic 0.0.9-dev CC0
Fennel HEAD MIT
MoonScript 0.5.0 MIT
moor HEAD MIT
linenoise lua-linenoise BSD 2C
moonpick HEAD MIT
luacheck 0.19.0 MIT
luacov 0.12.0 MIT

Available modules (Feel free to open a Github issue if you want help with adding a new Lua module.)

Module Version License
Luaposix[1] 34.0 MIT
Linotify 0.5 MIT
LPeg 1.0.1 MIT
lsocket[2] 1.4 MIT
luafilesystem 1.6.3 MIT
lua-linenoise 0.9 MIT
inspect.lua 3.1.0 MIT
cimicida HEAD MIT
lib HEAD MIT
u-test HEAD MIT
px HEAD MIT
factid HEAD MIT
Lua-cURLv3 b4d1d79 MIT
plc HEAD MIT
argparse 0.5.0 MIT
dkjson c23a579 MIT
lua-ConciseSerialization 0.2.1 MIT
luaproxy 6d7bb0c BSD 3C
luatweetnacl 0.5-1 MIT
lua-array 676ba83 MIT
lpty 1.2.2 MIT
uuid HEAD Apache
ftcsv 1.1.6 MIT

[1] posix.deprecated and posix.compat removed
[2] Does not include the async resolver

omnia's People

Contributors

tongson avatar

Stargazers

Shaun Broomfield avatar blv.pro avatar astrolemonade avatar Mika Raunio avatar Valmor avatar Anderson Bravalheri avatar Jason Graham avatar Scott avatar Anders Thøgersen avatar Pradeep Gowda avatar chris avatar Brynne Taylor avatar Johannes Konst avatar Victor Hernandez Candelaria avatar Evan Ricard avatar Diego Alpízar avatar Luke Money avatar Marcio Lopes de Faria avatar  avatar Jonathan McHugh avatar Mitchell Tannenbaum avatar Cristián Romo avatar DENIS DOS SANTOS SILVA avatar Ruslan Zaitsev avatar JL avatar Balazs Szerencsi avatar Owain avatar Hone Watson avatar Void² avatar Arvid Gerstmann avatar  avatar  avatar Max avatar EvanLabs avatar Steven(Yuhang) Wang avatar htbegin avatar Nymphium avatar Roland avatar Gregor Steiner avatar David Nishikaze avatar Marco Fabbri avatar Reyn avatar Eric R. Schulz avatar Eretnek Hippi Messiás avatar GSchenck avatar

Watchers

 avatar Gregor Steiner avatar James Cloos avatar Eric R. Schulz avatar  avatar Walter Di Carlo avatar  avatar JL avatar

Forkers

commandline-be

omnia's Issues

bin/luac compilation is broken on non-musl systems

On Musl systems libc.so already exports the math symbols. Not the case on others like glibc.

Action items:

  1. Add -lm to luac compile line.
  2. Test on glibc from hereon.

Reported by Hisham via the Lua ML.

Module testing

There should be tests for module basic functionality. Recent updates broke module compilation because I forgot to update their makefiles.

Lua is not vanilla

The current Lua diffs/modifications are needed for another project.

Probably a bad idea for other people.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.