andrewrk / lua-in-the-browser

using zig to build lua for webassembly

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lua-in-the-browser

This is the result of a 2.5 hour live coding stream in which I tried to build Lua using ZIG, targeting WebAssembly.

Status

Able to produce lib/lua.wasm, however in the browser it says LinkError: import object field 'getc' is not a Function.

To make further progress it is required to make modifications to Lua source code in order to remove the dependency on a file system.

This depends on pending modifications to Zig.

How to build it and run it

zig build install --prefix .
python3 -m http.server

Then visit the link printed with a modern browser such as Firefox.

About

using zig to build lua for webassembly


Languages

Language:C 96.7%Language:C++ 2.0%Language:Makefile 1.0%Language:Zig 0.2%Language:HTML 0.1%