Skip to main content

Lua

Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.

LiveCodes runs Lua in the browser using Fengari.

Fengari (Moon in greek) is the Lua VM written in JavaScript. It uses JavaScript's garbage collector so that interoperability with the DOM is non-leaky.

fengari.io

Note

LiveCodes also supports running Lua using Wasmoon which is a real Lua 5.4 VM with JS bindings made with WebAssembly. Read documentation here

Usage

LiveCodes runs Lua in the browser. JavaScript interoperability and DOM access is achieved using "js" module.

This example demonstrates usage, JavaScript interoperability and DOM access:

show code
import { createPlayground } from 'livecodes';

const options = {
"template": "lua"
};
createPlayground('#container', options);

Language Info

Name

lua

Extension

.lua

Editor

script

Compiler

Fengari

Version

Fengari v0.1.4

Code Formatting

Using lua-fmt.

Starter Template

https://livecodes.io/?template=lua