LuaDirectory > LuaAddons > Lua
Implementations
There are quite a few re-implementations of Lua. The simplicity of Lua is a factor in this.
Re-implementations of Lua compilers and interpreters: (sorted by target/host platform)
- ANSI C / Lua Bytecodes
- [Lua] (5.1/5.2/5.3) - Compiles Lua source to standard Lua bytecodes. Lua VM interprets Lua bytecodes. Implemented in ANSI C. This is the standard reference implementation of Lua. Highly robust.
- x86, x64, ARM, PPC, MIPS
- [LuaJIT] (5.1) - A just-in-time (JIT) compiler for Lua 5.1. Much better performance [1].
- [LJX] (5.1/5.2/5.3) - Experimental fork of LuaJIT 2.1-beta2, adds native language semantics of Lua 5.2 (such as __gc for tables, _ENV) and 5.3 (bitwise operators). Includes cross-compatibility between versions.
- LLVM (JIT)
- LlvmLua (5.1) - Converts Lua bytecode to LLVM IR code. Supports both JIT and static compiling. Limited to the CPUs LLVM supports. Implemented in C/C++.
- Lua
- [Yueliang] (5.1/5.0) - Compiles Lua source to standard Lua byte codes. Implemented in Lua. This is a no-brainer port, but it also includes an optional more native style port of the parser/lexer.
- [FiOne] (5.1) - Lua 5.1 VM implemented in Lua. Implements a VM interpreter, but reuses the host Lua environment for data types and standard library functions. The fastest Lua bytecode interpreter on the list. Needs a bit and/or a bit32 library to function. Fixes several bugs with closures and other opcodes.
- [LuLu] (5.1) - Lua 5.1 VM implemented in Lua. Implements a VM interpreter and coroutine library, but reuses the host Lua environment for data types and standard library functions. Has bugs with nil arguments in closures.
- [LBI] (5.1) - Lua 5.1 VM implemented in Lua. Implements a VM interpreter, but reuses the host Lua environment for data types and standard library functions. Has bugs with nil arguments in closures. Doesn't clean up closure stack causing invalid behavior.
- [FiThree] (5.3) - Lua 5.3 VM implemented in Lua. Implements a VM interpreter, but reuses the host Lua environment for data types and standard library functions. Needs a bit and/or a bit32 library to function.
- [Metalua] (5.1) - Compiles a superset of Lua, supporting Lisp-style macros and syntax extensions, to standard Lua bytecodes. Implemented in Lua (with some C). Parser (source -> AST translator), which is reusable separately, implemented in Lua via the gg parser translator (implemented in Lua), which is partially based on Yueliang.
- See also LuaCompilerInLua, LuaInterpreterInLua, StringLibraryInLua
- Java
- [Kahlua][25] (5.1) - Virtual Machine and compiler for (a subset of) Lua in Java J2ME (CLDC 1.1). Implemented in Java, runs on J2SE and J2EE too. VM interprets standard Lua bytecodes. Uses Java's garbage collection[2]. [Differences] Compiler forked from LuaJ.
- [Mochalua] (5.1) - Lua virtual machine, libraries and API ported to Java J2ME CLDC 1.1 [26]. VM interprets standard Lua bytecodes.
- [LuaJ] (5.1, 5.2) - Lightweight, fast Java-centric Lua interpreter written for both J2ME and J2SE, including libraries for basic, string, table, package, math, coroutine packages, an optional compiler, luajava bindings, and [JSR-223] pluggable scripting engine bindings. [LuaJ home page]
- [Rembulan] (5.3) - Clean-room implementation of Lua 5.3 for the JVM with minimal dependencies (requires JDK 7+). Compiles to Java bytecode. Implements lightweight coroutines, allows execution time limiting.
- [LuaJava] (5.1) - LuaJava? is a scripting tool for Java, based on JNI (using Lua 5.1.1 binaries).
- [JNLua] (5.1, 5.2) - The Lua C code is integrated into Java using the Java Native API (JNI). [JSR-223] pluggable scripting engine bindings.
- [Jill] (5.1) - Java Implementation of Lua Language. Originally produced under a commercial contract, now open source. VM, compiler, API, and libraries running on JME CLDC 1.1. VM interprets standard Lua bytecodes. The libraries exist to the extent that CLDC supports them (no io.*, and math.* is reduced). Runs on JSE as well. 33 classes.
- [hklib] (5.3) - Lua Interpreter implementation in Java with strong Lua-Java bridging and wide customization of the Lua environment but no debug or package libraries. Also includes a simple Java library as well. Any library can very easily be implemented in Java and imported into the Lua environment.
- Older: [JLua] [jua]
- .NET
- [LuaCLR] - (5.1) Compiles Lua source to .NET CLR. Implemented in Lua.
- [Lua2IL] Note: Link dead 14/10/13- (5.0) Translates Lua 5.0 bytecodes to .NET CLR (IL instructions). This is the precursor of LuaCLR. [3] (FIX:what is the translator implemented in?)
- [Nua] (5.1) - Compiles Lua source to the .NET Dynamic Languages Runtime (DLR). Implemented in C#. [4]
- [XNua] NOTE: link dead 14/10/13 - (5.1). Compiles Lua source to .NET bytecodes (particularly Xbox 360). Implemented in C#. Uses .NET's garbage collection[5] and has other differences/limitations[6].
- [Kopi Lua] - (5.1) A line-for-line port of the Lua source code (compiler, VM, GC, libraries etc.) to C#. Byte-code compatible with the C version.
- [SharpLua] - A Lua implementation in C# based off of Lua 5.1.5.
- [AluminumLua] - "A fast, lightweight Lua scripting engine written entirely in C#."
- [Quorra] - Aims to provide full functionality and compatibility with Lua in .NET / Mono
- [UniLua] - (5.2) A pure C# implementation of Lua 5.2 focus on compatibility with Unity3D.
- [NLua] - (5.1.5/5.2.2) A mix of C# implementation with native binding, compatible with .NET/iOS/Android/WinPhone?.
- [NeoLua] - NeoLua?, A Lua 5.2 implementation for the Dynamic Language Runtime (DLR).
- [Moon#] - Moon#, a Lua 5.2 implementation written entirely in C# for .NET 3.5/Mono 2.6 and later versions.
- [LunaRoad] - Lua C API (v5.1, 5.2, 5.3, ...) for .NET / represents a flexible platform to work with Lua. Provides Lua interfaces, Lambda expressions, Dynamic features that can be used to generate new API-Layer automatically at runtime, etc. Active as of 2016.
-
- Parrot VM
- [Parrot VM] (5.1) - Compiles Lua source to Parrot VM byte codes (PMC). Implemented in Perl. Standard libraries implemented in PIR[7]. [SVN]
- C API
- LuaToCee (5.1) - Translates Lua source to C API calls. Implemented in Lua (based on Metalua's parser implemented in Lua).
- [luac2c] (5.1) - Translates Lua byte codes to C API calls. Implemented in Lua.
- Java
Script
- Action
Script - variant of Java
Script included in Flash.
- [flua] (5.0) NOTE: link dead 14/10/13 - Lua 5.0 VM in Action
Script. VM interprets standard Lua bytecodes. Implemented in Action
Script.
- [lua-alchemy][Lua under Alchemy][29] (5.1) - Standard Lua 5.1 compiler and VM implemented in Action
Script (Flash variant of Java
Script) with inline AVM2 bytecodes in an .swc file. This .swc was machine translated from the standard Lua sources using Alchemy[10][11], which is a backend to LLVM[12]. (So, this is not a manual reimplementation but rather an interesting machine translation.) [example:Phyzios]
- [lua.js] - converts Lua code directly to ECMAscript or Action
Script.
- Leonardo VM
- OCaml
- [Lua-ML] (2.5) - Lua 2.5 interpreter. Implemented in Objective Caml.
- Erlang
- [luerl] - Lua implemented in Erlang, by Robert Virding, one of the creators of Erlang. [13][14]
- Go
- [gopher-lua] - GopherLua? is a Lua5.1 VM and compiler written in Go.
- [go-lua] - go-lua is a port of the Lua 5.2 VM to pure Go.
- [DCLua] - This is a Lua 5.3 VM and compiler written in Go.
Reimplementations only of the Lua lexer or parser (no code generator or VM):
Bindings to Standard Lua:
Other languages implemented in Lua:
- Lisp:
- [LuaLisp] (5.0?)
- [Mun] (5.1) Lisp on Lua (sorta)
- Related: [lcl] (Lhf);
- [ClojureScript/Lua] NOTE: link dead 14/10/13- backend for Clojure
Script that targets Lua. Still requires Java for the compiler.
- Forth: see "Chapter 6: Boostraping a Forth in 40 lines of Lua code" by EduardoOchs in Lua Programming Gems (see LuaBooks) [15] (5.1)
- ANSI C: [Clue] (5.1) - Translates C to Lua source code. Implemented in C, using sparse[16], which is also implemented in C.
- Lua: see Yueliang above (5.1)
- [MoonScript] - Language inspired by [CoffeeScript]. Compiles to Lua source.
- [number-lua] Number
Script to Lua converter (based on [JavaScript NumberScript]) - [esoteric] programming language using only numbers. LuaList:2012-06/msg00627.html
- [Gaia] (5.1) - Gaia aims to provide a parser and bytecode generator for the Lua VM to aid in targetting the Lua VM as a runtime for other dynamic languages. At this stage only Lua 5.1 is supported.
- [Lupa] (Luajit) - Lupa - multi-paradigm object oriented, dynamic language.
- [Nyanga] (Luajit) - Nyanga - Object Oriented Lua Dialect.
- [:Firth] (Luajit, 5.2) - :Firth - A simple Forth-like language intended for DSL creation. Early alpha stages.
Languages based on Lua
These languages are based on the Lua implementation (e.g. adapted VM).
- PlutoScript[17]
- Agena[18][30] - based on Lua C source, but has significant syntax differences
- Idle[19]
- Dao[20][31][32]
- [LuaPlus] - based on 5.0work, no longer appears maintained
- Bright[21][22] - more C like syntax, based on Lua 4.0, no longer appears maintained
- Squirrel[23]
- [SquiLu] - A mix between Squirrel and Lua, trying to get the best of both.
- Objective Lua[24]
- Python: [tinypy] - a small subset of Python written in the style of Lua (but not based on Lua code).
- MetaLua - brings compile-time metaprogramming to Lua. Compiles to standard Lua 5.1 bytecodes.
- [Killa]: a scripting language based in Lua 5.2 with a JavaScript?-like syntax
- [Ravi] - a modified version of Lua 5.3 with optional static types and JIT compilation.
- [Jual] - A VM based on Lua 5.3 with JavaScript?-like syntax and is bytecode compatible with Lua 5.3
- [LJS] - A VM based on Lua 5.3 with JavaScript?-like syntax, bytecode-compatible with Lua 5.3; a mix of Killa, Jual and others
- [LJSJIT] - A VM based on LuaJIT 2.1.0-beta3 with JavaScript?-like syntax, bytecode-compatible with Lua 5.1; a mix of Killa, Jual and others
- [Luau] - An open source language based on Lua 5.1, adapted for the needs of the Roblox multiplayer gaming platform.
Lua test suites
For test suites to check the correctness of Lua implementations, see UnitTesting.
See Also
- LuaDistributions / LuaBinaries - These are compilations or adaptations of Lua to different platforms. These differ from the above in that they are not complete reimplementations of Lua but rather have minor or no changes to the Lua source code.
RecentChanges · preferences
edit · history
Last edited August 14, 2023 11:23 pm GMT (diff)