Skip to main content

Lua (Wasm)

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 can run Lua in the browser using Wasmoon.

Wasmoon is a real Lua 5.4 VM with JS bindings made with WebAssembly.

github.com/ceifa/wasmoon

Note

LiveCodes also supports running Lua using Fengari which is the Lua VM written in JavaScript. Read documentation here

Usage

LiveCodes runs Lua in the browser. JavaScript interoperability and DOM access is achieved using the global variable window which exposes the page window object.

This example demonstrates usage, JavaScript interoperability and DOM access:

show code
import { createPlayground } from 'livecodes';

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

Language Info

Name

lua-wasm

Alias

luawasm

Extension

.wasm.lua

Editor

script

Compiler

Wasmoon

Version

Wasmoon v1.15.0

Code Formatting

Using lua-fmt.

Starter Template

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