December 4, 2025
Write once, bind thrice
Show HN: Mirror_bridge – C++ Reflection powered Python binding generation
C++ wizardry promises instant Python/JS/Lua—if you brave the Bloomberg fork
TLDR: Mirror Bridge auto‑generates ways to use C++ code from Python, JavaScript, and Lua, but it relies on a special Bloomberg compiler and isn’t production‑ready. The crowd’s split between excitement over no‑boilerplate bindings and skepticism about the fork and draft‑status feature—cool demo, cautious reality.
Mirror Bridge just barged into Show HN promising write C++ once, use it in Python, JavaScript, and Lua without glue code. It’s powered by a future C++ feature called “reflection” (think: the language describing itself so tools can auto‑wire your classes). The demo screams zero boilerplate and compile‑time magic—but the comment rowdies immediately clocked the twist: it’s experimental and only builds with Bloomberg’s custom clang compiler. Cue the groans and memes.
Top mood swing: “This is very cool” followed by “wait, it only works with Bloomberg’s fork?” The hype crew sees a friction‑free future where your C++ class pops into Python like a TikTok filter; the skeptics mutter “wake me when C++26 ships.” One user even asked if that 2026 spec is still draft—translation: don’t bet your company on this yet. Meta‑drama flared when someone dropped a duplicate thread link, sparking the classic HN chorus of “mods?” and “we’ve been here already” (link).
Meanwhile, the peanut gallery joked about “compiler DLC” and “compile‑time sorcery, production‑time reality,” while fans cheered auto‑discovered classes, smart pointer handling, and instant exceptions translating to Python. The vibe: future wow, present whoa—a flashy teaser for a world where binding code is extinct, but today it’s still behind a VIP rope.
Key Points
- •Mirror Bridge is an experimental header-only C++ library that uses C++26 reflection (P2996) to auto-generate bindings for Python, JavaScript (Node.js), and Lua.
- •The project currently only works with Bloomberg’s clang-p2996 fork and is not recommended for production until P2996 is standardized.
- •Bindings are generated at compile time with zero boilerplate, covering data members, methods, constructors, method overloading, smart pointers, nested classes, containers, exceptions, enums, __repr__, and inheritance.
- •Supported language integrations use Python C API, Node.js N-API, and Lua C API, with example usage demonstrated across languages.
- •Two workflows are provided: auto-discovery via single commands scanning a source directory, and a config-file-based approach for explicit, version-control-friendly binding generation.