Releases: lus-lang/lus
Releases · lus-lang/lus
1.6.1
network.fetchnow rejects carriage-return and line-feed characters in the HTTP method and in custom header keys and values, preventing header injection and request smuggling.- Fixed an out-of-bounds read in
vector.archivegzip and deflate decompression that could append uninitialized memory to the output when decompressing inputs larger than 1 GB. - Fixed a worker thread leaving its mutex locked after an error — including a worker script that fails to load or raises at runtime — which could deadlock a parent waiting on it.
- Fixed running out of memory while growing the call stack being thrown from inside the garbage collector instead of being handled gracefully.
- Fixed a memory leak in the JSON parser when decoding a malformed object key (such as one missing its
:). - Fixed a memory leak in the worker library when a message could not be enqueued under memory pressure.
- Fixed
fs.path.joinorphaning an internal buffer when a later path component is absolute. - Fixed a possible capacity overflow when growing a socket's receive buffer.
- Added a
NULLguard to thelus_worker_sendC API. - The WASM language server no longer writes debug output to stderr on every document change.
Unstable (02d8c75)
Automated build from commit 02d8c75
Included artifact sets: 5/6 available
⚠️ This is an unstable pre-release build. Use at your own risk.
1.6.0
- Added
fromcsvandtocsvto parse CSV files. - Added VM-intrinsified fastcalls for common standard library functions, reducing call overhead by ~31% (1.46x geometric mean speedup across 57 benchmarks).
- When the compiler detects a call to a known stdlib function with the expected argument count, it emits
OP_FASTCALLinstead ofOP_CALL. The VM validates at runtime that the function hasn't been replaced and executes the operation inline, falling back to a normal call otherwise. - Fastcall emission can be disabled by passing
--no-fastcalltolus.
- When the compiler detects a call to a known stdlib function with the expected argument count, it emits
- Added
--readonly-envflag that freezes_ENVand all module tables after initialization, enabling fast-dispatch fastcalls that skip runtime validation. - Added
--gc-pause Nflag to bound how far the heap may grow past the live set before a new GC cycle starts in incremental mode. - Added
--strip-debugflag that drops debug information from every loaded chunk to save memory (~15% of loaded-code memory on small chunks, more on line-heavy files) - Regular long strings no longer store a redundant content pointer, saving 8 bytes per long string.
- The string table now grows at a 1.5 load factor instead of 1.0, shrinking its bucket array by up to a third for string-heavy programs.
for ... in pairs(t)/ipairs(t)/next, tloops over tables now walk the table directly in the VM instead of calling the iterator function each step (pairs ~1.8x, ipairs ~2.3x faster).- Indexing tables with string variables (
t[k]) now takes the same short-string fast path as constant fields, ~15% faster. - Integer-to-string conversion uses a direct conversion loop instead of
snprintf(~20% faster interpolation-heavy code). - Release binaries for Linux and macOS are now built with profile-guided optimization (
tools/pgo-build.sh), 15–45% faster across VM micro-benchmarks than a plain release build. - The worker library no longer pre-allocates a table from an untrusted declared size while deserializing messages.
- Workers now inherit their parent's pledges (sealed).
fspermission checks now canonicalize paths and fail closed.network:http/network:tcppermission checks now match the URL/host structurally, so a pledge forexample.comno longer also permitsexample.com.net.- Passing any
-P/--pledgepermission now seals the pledge store after startup. - Replaced the short-string hash with a full-content hash.
- Fixed
network.tcp.bindnot checkingnetwork:tcppermission. - Fixed
fs.createdirectoryandfs.createlinknot checkingfs:writepermission. - Fixed
fs.typeandfs.follownot checkingfs:readpermission. - Fixed JSON parser not handling
\b,\f,\/, and\uXXXXescape sequences in object keys. - Fixed
msgqueue_pushcrashing on allocation failure in the worker library. - Fixed nested
catchblocks in the same function corrupting control flow on a subsequent error. - Fixed
catchnot closing to-be-closed variables when catching an error, which corrupted state when catching errors raised by standard-library functions that build internal buffers. - Fixed slice expressions not validating that their bounds are integers.
- Fixed slicing an inline table constructor (e.g.
({1,2,3})[a,b]) producing the wrong result. - Fixed
table.clone(t, true)crashing on deeply nested tables. - Fixed
debug.parseleaving the garbage collector permanently disabled if it ran out of memory while building its result. - Fixed an intermittent
attempt to modify a readonly tableerror caused by a value collision between the readonly-table flag and the table pre-set hash-node encoding. - Fixed a buffer overflow in the Windows path canonicalizer on over-long paths.
- Gated the
iolibrary (io.open,io.lines,io.input,io.output,io.tmpfile) behindfs:read/fs:writepledges. - Gated native module loading (
package.loadlibandrequireof C modules) behind theloadandfs:readpledges. - Gated
os.getenvbehind a newenvpledge andos.tmpnamebehindfs:write. - Backport upstream Lua 5.5 fixes:
table
- Added
table.sumto compute the sum of numeric values. - Added
table.meanto compute the arithmetic mean. - Added
table.medianto compute the median. - Added
table.stdevto compute the standard deviation. - Added
table.mapto apply a function to each element. - Added
table.filterto select elements by predicate. - Added
table.reduceto fold a table into a single value. - Added
table.groupbyto group elements by a key function. - Added
table.sortbyto sort in-place by a key function. - Added
table.zipto combine tables element-wise into tuples. - Added
table.unzipto split tuples into separate tables. - Added
table.transposeto transpose a 2D matrix. - Added
table.reshapeto reshape a 1D array into a matrix. - Added
table.compact(and C APIlua_compacttable) to shrink a table's internal storage to fit its current contents.
string
- Added
string.splitto split a string on a delimiter. - Added
string.jointo join table elements with a delimiter. - Added
string.trimto remove leading and trailing characters. - Added
string.ltrimto remove leading characters. - Added
string.rtrimto remove trailing characters.
vector
- Added
vector.archive.gzip.compressandvector.archive.gzip.decompressfor gzip compression. - Added
vector.archive.deflate.compressandvector.archive.deflate.decompressfor raw deflate compression. - Added
vector.archive.zstd.compressandvector.archive.zstd.decompressfor Zstandard compression. - Added
vector.archive.brotli.compressandvector.archive.brotli.decompressfor Brotli compression. - Added
vector.archive.lz4.compress,vector.archive.lz4.decompress, andvector.archive.lz4.decompress_hcfor LZ4 compression.
1.5.1
v1.5.0
- Added string interpolation.
- Added runtime attributes for altering local assignments.
- Added error-processing handlers to
catchexpressions. - Added initial language server foundation and VSCode extension.
- Enum ordering comparison across different enum roots now raises a runtime error.
- Brought
debug.parseto parity with the internal parser. - Fixed
debug.parseserializing linked lists as single nodes instead of arrays. - Fixed buffer overflow in worker message serialization when arena allocation fails.
- Fixed missing recursion depth limit in worker message deserialization.
- Fixed integer overflow in
deser_readbounds check that could allow out-of-bounds reads with largesize_tvalues. - Fixed negative or huge table counts in worker deserialization being passed to
lua_createtableunchecked. - Fixed missing
luaL_checkstackin worker deserialization that could exhaust the Lua stack on deeply nested tables. - Fixed uninitialized constant slots in enum parsing that could cause a GC crash when
luaM_growvectorexpanded the constants array. - Fixed race condition in worker receive context signaling that could cause a use-after-free when
lib_receivedestroys a stack-allocated context while a worker thread is still accessing it. - Fixed missing bounds checking in bundle index parser.
adjustlocalvarsnow validates the register limit before assignment.
1.4.0
- Completed phase-out of function-level protected execution.
- For software embedding Lus and only making use of the front-facing C APIs like
lua_pcall, this should not impact you as the functions have been retrofit with compatibility layers interfacing with the new catch system.
- For software embedding Lus and only making use of the front-facing C APIs like
- Added
--standaloneto generate standalone binaries. - Added local groups for grouping stack-allocated variables.
- Added
vectortype and library for buffers. - Added slices for strings, tables, and vectors.
- Added
table.clone(t, deep?)to create copies of tables. - Added
catch[handler] exprsyntax to allow expression-levelxpcall-like functionality. fromdeconstruction can now be done inif/whileassignments.- Refactored actions workflow.
- Various runtime optimizations:
- Constant-time O(1) string hashing using sparse ARX algorithm.
- Aligned string comparison for faster ordering.
- Alias-aware table loops for improved compiler optimization.
- O(1) catch handler lookup via
activeCatchpointer. - Cold path extraction for trap handling and catch error recovery.
- Arena-aware allocations where performance can be reliably improved.
- Moved slice logic out of the VM and into its own
luaV_slicefunction.
- Fixed our Windows builder, meaning Windows support has finally returned.
- Fixed race condition in
worker.receivethat could cause lost wakeups. - Fixed attribute usage in if-assignments and while-assignments.
- Fixed deeply nested JSON encoding/decoding crashing.
1.3.0
- Added scoped assignments in
whileloops. - OpenBSD-inspired
pledgemechanism to declare and restrict permissions. - Added
string.transcodefor converting between encodings. - Added
network.fetch,network.tcp, andnetwork.udp. - Added
debug.parseto generate ASTs from Lus code. - Added
workerlibrary for concurrency. - Backport Lua 5.5 RC3 and stable fixes:
1.2.0
- Added
fslibrary for operating around the file system. - Removed
os.renamein favor offs.move. - Removed
os.removein favor offs.remove. - Fixed incorrect version strings.
- Fixed H3 test harness not running.
- Fixed
catcherroring when parsed as a statement. - H1 JSON test now includes the RFC8259 dataset.
- H1 JSON test now makes use of
fslibrary.
1.1.0
1.0.0
Note
This changelog denotes differences between Lus and Lua 5.5 RC 2. Lua 5.5 most (in)famously introduces the global assignment statement; it is not a Lus-specific feature.
- Added table deconstruction with
fromassignment. - Added scoped assignments in
if/elseifconditionals. - Added
catchexpression for error handling in expressions. - Added optional chaining with the
?suffix operator. - Added first-class enums with the
enumkeyword. - Added
os.platformfunction that returns the platform name. - Added support for WebAssembly builds.
- Added pre-built test suites in four harnesses.
- Removed
pcallandxpcallin favor ofcatch. - Upgraded the build system from
maketomeson.