livecode-static/docs/languages/lua-wasm.html.md
2025-06-11 22:23:49 +08:00

1.5 KiB

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

:::info 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.

import LiveCodes from '../../src/components/LiveCodes.tsx';

This example demonstrates usage, JavaScript interoperability and DOM access:

Language Info

Name

lua-wasm

Alias

luawasm

Extension

.wasm.lua

Editor

script

Compiler

Wasmoon

Version

Wasmoon v1.16.0

Code Formatting

Using lua-fmt.

Starter Template

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