This code base does not have an active maintainer anymore, please read this Twitter thread to know more. If you are an existing contributor (or otherwise have an interest in maintaining this project actively) then please email me using the email address in my Twitter profile.
Moonjit is a Just-In-Time Compiler (JIT) for the Lua programming language. Lua is a powerful, dynamic and light-weight programming language. It may be embedded or used as a general-purpose, stand-alone language.
Moonjit is a fork of the inactive LuaJIT project and aims to provide a way forward for existing users of LuaJIT looking for continuity in development and maintenance.
Here is an index of the documentation for moonjit. Old documentation for LuaJIT is unmaintained in doc.luajit and is only there as a historical record.
- Installing moonjit
- Running moonjit
- Moonjit/LuaJIT API and Extensions Reference
- Moonjit FFI
Moonjit ought to run all Lua 5.1-compatible source code just fine. It is
considered a serious bug if the VM crashes or produces unexpected results —
please report this. Lua 5.2 support is in two parts; the backward compatible
elements are built in by default whereas features that break compatibility have
to be enabled using the
-DLUAJIT_ENABLE_LUA52COMPAT flag. The installation
instructions have more details.
Please note the branches
- Fork the moonjit repo on github
- Clone your fork and make changes in a separate topic branch
git clone firstname.lastname@example.org:<your-username-here>/moonjit.git git checkout my-changes
- Make your changes and test them:
make make check
- Commit your changes using the
-sflag to sign off your commit and then push it to your branch.
git commit -a -s git push origin my-changes
- Write a detailed commit log message describing the issue you're fixing so that the information is retained for future reference. If you're fixing an issue, please mention the issue number as fixed using the annothation
Fixes: #NUMin the body of the commit log.
- Create a Pull Request on GitHub.
moonjit has a built-in testsuite that can be exercised by running the following command:
There is also a benchmark suite that can be run as follows:
If you're fixing a bug in moonjit, make sure you add a test case to exercise the bug so that it does not regress. test/README.md has more details on how to execute and update the testsuite.
The project repository on github has the following main branches:
- master: This is the active development branch for moonjit and it is where all new features and targets will be incorporated.
- v2.1: This is a bug fix branch for v2.1.x releases of moonjit. This branch aims to remain compatible with the LuaJIT v2.1 branch.
- v2.0: This remains a bug fix branch that tracks the v2.0 branch of upstream LuaJIT. This branch currently does not have a maintainer.
The following steps need to be performed before tagging a moonjit release:
RELVERto the new version number and set
PRERELto an empty string in Makefile
- Update etc/luajit.pc with the new version
- Update version check assertions in scripts in src/jit. They are of
assert(jit.version_num == xxxxxx, "moonjit core/library version mismatch")where
xxxxxxis the value of
- Update the source package name in INSTALL.md.
- File a PR with these changes.
- Draft release notes based on changes between
HEADand the last tag in a PR comment and update it based on feedback.
- On PR approval, Tag release and put in release notes on GitHub.
PRERELin [Makefile(Makefile) to
-devto indicate that development is now open.
- Hack on next release.