Versioned configuration and parameter lists for LightVM. The module validates a VM/parameter version pair and returns a fresh parameter table for each request.
- Lua (the tests run with
luaby default) luacto build the compiled artifactmake
Clone the repository, then run commands from its root. No third-party Lua packages are required.
Load src/main.lua and call the global get_parameters function with the VM
version and parameter version:
dofile("src/main.lua")
local parameters = get_parameters(
"0.1.0-r1",
"0.1.0-alpha.9-nightly.20260921.abc123"
)
print(parameters.version)
print(parameters.compileConfig.targetArch)LightVM 0.1.0-r1 accepts Alpha.9 nightly parameter versions in this exact
form:
0.1.0-alpha.9-nightly.<date>.<hash>
Both <date> and <hash> must be non-empty and may not contain dots. Matching
versions load the parameters in src/010a9p0. Incompatible, malformed, or
compatible-but-unimplemented versions raise a Lua error.
get_parameters returns a table containing:
version: the requested parameter versionnightly_lists:instantiate,export, andimportcapabilities: supported VM capabilitiestimeBudgets: supported time-budget namestargetArchitectures: supported compilation targetsfileTypes: supported output typesvmConfig: runtime, error-reporting, and security defaultscompileConfig: target architecture, file type, and output path defaults
The returned configuration is deep-copied, so callers can modify it without changing values returned by later calls.
Compile src/main.lua to dist/config.luac:
make buildRun the parameter and version-validation tests:
make testTo use a different Lua executable:
make test LUA=lua5.4Version compatibility and module selection are defined in src/main.lua.
Version-specific configuration belongs under src/<version>/, with its public
table assembled by parameters.lua. When adding or changing a supported
version, update the compatibility mapping and safe loader together, add coverage
to tests/test_parameters.lua, then run make test and make build.