Releases: OMouta/PyLua
0.3.1
PyLua 0.3.1 Changelog
Major Features
Python Classes & Inheritance
- Full class definition support with
classkeyword - Inheritance system with proper method resolution order (MRO)
super()builtin for calling parent class methods (both implicit and explicit arguments)- Instance creation via
__init__methods isinstance()enhancement to recognize inheritance hierarchies- Class and instance attributes with proper resolution
- Method binding for both Python and builtin methods
Module System & Imports (PEP 451 Architecture)
- Complete import system implementing PEP 451 specification
ModuleSpec,Finders, andLoadersarchitectureimportstatement supportfrom ... import ...syntax with aliasesfrom ... import *(import all)
- Relative imports with dot notation (
.,.., etc.) - Multiple import sources:
- Native modules (Luau objects exposed to Python)
- Memory mounts (in-memory virtual filesystem)
- Filesystem support with configurable backends (Lune, Lute, Roblox, Virtual)
- sys module with
sys.modulesandsys.pathsupport - Module caching via
sys.modules - Module attributes:
__spec__,__file__,__package__,__path__,__name__, etc. - Import policy system with allow/deny rules for security
Object System Enhancements
- Type hierarchy with proper base class tracking
- Method resolution order (MRO) computation
objectbase type explicitly availabletypeobjects properly wrapped and accessible- Bound methods for both Python and builtin functions with owner tracking
Bug Fixes
Lexer Improvements
- Fixed indentation handling for blank lines in class definitions
- Comment-only lines no longer trigger spurious dedents
- Blank indented lines preserve indentation context properly
Parser & Compiler
- Added support for
importandfromstatements with proper alias handling - Dotted import names (e.g.,
import a.b.c) properly parsed - Relative import levels correctly tracked
VM & Interpreter
- Active frame tracking for
super()introspection - Function objects now track their owner class
- Fixed circular import handling via early sys.modules registration
- Proper parent package binding for submodules
Configuration Changes
Runtime Options (New)
searchPath: List of paths to search for modulesnativeModules: Dictionary of native Luau modules to exposemounts: Virtual filesystem mounts (package name -> files)fileSystem: Filesystem adapter (Lune, Lute, or Virtual)enableFilesystem: Enable filesystem-based importspolicy: Import policy with allow/deny rules
Breaking Changes
- Type system now requires explicit base classes (defaults to
object) isinstance()now uses type hierarchy instead of string matching- Boolean type now inherits from int (matching Python semantics)
Miscellaneous
- Fixed formatting and linting issues throughout codebase
- Improved error messages for import failures
Full Commit Range: 0.3.0...0.3.1
0.3.0
After almost 5 months of development, version 0.3.0 is out! Special thanks to those who contributed to this project.
What's Changed
- Refactor PyLua project structure and update documentation by @OMouta in #4
- Enhance error reporting in PyLua compiler by @OMouta in #5
- Optimize compiler performance and error handling improvements by @OMouta in #6
- Refactor PyLua to a runtime-based architecture by @OMouta in #7
- Implement floor division and matrix multiplication support by @OMouta in #8
- Enhance comparison by @OMouta in #10
- Implement dictionary unpacking support by @OMouta in #11
- Add support for tuple destructuring in for loops and implement UNPACK_SEQUENCE opcode by @OMouta in #12
- Implement try/except exception handling by @OMouta in #13
- Feature/exception handling extended by @OMouta in #14
- Refactor boolean and None handling to use singleton instances for consistency by @OMouta in #15
- Update LIMITATIONS.md and REWRITE_PLAN.md for f-string implementation by @OMouta in #16
- Add interop functionality and tests; by @OMouta in #17
- String Indexing by @OMouta in #19
- Class binding support and custom attribute handling by @OMouta in #20
- Lambda expressions by @OMouta in #21
- Split compiler and parser expressions in to smaller modules by @OMouta in #22
- Split interpreter.luau in to multiple sub-modules by @OMouta in #23
- Generator functions and yield semantics by @OMouta in #24
- Performance optimizations: 15-40% faster execution across lexer, VM, and collections by @Copilot in #25
Full Changelog: V0.2.1...0.3.0
0.3.0-dev3
What's Changed
- String Indexing by @OMouta in #19
- Class binding support and custom attribute handling by @OMouta in #20
Full Changelog: 0.3.0-dev2...0.3.0-dev3
0.3.0-dev2
Another developer preview of the v0.3 rewrite
Getting started
- Read README and the component docs in docs/
- Browse runnable examples in examples/
Full Changelog
What's Changed
- Enhance comparison by @OMouta in #10
- Implement dictionary unpacking support by @OMouta in #11
- Add support for tuple destructuring in for loops and implement UNPACK_SEQUENCE opcode by @OMouta in #12
- Implement try/except exception handling by @OMouta in #13
- Feature/exception handling extended by @OMouta in #14
- Refactor boolean and None handling to use singleton instances for consistency by @OMouta in #15
- Update LIMITATIONS.md and REWRITE_PLAN.md for f-string implementation by @OMouta in #16
- Add interop functionality and tests; by @OMouta in #17
Thanks to everyone who contributed ideas, feedback, and code.
0.3.0-dev
First developer preview of the v0.3 rewrite
This is the first dev build of the full PyLua v0.3 rewrite: a Python 3.12-focused interpreter implemented in Luau with a CPython-style pipeline (Lexer → Parser → AST → Compiler → Bytecode → VM). It’s a ground-up redesign for correctness, maintainability, and a Lupa-inspired API (Python-in-Luau). Expect rough edges and behavior may change before a stable release.
Getting started
- Read README and the component docs in docs/
- Browse runnable examples in examples/
Full Changelog
Compare all changes since V0.2.1:
V0.2.1...0.3.0-dev
Commits since V0.2.1 (most recent first):
bfa833e — Remove old code and move 0.2 README to docs, add comprehensive API docs
f811ac7 — Fix JUMP_FORWARD handling; adjust SETUP_LOOP/CONTINUE_LOOP logic
38c8daa — Merge #8: Implement floor division and matrix multiplication support
3db7f35 — Implement // and @; update compiler/VM/collections; add tests and docs
b3c14e1 — Add List comprehensions and unit tests
8f761c0 — Mark f-strings as complete
6b0d0e0 — Implement F-string support in parser and interpreter
c63c14c — Move from Lune to Lute; doc/formatting cleanups
d834512 — Elif/else chains; core built-ins; setup for Packages
1ab58ff — Implement bytes type and related functionality
02c6389 — Lexer: comments, triple quotes/prefixes; compiler/VM compare ops; dict/set hashing; NEWLINE locations; tokens endColumn; parser strict errors; '@' tokenization
59e8553 — Implement break/continue with tests
f7a89c9 — Fix list/map tests to validate PyObject types/values
2aa000c — Implement for loop support + iteration opcodes; interpreter cleanup
51a3bd2 — Update tests and jelly run format
fa054ea — Complete Frame.setVariable to check context
2010510 — Function creation/calling + tests
93acd1d — Implement some control flow statements
4de8c12 — Update .gitignore for Packages and .vscode
efde554 — Fix Copilot instructions implementation
1bbc78f — Jelly run format
4e987ba — Fix lint error on CODE_OF_CONDUCT
20aa316 — Fix broken links to internalDocs
2dca9dc — Docs: VM & function returns
6e49ab4 — Update version references to v0.3
84aeb2e — Implement bytecode: opcodes, code objects, compilation + tests
c3b10ef — Add comprehensive tests for built-ins/collections
a9049c1 — Implement base object system and tests
06c926b — Mark Phase 2.5 completed
d3ef591 — Refactor parser/VM; precedence; postfix; statements; function defs
eaa9114 — Add Luau Runtime section to Copilot instructions
707248a — AST Starred/DictUnpack; literals with *args/**kwargs; call handling; tests
bc3385b — jelly.json updates; Packages in .gitignore
230f76b — Implement parser/token definitions; expression parsing tests
a3524e2 — Add CoC, Contributing, and internal docs; rewrite plan for v0.3
0cffc2e — AST system foundation + visitor tests
2d25732 — Start the 0.3 rewrite; move old code; new foundations
(Plus pre-rewrite cleanup/housekeeping earlier in history)
Thanks to everyone who contributed ideas, feedback, and code.
PyLua 0.2.1
Phase 2: Function Definitions and User-Defined Functions - COMPLETE
- Python function definitions with
defsyntax - Function parameters and return values
- Local scope management and variable isolation
- Function composition (functions calling other functions)
- Complete type system integration
- 100% test success rate for all function features
PyLua V0.2
Features
- Bytecode Compilation: Compile Python code once, execute multiple times
- Python Syntax: Almost full support for all Python variables, operators, control flow, and data structures
- Data Structures: Lists, dictionaries, tuples, sets with proper Python semantics
- Control Flow: if/elif/else, for loops, while loops with nested support
- Built-ins: print(), len(), type(), range(), int(), float(), str(), bool()
- Optimized VM: Stack-based virtual machine for efficient bytecode execution
Basic Usage
local python = require('path.to.PyLua0.2.python')
-- Simple one-line execution
python.execute('print("Hello, PyLua 0.2!")')Compile Once, Execute Multiple Times
For better performance when running the same code repeatedly:
local python = require('path.to.PyLua0.2.python')
-- Compile Python code to bytecode
local bytecode, error = python.compile([[
x = 10
y = 20
result = x + y
print("Result:", result)
]])
if error then
print("Compilation error:", error)
return
end
-- Execute the bytecode multiple times
for i = 1, 5 do
print("Execution", i)
local success, variables = python.runBytecode(bytecode)
if success then
print("Variables:", variables)
end
endPyLua V0.1
First release