4x8matrix/silk
v0.0.1 ·
Silk - Luau in Luau
Yanked
Silk
Run Luau inside Luau. The real interpreter and standard library, compiled to WebAssembly and transpiled to Luau, wrapped in a typed API with hooks to observe and steer execution.
Install
pesde add 4x8matrix/silk
Quickstart
local Silk = require("./luau_packages/silk")
local vm = Silk.new()
print(vm:run("return 6 * 7")) -- 42
vm:setGlobal("greeting", "hi")
print(vm:getGlobal("greeting")) -- hi
The marshalling boundary
vm:push / vm:pull move only basic values: nil, boolean, number,
string. Everything else (tables, functions, userdata) is yours to build on the
stack through the raw C-API on vm.exports. This is deliberate — a VM-embedding
library shouldn't pretend to marshal reference values it can't honestly own.
Tools
Each tool attaches to a VM and shares one cached state per VM:
local hook = Silk.hook.attach(vm)
| tool | what |
|---|---|
control | throttle / stop / watchdog (kill runaway loops) |
trace | instruction stepping |
async | thread primitives (resume / yield / move) |
hook | robust function hooking (globals + upvalue captures) |
intercept | call interception |
closure / proto / memory | upvalues, proto constants, raw memory |
gc | walk live objects by type |
env | sandboxed environments |
Build
scripts/setup.sh # fetch the pinned Luau submodule, apply patches, ensure spider-cli
scripts/build.sh # Luau -> wasm (emscripten) -> Luau (Spider) -> src/generated/vm.luau