Luwa's end goal is to JIT to WASM. Right now it's a bit of a learning environment for me as I've never written a language implementation that required real parsing
I'll try avoid my usual stream of consciousness here, instead that's at my devlog
main.js is nodejs entrypoint
Luwa targets Lua 5.5. scripts/test.js has small cases, scripts/suite.js runs the official 5.5.1 test suite in lua-5.5.1-tests/ file by file, scripts/bench.js times bench/ against the reference Lua built to wasm (scripts/mkreflua.sh)
WASM runtime is in rt/. rt/make.lua is luwa-agnostic macro-assembler logic. mkrt.lua produces an rt.wasm which rt.js interfaces
Objects are WasmGC structs & arrays, the engine collects them. See rt/alloc.lua
VM needs to be reentrant. Currently running coroutine is oluastack. Builtins which call functions work by returning after setting up a necessary callstack. See rt/vm.lua
rt/prelude.lua implements builtins which do not require hand written wasm