Rosetta is a non-intrusive C++ header-only introspection library that is used to automatically generates consistent bindings for Python, JavaScript, Lua, Ruby, Julia and more β without modifying your C++ code.
Describe your introspection once, and export them everywhere. You do not need to know anything about the underlaying libs that are used for the bindings (NAPI, Pybind11, Rice...)
-
CGAL-rosetta based on the CGAL library, for 3D surfaces intersections and remeshing
-
PMP-rosetta based on the PMP library, for decimation, remeshing, subdivision or smoothing
-
Arch-rosetta based on the Arch library, the successor of Poly3D from Stanford and iBem3D from slb, a 3D Boundary Element Method in geomechanics
- C++ Introspection
- Generator for
scripting languages- Python
- JavScript
- WebAssembly
- TypeScript
- Rest API
- ...
- Property editor (GUI)
- Qt
- ImGui
- Serialization
- Undo/redo framework
- Documentation generation in
Markdown - Validation on
fieldorproperty(range...)
- Zero-intrusion β No inheritance, no macros inside your classes, no wrapper
- Simple to use
- One API -> Multi-language output β Python (pybind11), JavaScript (N-API), Lua, WASM...
- Supports:
- Multiple constructors
- Inheritance & polymorphism β Virtual methods, multiple inheritance
- Const correctness β Differentiates const/non-const methods
- Method Complete Overload Access
- Synthetic Methods - methods to classes that don't exist in the original C++ class definition.
- Functors
- Fields - Member variables
- Virtual fields (
property) - FromsetDummy/getDummymethods, create the virtual fielddummy - Static methods
- Free functions
- STL Containers β
vector,map,set,array, etc... of any type - Smart pointers β
shared_ptr,unique_ptr, raw pointers
- Validation system β Runtime constraints and checks
- Serialization
- Documentation generation β Markdown / HTML export
- Qt Integration β QML bridge for dynamic property editing, automatic property editor widgets
- Undo/Redo extension - Generic undo/redo manager for tracking and reverting property/field changes
| Feature | Rosetta | Qt MOC | RTTR | Boost.Describe |
|---|---|---|---|---|
| Non-intrusive | β | β | β | β |
| No macros in class | β | β | β | β |
| Header-only | β | β | β | β |
| Static methods | β | β | β | |
| Virtual methods | β | β | β | β |
| Free functions | β | β | β | β |
| Python bindings | β | β | β | |
| JavaScript bindings | β | β | β | β |
| WebAssembly bindings | β | β | β | β |
| REST API generation | β | β | β | β |
| Serialization | β | β | β | |
| Qt integration | β | β | β |
| Symbol | Meaning | Description |
|---|---|---|
| β | Fully Supported | Feature is implemented, stable, and works as expected |
| Partial Support | Feature exists but has limitations, requires workarounds, or is incomplete | |
| β | Not Supported | Feature is not available or not applicable |
| π§ | In Progress | Feature is being developed or planned |
class Vector3D {...};
class SceneManager {...};
...along with a static or dynamic library or nothing (if headers only).
This description provide the introspection of your classes that will be used by the generators (see below).
#include <rosetta/rosetta.h>
#include <yourlib/all.h>
void rosetta_registration() {
ROSETTA_REGISTER_CLASS(Vector3D)
.field("z", &Vector3D::z)
.method("length", &Vector3D::length)
.method("normalize", &Vector3D::normalize);
ROSETTA_REGISTER_CLASS(SceneManager)
.method("add", &SceneManager::add)
...;
}Since the introspection of your C++ classes (and free functions) is now created by Rosetta, binding is straightforward as long as the generator for a given language is available. To generate a rosetta skeleton for your project, use this tool, a project scaffolding tool for creating Rosetta binding projects.
Read this tuto and have a look at this example for how to use the generators in combination with Rosetta.
Also, for more complex examples, see (1) this project, (2) this one or (3) this one.
Rosetta provides seamless Qt6 integration with two complementary components:
The QmlBridge class exposes Rosetta-registered objects to QML, enabling dynamic property editing without compile-time type knowledge:
QmlBridge {
id: bridge
}
// Bind any Rosetta-registered object
bridge.setObject("MyClass", myObject)
// Dynamically access fields and methods
var value = bridge.getField("position")
bridge.setField("scale", 2.0)
bridge.invokeMethod("reset", [])Generate Qt widgets automatically from your Rosetta-registered classes:
#include <rosetta/extensions/qt/qt_property_editor.h>
#include <rosetta/rosetta.h>
class Person {...};
static auto reg = []() {
rosetta::core::Registry::instance()...
}();
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
Person person;
auto *inspector = new rosetta::qt::ObjectInspector<Person>(&person);
inspector->setWindowTitle("Person Inspector");
inspector->resize(300, 400);
inspector->show();
return app.exec();
}The property editor supports:
- Automatic widget generation β Spinboxes for numbers, checkboxes for bools, line edits for strings
- Custom widget registration β Sliders, color pickers, file selectors, combo boxes
- Grouped properties β Organize fields into collapsible sections
- Multi-object editing β Edit multiple objects simultaneously
- Method invocation β Button panels for calling registered methods
- Undo/redo support β Track property changes for reversible editing
Rosetta provides seamless ImGui integration with its PropertyEditor for fields and methods
You're very welcome to create a generator based on Rosetta introspection for other scripting languages β such as Lua, Julia, or Ruby!
Also, any extension is welcome ;-)
π Check out this folder to see the existing Python, JavaScript, Wasm and REST API generators for inspiration.
Every new generator or extension helps expand the ecosystem β contributions are always greatly appreciated β€οΈ
LGPL 3 License β see LICENSE



