Welcome to Ljc documentation

Ljc is a Lua to native executable compiler. Ljc stands for "LuaJIT based compiler".


Lua is a powerful, fast, lightweight, embeddable scripting language. Lua is designed, implemented, and maintained at PUC-Rio by the « Lua team » : Roberto Ierusalimschy, Waldemar Celes and Luiz Henrique de Figueiredo (http://www.lua.org for more information). Lua is a « scripting language », interpreted by a virtual machine (in the lua executable or in the shared library lua51.dll on Windows and liblua51.so on Unix systems). That way, the code is easy to test, to debug. The language is lightweight and can be embedded in other programs easily. But one of the downside of this approach concerns deployment : you have to deploy your Lua source files, the Lua interpreter, and the Lua shared library to the final user (or only the Lua interpreter if built statically which can expose to other caveats). And if you need some third party modules… you can end up with a true nightmare : a lot of directories, shared libraries and Lua source files. Lua wasn’t built initially as a standalone programming language, although the merit.


LuaJIT is a Lua Just In Time compiler for Lua, from Mike Pall (http://www.luajit.org) that gives the Lua community more speed, efficiency by using a modern JIT based virtual machine, and even more a foreign function interface (FFI). LuaJIT gives the capability to call C functions by itself, independently form any other programming language : Lua can now be considered as a standalone programming language. But the problem of deployment, of module management and dependencies remains.

Why Ljc ?

Ljc came in mind with this goal : as a standalone programming language, Lua should produce standalone executables easily. Ljc is built for Lua in Lua (powered by LuaJIT in fact). Ljc is not literally a true compiler : it doesn’t translate Lua statements into machine code. Instead, it translates Lua source files to bytecode and uses the ljc runtime library. The ljcrt contains the virtual machine (Lua 5.3.3 or LuaJIT 2.1). Ljc takes care of all required dependencies (Lua modules and Lua binary modules).

Ljc is developed by me, Samir Tine. Please be indulgent as this work is only beta and programming is just a hobby for me. I have a work and a family in real life so don’t expect fast releases or issues to be resolved « ASAP ». For now, and the time to polish the code, ljc is closed source and available only on the Windows platform. As soon as the first stable version will be released (1.0), the sources will be available.


Ljc - a Lua to native executable compiler for Windows platform

Copyright (C) 2016 Samir Tine. All rights reserved. Released under the MIT license.

LuaJIT -- a Just-In-Time Compiler for Lua.

Ljc includes code from LuaJIT. Copyright (C) 2005-2016 Mike Pall. All rights reserved. Released under the MIT license.

The Lua programming language

Ljc and LuaJIT includes code from Lua 5.1/5.2/5.3. Copyright (C) 1994-2016 Lua.org, PUC-Rio. Released under the MIT license.