-
Notifications
You must be signed in to change notification settings - Fork 203
Comparing changes
Open a pull request
base repository: Shopify/go-lua
base: main
head repository: speedata/go-lua
compare: main
- 20 commits
- 81 files changed
- 1 contributor
Commits on Dec 26, 2025
-
- Native 64-bit integer support (int64) - Bitwise operators: &, |, ~, <<, >> - Integer division: // - UTF-8 library - String packing (string.pack/unpack) - Math extensions (math.tointeger, math.type, etc.) - Fixed for-loop integer semantics - Fixed vararg stack overflow - 10/11 official Lua 5.3 tests pass"
Configuration menu - View commit details
-
Copy full SHA for 6fbad5a - Browse repository at this point
Copy the full SHA 6fbad5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a75b29 - Browse repository at this point
Copy the full SHA 0a75b29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8bc2f1e - Browse repository at this point
Copy the full SHA 8bc2f1eView commit details -
Configuration menu - View commit details
-
Copy full SHA for b015d5d - Browse repository at this point
Copy the full SHA b015d5dView commit details -
Configuration menu - View commit details
-
Copy full SHA for f940d67 - Browse repository at this point
Copy the full SHA f940d67View commit details -
- error() now preserves any value as error object (not just strings) In Lua 5.3, error(value) can be called with tables, nil, etc. The value stays on the stack and is returned by pcall. - table.sort: add "array too big" check for __len > INT_MAX Prevents hang when metatable returns huge length values. - table.move: add "too many elements to move" validation Matches Lua 5.3 reference implementation bounds checking.
Configuration menu - View commit details
-
Copy full SHA for afdd10d - Browse repository at this point
Copy the full SHA afdd10dView commit details -
Implement debug.getinfo Lua wrapper
Add debug.getinfo function that returns introspection data about functions and stack frames. Supports all standard options: - 'S': source, short_src, linedefined, lastlinedefined, what - 'l': currentline - 'u': nups, nparams, isvararg - 'n': name, namewhat - 't': istailcall - 'f': func (the function itself) - 'L': activelines table The core Info() Go function already existed - this adds the Lua-facing wrapper that builds the result table. calls.lua and constructs.lua now progress further but fail on other issues (load reader function, operator precedence).
Configuration menu - View commit details
-
Copy full SHA for 345416d - Browse repository at this point
Copy the full SHA 345416dView commit details -
Cache ipairs iterator function
In Lua 5.3, ipairs{} must return the same iterator function each time (ipairs{} == ipairs{}). Previously, each call created a new Go function. Now the iterator is cached in the registry on first use and reused for all subsequent ipairs calls. Uses a unique pointer key to avoid collisions with user data. This enables the nextvar.lua test to progress further (now fails on a different issue: "invalid key to next").Configuration menu - View commit details
-
Copy full SHA for a3df8bf - Browse repository at this point
Copy the full SHA a3df8bfView commit details -
string-to-integer coercion for bitwise operations
Lua 5.3 requires strings to be coerced to integers for bitwise operations. This commit implements that behavior: - Add toIntegerString() method in types.go for string coercion - Change coerceToIntegers to State method using toIntegerString - Update all bitwise op call sites in vm.go (BAND, BOR, BXOR, SHL, SHR, BNOT) - Fix functionName() to use savedPC-1 for correct call instruction - Enable bitwise and constructs tests in vm_test.go The bitwise and constructs Lua 5.3 tests now pass.
Configuration menu - View commit details
-
Copy full SHA for 2233fa4 - Browse repository at this point
Copy the full SHA 2233fa4View commit details -
Scanner: - Add readHexFraction for fractional hex digits without overflow - Track overflow digits as exponent adjustment in readHexNumber Types: - Add 4th return value (ok) to parseNumberEx for validation - Fix tonumber('0x') returning 0 instead of nil Math library: - math.abs: preserve integer type, overflow wrapping for minint - math.atan: support optional second argument (atan2) - math.tointeger: range check before int64 conversion - math.fmod: preserve integer type, "zero" error for div by 0 - math.max/min: preserve integer type, "value expected" error - math.random: return integers, proper range handling up to 2^63 Debug: - bitwiseError includes field/upvalue names from debug infoConfiguration menu - View commit details
-
Copy full SHA for dc1fe7b - Browse repository at this point
Copy the full SHA dc1fe7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6f18b28 - Browse repository at this point
Copy the full SHA 6f18b28View commit details -
The test had a loop waiting for weak references to be GC'd, but go-lua doesn't support weak refs (__mode metatables). Added _noweakref flag to skip the weak reference loop. This enables the closure test in the test suite.
Configuration menu - View commit details
-
Copy full SHA for 20ae991 - Browse repository at this point
Copy the full SHA 20ae991View commit details -
- Format all source files with go fmt - Fix undump.go shift warning (instruction is always 32-bit) - Remove dead code in io.go (err was always nil) - Update TestIntegerValues for strict integerValues behavior
Configuration menu - View commit details
-
Copy full SHA for 46164b2 - Browse repository at this point
Copy the full SHA 46164b2View commit details -
Fix next() err when deleting keys during iteration
The next() function would throw "invalid key to 'next'" when the current key was deleted from the hash table during iteration. Fix: Check if the key matches our position marker before checking if it was deleted. This allows iteration to continue correctly even when keys are removed mid-iteration.
Configuration menu - View commit details
-
Copy full SHA for 10df49a - Browse repository at this point
Copy the full SHA 10df49aView commit details
Commits on Dec 27, 2025
-
Add table library metamethod support
table.insert, table.remove, table.sort now respect __index/__newindex metamethods, allowing them to work with proxy tables. Changes: - table.insert: Use Table/SetTable instead of RawGetInt/RawSetInt - table.remove: Use Table/SetTable for element shifting - table.sort: Update sortHelper.Swap/Less to use metamethods - table.concat: Use Table for reading elements - table.unpack: Use Table for reading elements, fix integer overflow bug when iterating near maxInt Also adds comprehensive tests for metamethod support.
Configuration menu - View commit details
-
Copy full SHA for 2d3c5df - Browse repository at this point
Copy the full SHA 2d3c5dfView commit details -
Fix EXTRAARG handling for large tables
EncodeConstant was using opLoadConstant instead of opLoadConstantEx when constant index exceeded maxArgBx (262143). The VM expects opLoadConstantEx to read the index from the following EXTRAARG instruction. Adds TestLargeTableExtraArg to verify tables with >262143 elements.
Configuration menu - View commit details
-
Copy full SHA for 184fdc7 - Browse repository at this point
Copy the full SHA 184fdc7View commit details -
Implement file:read() with all format specifiers
Add full f:read() support for file handles: - read("l")/read("*l"): line without EOL (default) - read("L")/read("*L"): line with EOL - read("n")/read("*n"): number (integer, float, hex) - read("a")/read("*a"): entire file - read(n): n bytes - read(0): EOF test Also fixes write() to preserve string content exactly (was incorrectly converting numeric-looking strings through number conversion, losing newlines like "123\n" -> "123").Configuration menu - View commit details
-
Copy full SHA for f7627dd - Browse repository at this point
Copy the full SHA f7627ddView commit details -
Implement io.popen for process I/O
Add io.popen(command, mode) support: - Read mode ("r"): capture command stdout - Write mode ("w"): pipe to command stdin - close() returns true on success, or nil/error/exitcode on failure Uses os.Pipe() to get real file descriptors compatible with existing stream infrastructure.Configuration menu - View commit details
-
Copy full SHA for 1790b92 - Browse repository at this point
Copy the full SHA 1790b92View commit details -
Replace deprecated io/ioutil with io and os
- ioutil.ReadAll → io.ReadAll - ioutil.ReadFile → os.ReadFile - ioutil.TempFile → os.CreateTemp Also fix popen to use /bin/sh and ensure PATH includes standard locations for subprocess commands.
Configuration menu - View commit details
-
Copy full SHA for b81c2b8 - Browse repository at this point
Copy the full SHA b81c2b8View commit details -
Add Windows support for io.popen
Use cmd.exe /c on Windows, /bin/sh -c on Unix. PATH extension only needed on Unix due to sandbox environments.
Configuration menu - View commit details
-
Copy full SHA for 1625738 - Browse repository at this point
Copy the full SHA 1625738View commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main