Borrow VM strings through std so wasm32 sees their length

The VM built string views from a hand-written { *u8, u64 } descriptor,
which on wasm32 (size_t lengths) read every string as empty. Views now go
through std's BytesFromPointer, which uses the target's slice layout.

The object records and LuaSyntaxNode are private again, now that the
toolchain (locked to 88b505bf) handles Vecs of module-private records.
`make wasm` builds the VM for the web platform with Emscripten and runs
it in a private headless Chromium as part of `make test`.
This commit is contained in:
waozi committed 2026-11-07 02:48:50 -03:00
1 parent 4b1ab58056
commit 8033702823
9 files changed
+135 -29

No files matched your search

+3 -3
View File
@@ -3,9 +3,9 @@
`#import "lua/vm"` gives a Lua 5.1 virtual machine (LuaJIT dialect) written
in Ziran. The API follows the shape of the Lua C API: a host owns a
`LuaState` record, values move through a stack, and natives are plain Ziran
procedures. Names below are stable; records not listed here (`LuaTable`,
`LuaClosure` and the other object records exported with `LuaState`) are
internal and may change.
procedures. Names below are stable. Use `LuaState` only through them: its
fields are internal, and the object records they hold are private to the
package.
## State