Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

luau-wasm

PyPI Tests Changelog License

Luau packaged as a Python extension for Pyodide.

This project demonstrates publishing a WebAssembly wheel to PyPI. The wheel contains a compiled CPython extension module that embeds the Luau compiler and VM. In Pyodide 314, micropip can install that PyPI wheel directly in the browser.

Try the playground: https://simonw.github.io/lua-wasm/

Installation

In Pyodide:

import micropip

await micropip.install("luau-wasm")

import luau_wasm

print(luau_wasm.execute('print("Hello from Luau")'))

In JavaScript with Pyodide:

await pyodide.loadPackage("micropip");
await pyodide.runPythonAsync(`
import micropip
await micropip.install("luau-wasm")
import luau_wasm
`);

pyodide.globals.set("source", 'print("Hello from Luau")');
const output = pyodide.runPython("luau_wasm.execute(source)");

Python API

import luau_wasm

output = luau_wasm.execute("""
local name = "Luau"
print(`Hello from {name}`)
""")
assert output == "Hello from Luau\n"

execute(source) creates a fresh sandboxed Luau state, runs the source, captures print() output, and returns that output as a Python string.

Compile and runtime failures raise luau_wasm.LuauError:

try:
    luau_wasm.execute('error("boom")')
except luau_wasm.LuauError as ex:
    print(ex)

run is an alias for execute.

Building

This repository vendors the minimal Luau source needed by the extension in vendor/luau/.

To update the vendored Luau source:

scripts/vendor-luau.sh

To run native tests (which use a native build, not the WASM build):

uv run python -m pytest

To build the Pyodide WebAssembly wheel:

scripts/build-pyodide-wheel.sh

That runs:

uv run --with pyodide-build pyodide build .

The expected wheel target for Pyodide 314 / Python 3.14 is:

cp314-cp314-pyemscripten_2026_0_wasm32

To build using cibuildwheel:

CIBW_PLATFORM=pyodide uv run --with cibuildwheel cibuildwheel

Publishing

Pyodide 314 implements the standardized PyEmscripten platform tags described by PEP 783.

The GitHub Actions publish workflow builds the Pyodide wheel with cibuildwheel.

Development Notes

The extension is intentionally small:

  • native/_luau.cpp provides the CPython wrapper and output capture.
  • setup.py compiles Luau.Common, Luau.Ast, Luau.Bytecode, Luau.Compiler, and Luau.VM into the extension.
  • docs/index.html is a GitHub Pages playground that loads Pyodide, installs luau-wasm from PyPI with micropip, and executes Luau code through Python.

Metadata

Release files for luau-wasm 0.1a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for luau-wasm 0.1a0
File Interpreter ABI Platform Actions
luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl CPython 3.14 CPython 3.14 PyEmscripten 2026.0+ WebAssembly Details for luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl

Release files / luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl

Download URL luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl
Size 271.6 kB
Tags CPython 3.14 PyEmscripten 2026.0+ WebAssembly
SHA-256 checksum
How to use checksums
15c352440d63b9d5d7c9b4ebf6970526de3f1ed80525105b7944833767d6824e
BLAKE2b-256 checksum
How to use checksums
51e780bf252bb7796fda3115aceadf1dba26448e0bf5d05fafc884cd83a9e792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

Security for luau-wasm 0.1a0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for luau_wasm-0.1a0-cp314-cp314-pyemscripten_2026_0_wasm32.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page