Repository navigation
Releases
Releases · mirror-bridge/mirror_bridge
v0.3.0 — Machine-readable CLI, packaging, agent integrations, CI overhaul
Added
--jsonmachine-readable output forgenerate,diff, anddoctor: stdout carries exactly one JSON object (status, discovered classes, built outputs, and per-language errors with actionable suggestions); human-readable progress goes to stderrmirror_bridge doctorsubcommand integrating the diagnostic tool into the unified CLImirror_bridge diff --checkCI gate: exits non-zero when the binding surface drifted from the committed snapshot, without ever modifying it- CMake package support:
find_package(mirror_bridge)and FetchContent/add_subdirectoryconsumption via the exportedmirror_bridge::mirror_bridgetarget, which now carries the reflection compile flags; version compatibility file; header installs preserve directory structure; as a dependency, mirror_bridge no longer injects global compile flags into the parent project AGENTS.mdoperating manual for AI coding agents andllms.txt/llms-full.txtdocumentation bundles (generated bytools/gen_llms_txt.sh)- Error catalog (
docs/reference/errors.md): every known failure mode with exact symptom, cause, and fix - pip-installable
mirror-bridgepackage (packaging/pip/): wraps the Docker toolchain sopip install mirror-bridgegives a workingmirror_bridgeCLI anywhere, plusmirror_bridge shellfor an interactive container - MCP server (
pip install 'mirror-bridge[mcp]', runmirror-bridge-mcp): exposesgenerate_bindings,doctor, andcheck_binding_driftas native tool calls for AI agents - Claude Code integration (
integrations/claude-code/): drop-inbind-cppskill teaching the generate → fix → verify loop - Living benchmarks: a monthly CI workflow reruns the runtime suite and regenerates the table in
docs/internals/benchmarks.md - API stability contract (
docs/reference/stability.md): which surfaces are stable pre-1.0 and how versioning works - Smart pointer regression tests for Lua and JavaScript (members, params, returns, nil reset, abstract pointees)
Fixed
- Class-type smart pointers never compiled in the Lua and JavaScript backends (overload declaration order defeated two-phase lookup); they now work with the same deep-copy semantics as Python
boolreturned/accepted as a number in Lua and JavaScript; it now maps to native booleans in both directions- Methods taking
std::unique_ptr<T>by value failed to compile (parameter storage tried to copy a move-only type); smart pointer parameters now use value storage and are moved into the call - Test harness named modules after the source filename instead of the
MIRROR_BRIDGE_*MODULEdeclaration, producing unloadable modules whenever the two differed (the root cause of the long-red Tests workflow) generateno longer reports success when a stale.sofrom a previous run exists but the current compile failedgenerate --lang allnow attempts every language and reports all failures instead of aborting on the first one- Amalgamation stripped
#define MIRROR_BRIDGE_VALIDATE(T)from the single headers, leaving a dangling macro body that broke every single-header consumer - Rust FFI binding generation:
generate_bindings<T>()produces extern "C" wrappers, C headers, and safe Rust wrapper types with Drop, Send, Sync, and idiomatic getters/setters mirror_bridge watchcommand for live reload during development: watches headers for changes and auto-recompiles bindingsmirror_bridge diffcommand to show binding surface changes since last build, catching accidental ABI breaks- Bulk array transfer for numeric vectors:
vector<float>,vector<double>,vector<int>, etc. are now returned asarray.arrayobjects via single memcpy (~10-50x faster than element-by-element list construction) - String interning for member names in Python dict conversion via
PyUnicode_InternFromString - Exception handling for Lua (
luaL_error) and JavaScript (napi_throw_error) bindings: C++ exceptions are now caught and propagated as native errors in all three languages - Compile-time binding validation:
bind_class<T>now produces clearstatic_assertmessages when a class contains unconvertible member types, instead of cryptic template errors MIRROR_BRIDGE_VALIDATE(T)macro for explicit validation outsidebind_classstd::expected<T, E>type conversion for Python (ValueError on error), Lua (idiomatic value, err multi-return), and JavaScript (throw Error on error)- GitHub Codespaces support (
.devcontainer/devcontainer.json) for instant browser-based development std::optional<T>type conversion for Python, Lua, and JavaScript- Async/await support:
std::future<T>→ Python awaitable, JavaScript Promise - GitHub issue and PR templates for better contribution experience
- Feature matrix table in README showing per-language feature support
Changed
- Improved devcontainer configuration with proper C++2c reflection flags
v0.2.0 — Annotations, buffer protocol, stubs, diagnostics
Added
- P3394 annotation support for field-level binding control (
[[=exclude{}]],[[=readonly{}]]) - Zero-copy buffer protocol for NumPy integration (10M times faster for large data)
.pyistub generation for Python IDE autocomplete- Multi-language Mandelbrot demo showcasing Python, Lua, and JavaScript bindings
mirror_bridge_doctordiagnostic tool- Examples 06-10: callbacks, static/constexpr, free functions, enums, smart pointers
- Migration guide from pybind11
- Comprehensive architecture documentation
Changed
- Replaced method name mangling with pybind11-style overload dispatch
- Improved method parameter forwarding for move-only and reference types
Fixed
- GCC compatibility for P3394 annotations
- V8 SetNativeDataProperty API compatibility
- Fold expression empty pack handling
v0.1.0 — Initial release
Added
- Initial release with C++26 reflection-based binding generation
- Python bindings via Python C API
- Lua bindings via Lua C API
- JavaScript bindings via Node.js N-API
- Auto-discovery of classes for zero-boilerplate binding
- Container support:
std::vector,std::array - Smart pointer support:
std::unique_ptr,std::shared_ptr - Enum support with automatic integer conversion
- Nested object support with dict/table/object conversion
- Method overloading with automatic dispatch
- Static method and constexpr member binding
- Free function binding
- Precompiled header support for 3-6x faster builds
- CLI tools:
mirror_bridge,mirror_bridge_auto,mirror_bridge_pch_build - Docker environment with Bloomberg clang-p2996
- Comprehensive test suite for all languages
- Production-quality examples (image processing, n-body simulation)
Performance
- 3-5x faster runtime than pybind11
- Zero runtime overhead through compile-time binding generation
- Batch processing API for avoiding Python/C++ boundary overhead