A from-scratch C++26 GUI framework. Write a struct, get a UI.
The renderer runs on its own thread, so slow app code never freezes the window.
Warning
PRISM is an R&D project. Nothing here is production-ready yet.
#include <prism/prism.hpp>
using namespace prism; // the snippets below assume it: names read core::Field, ui::Slider, app::run
struct Counter {
core::Field<int> count{42};
core::Field<std::string> label{"Hello, PRISM!"};
};
int main() {
Counter counter;
return app::run(counter, {.title = "My App"}); // C++26 reflection builds the UI
}Try it without installing anything: the live demos run the real examples, compiled to WebAssembly.
Qt, GTK and wxWidgets run your code and the renderer on the same thread. If one callback is slow, nothing else happens. The window cannot repaint, cannot resize, and looks frozen.
PRISM puts the renderer on a separate thread. Your code still blocks its own thread, but the window stays alive.
This is an architectural choice, not a tuning trick. It is built in from day one.
The manual is on prism-gui.readthedocs.io. It starts with a tour and ends with a
reference for every widget and type, each with an example. Its pages are Markdown in
doc/.
| Start | Concepts | Widgets | The app |
|---|---|---|---|
| Why PRISM | The model | All widgets | Windows |
| Install | Views and layout | Controls | Themes |
| Your first app | Blocks | Tables, trees, lists | Settings |
| Examples | Threads | Text and code | Python |
examples/tour/ is the place to start: five programs of 20 to 40 lines, one idea
each. examples/ holds eight complete apps, from a widget gallery to a
synthesizer and a SQL tool; all of them run in the browser.
The same model runs elsewhere:
- Python: the SDK
builds a
prismextension frompython/: a class of fields is a window, and any thread may change a field. - Boards: embedded covers the ports that ship: the STM32H7B3I-DK and STM32F746G-DISCO, and the ESP32-S31-Korvo-1.
You need Meson ≥ 1.5 and a recent C++ compiler. All dependencies are fetched as Meson wraps.
meson setup builddir
ninja -C builddir
meson test -C builddir| Compiler | Reflection | What you write |
|---|---|---|
| GCC 16+ | yes, -freflection is auto-detected |
nothing: structs become UIs |
| GCC 14+, Clang 17+ | no | one view() method per model |
The browser build, the WebGPU renderer and the four entry points are in Install.
MIT
