Vision · Applications · How it works · Quick start · Architecture · Lisp (Clojure) · Documentation

In the demo, an image editor's assistant is asked for a 3D modeller's and a presentation app's features, a new app is made from a name and a description, a home app gets a small change, and the Launcher shows them all.

AffrescoUI is a native UI engine for applications that keep changing while they run. An app is a program in AffrescoUI Lisp , a sandboxed dialect of Clojure , made of named definitions for its window, views, state, behaviour, commands, keys, settings and text. The engine builds them into one document and draws it with C++ and OpenGL, with no browser engine or web view. If you write Clojure, you can already read and write these apps. Lisp is the standard, but the document can also be written directly in JSON, and all the examples but one ship both.

People and AI agents can change a running app. Each change is checked against the app's permissions and previewed when it needs approval. It then applies in place within milliseconds, with no rebuild or restart, and you keep your place.

Most software is fixed when it ships, and every change waits for the next release. AffrescoUI apps keep evolving, shaped by the people who use them.

Every app, from a to-do list to a professional design tool, is written in one format and drawn by one engine, so a feature built for one app can move into another. You don't need to program to build one. Describe what you want and an AI agent builds it with you, step by step, until a simple board is a full workbench.

You can reshape the apps you use, too. Ask in plain words ( "add a Blocked column" , "dim the lights at sunset" , "warn me when a streak breaks" ) or point at the part you mean, and you see the result live before you decide. You keep it or undo it, even after later edits, and an agent's change waits for your approval unless you've allowed that kind of change. Prototypes are tried the same way, in the running app with your work in place, so when one is right, it's already the app.

A run of reviewed changes exports as a change set , a portable file that works like a plugin for anyone with the same app. Whole features can move between apps too: the planetarium below uses the presentation editor's slide sorter. A version of an app can be shared as one file as well, and every install is reviewed before it lands. The aim is apps as complex as the professional tools people use every day, built and changed the same way.

Thirteen example apps live in examples/ . They aren't part of the library and have no native code of their own: file access, the terminal and all the drawing come from the library. Each is a Lisp program ( examples/ /lisp/ ) with the same app in JSON beside it ( examples/ /json/ ), and you choose which one opens in the Launcher's Settings. In Lisp, their text is in English, Spanish and French (Sign in: English, Italian and right-to-left Arabic). Calamaio, the text editor you can reprogram from inside , is Lisp only.

Every app has the AI assistant in its bottom-right corner. Ask it for a change in plain words, or Point at the part to change first, then review the proposal.

The Launcher is an AffrescoUI app too. It opens every example and your own apps, makes new ones (blank, from an example or from a description), lists a catalogue of apps and features to install after review, and sets the AI that every app's assistant uses.

Open them from the Launcher ( ./build/affrescoui_launcher ), or run one directly with ./build/affrescoui_launcher examples/ /lisp/index.screen.lisp .

%%{init: {"theme": "base", "flowchart": {"curve": "basis", "nodeSpacing": 28, "rankSpacing": 46, "padding": 14}, "themeVariables": {"fontFamily": "Helvetica, Arial, sans-serif", "fontSize": "14px", "lineColor": "#94A3B8", "primaryTextColor": "#0F172A", "edgeLabelBackground": "#FFFFFF"}}}%% flowchart LR subgraph P["Who changes it"] direction TB you[" You the app's assistant"] ai[" AI agent Claude Code · MCP"] any[" Scripts & apps any socket client"] end subgraph V["Version control"] direction TB rules{" Permission rules deny · ask · allow"} pr[" Proposal branch · live preview"] no[" Rejected nothing changes"] end subgraph E["Engine"] direction TB main[(" main SHA-256 commits")] rt[" Runtime reconcile in place"] gl[" Renderer C++23 · OpenGL"] end app([" Your running app never restarts"]) you & ai & any -- "revision" --> rules rules -- "allow" --> main rules -- "ask" --> pr rules -- "deny" --> no pr -- "you accept" --> main main --> rt --> gl --> app classDef peer fill:#FFFFFF,stroke:#CBD5E1,stroke-width:1px,color:#0F172A classDef gate fill:#FFFBEB,stroke:#D97706,stroke-width:1.5px,color:#78350F classDef wait fill:#FFFFFF,stroke:#D97706,stroke-width:1px,stroke-dasharray:4 3,color:#78350F classDef stop fill:#FFFFFF,stroke:#E11D48,stroke-width:1px,color:#9F1239 classDef core fill:#EEF2FF,stroke:#6366F1,stroke-width:1.5px,color:#1E1B4B classDef out fill:#0F172A,stroke:#0F172A,color:#FFFFFF class you,ai,any peer class rules gate class pr wait class no stop class main,rt,gl core class app out style P fill:#F8FAFC,stroke:#E2E8F0,color:#64748B style V fill:#F8FAFC,stroke:#E2E8F0,color:#64748B style E fill:#F8FAFC,stroke:#E2E8F0,color:#64748B linkStyle 0,1,2 stroke:#94A3B8 linkStyle 3 stroke:#16A34A,stroke-width:2px linkStyle 4 stroke:#D97706,stroke-width:1.5px linkStyle 5 stroke:#E11D48,stroke-width:1.5px linkStyle 6 stroke:#16A34A,stroke-width:2px linkStyle 7,8,9 stroke:#6366F1,stroke-width:2px Loading Anyone can propose a change. The host ( affrescoui_launcher ) draws the app and listens for peers on local sockets, and peers on other machines connect through the document server. You ask the app's assistant, pointing at a part if you like, and the AI you chose answers. An agent such as Claude Code can connect through the MCP server instead, which works both ways: it gets your request with what you pointed at, and its revisions and replies come back. Scripts connect too. Each change is a revision of compact edits, and its author is set by the connection, never by what a peer claims. Permission rules decide. deny refuses a change, ask sends it for review and allow applies it. Rules judge what a change does , not how it's written, and budgets cap how much a peer can change. Flow's rules, for example, let your own client change anything, ask before an agent changes behaviour, and protect the status bar from everyone. You review proposals.

You need CMake 3.25 or later and a C++23 compiler. CMake fetches the pinned dependencies ( cmake/dependencies.json ).

cmake -S . -B build && cmake --build build ./build/affrescoui_launcher # every app, your own apps and the AI settings Note

The v2.0.0 downloads aren't code-signed yet, so the first time you open one, macOS and Windows warn that they can't verify the developer. Signed builds will come in a later release. Building from source avoids the warning and gives you a build optimised for your machine.

In the Launcher's Settings , pick the AI that every app's assistant uses: Claude Code or GitHub Copilot with your own sign-in, or a local model through Ollama, LM Studio or llama.cpp (a key, if one is needed, stays in the system's keychain). The assistants need nothing else. To connect an AI agent through MCP instead ( mcp/README.md ):

claude mcp add affrescoui -- python3 /path/to/AffrescoUI/mcp/affrescoui_mcp.py claude --dangerously-load-development-channels server:affrescoui # requests are pushed into the session Either way, open Flow and ask its assistant to "add a Blocked column between In progress and In review" . The change comes back as a proposal: Accept it and the board updates in place, or choose Always allow to stop being asked about that part of the screen.

./build/affrescoui_launcher examples/haven/lisp/index.screen.lisp # any app, no C++ ./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --mode acceptEdits # agent changes apply unless a rule asks ./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --plugin my.json # start with a change set applied CI builds and tests it on Linux and Windows and builds it on macOS, where it's developed; web/ builds it for the browser. ctest --test-dir build runs the unit tests, every app's scenarios and the rendering check, which compares each frame with a golden image, pixel for pixel ( tests/render/README.md ).

AffrescoUI draws what it's told to. An app is a folder of documents (plus any native code that a program embedding the library registers), and the engine knows nothing else about it. There are three layers, each built only on the one below. Apps are folders of screen documents, data and assets, with nothing compiled for them. Themes ( modules/themes ) hold the kits of components (toolbars, menus, docks, dialogs) and each theme's design tokens, as JSON built into the library. The engine , every other module, holds only mechanisms. When a document uses a component or token it doesn't define, the engine looks it up in the installed kits and themes, without knowing any of them by name, and a document's own components win over the kits'.

On its way in, a change passes through these modules, each with one job:

%%{init: {"theme": "base", "flowchart": {"nodeSpacing": 30, "rankSpacing": 34, "padding": 14, "wrappingWidth": 400}, "themeVariables": {"fontFamily": "Helvetica, Arial, sans-serif", "fontSize": "14px", "lineColor": "#94A3B8", "primaryTextColor": "#0F172A", "edgeLabelBackground": "#FFFFFF"}}}%% flowchart TB studio([" You · the app's assistant or a script"]) agent([" AI agent · Claude Code"]) mcp[" MCP server · mcp/ connects AI agents, both ways"] channel[" Channel · modules/channel, modules/net local sockets · processes · WebSocket · one session per peer"] vcs[" Version control · modules/vcs allow / ask / deny · proposals · commits · history"] format[" Screen format · modules/format checks the document · evaluates it · reconciles in place"] lisp[" Lisp language · modules/lisp builds a program's tree · runs its functions"] render[" Renderer · modules/render layout · shaped text · input · accessibility · OpenGL"] themes[" Kits and themes · modules/themes components · design tokens · JSON"] agent --> mcp mcp --> channel studio --> channel channel -- "revision" --> vcs vcs -- "accepted commit" --> format format -- "panels" --> render themes -. "components, tokens" .-> format lisp -. "programs" .-> format classDef peer fill:#FFFFFF,stroke:#CBD5E1,color:#0F172A classDef c_mcp fill:#F3E8FF,stroke:#9333EA,stroke-width:1.5px,color:#3B0764 classDef c_channel fill:#E0F2FE,stroke:#0284C7,stroke-width:1.5px,color:#0C4A6E classDef c_vcs fill:#FEF3C7,stroke:#D97706,stroke-width:1.5px,color:#78350F classDef c_format fill:#D1FAE5,stroke:#059669,stroke-width:1.5px,color:#064E3B classDef c_render fill:#EDE9FE,stroke:#7C3AED,stroke-width:1.5px,color:#4C1D95 class studio,agent peer class mcp c_mcp class channel c_channel class vcs c_vcs class format c_format class themes c_format class lisp c_format class render c_render Loading Native. A from-scratch C++23 engine on OpenGL 4.1 core or ES 3.0 (WebGL2 in the browser). A change updates only what reads it and redraws only what changed, text is sharp at every display scale, an idle window sleeps, and a full frame takes 0.40 ms ( BENCHMARKS.md ). One document. A program builds a screen document ( SCREEN_FORMAT.md , with a JSON Schema ) of layout, components, themes, state, bindings, events, timers, services and permissions. Behaviour that usually needs code (wiring a button to a list, validating a form, filtering, drag and drop, shortcuts, navigation, calls to services) is declared, so an agent changes it as safely as a colour. Compact for agents. Edits address nodes by id ( {"set": {"#title/text": "Q4"}} , stored as JSON Patch) and apply atomically, in place, and re-reads return only what changed. A typical edit is 28 tokens and a re-read after one commit 27 ( BENCHMARKS.md ). When you point at a part, the agent reads only the definition that built it. Swappable modules.

AffrescoUI Lisp is a sandboxed dialect of Clojure with its own runtime, built into the library. Its forms, functions and reader forms are Clojure's: of 186 everyday Clojure forms, 163 return the same value as in Clojure, and the other 23 are left out or differ on purpose ( everyday.lisp , checked on every test run). It's also measured against Clojure's cross-dialect test suite ( CONFORMANCE.md ), every difference is written down with what to write instead ( differences.md ), and clj-kondo lints the programs with its configuration .

A program is a folder of small, named definitions, and every example follows the idiomatic style in style.md . Building the program produces the document the engine draws, and the program's functions run when a button is pressed, a key is typed or a bound value changes. From Flow's own code ( examples/flow/lisp/flow.lisp ):

( ns flow.flow ) ( defn cards-of " A column's cards, in their order. " [c] ( :cards ( column c))) ( defn next-order " The order that puts a card at the end of a column. " [c] ( ->> ( cards-of c) ( map :order ) ( reduce max -1 ) inc)) ( defn column-of " The column that holds a card, or -1. " [ref] ( or ( first ( keep-indexed ( fn [c col] ( when ( some #( = ( :ref %) ref) ( :cards col)) c)) computed.columns)) -1 )) You define In AffrescoUI Lisp The window, as an outline of its parts defscreen main Its parts, small and named defview , defcomponent Its data defstate , defcomputed Its looks deftokens , defstyle , defmenu What it does defn , defcommand Shortcuts and settings defkey , defcustom Extension points defhook , add-hook , advice Its text, in every language (t "key") and locales/ .lisp Its files (ns board.index (:require "toolbar.lisp" ...)) Every definition and rule is in LISP.md , and the language itself in modules/lisp , RFC 0005 and RFC 0006 .

The document a program builds can also be written directly in JSON, which suits data and tools. An example's two versions are one app: their first frames match pixel for pixel, they pass the same scenarios, and they share one history, the same diffs and the same permissions. In tests of the same changes made both ways, an AI agent edited Lisp as accurately as JSON, at about the same cost ( BENCHMARKS.md ).

(defview card-view " One card, in bold when it is a bug. " [card] ` (label#card :text ~card.title :bold ~( = card.tag " bug " ))) (defscreen main :window { :title " Board " } (column#cards ~(repeat [card state.cards] (card-view card)))) { "type" : " column " , "id" : " cards " , "children" : [ { "type" : " label " , "id" : " card " , "repeat" : { "for" : " card " , "in" : " state.cards " }, "text" : " {{card.title}} " , "bold" : " {{(card.tag == 'bug')}} " } ] } Changed from inside, while it runs A running app can be reprogrammed from inside. In Calamaio , the text editor among the examples, open the scratch buffer ( C-x b *scratch* RET ), type a new definition of a command and evaluate it with C-M-x :

(defcommand kill-line " Says so. " :title " Kill Line " :category " Killing " [] (message " redefined " )) The next C-k runs the new definition, and C-x C-z takes it back. apropos , describe-key and the other describe-* functions inspect the running program.

Your own editor can do the same in any Lisp app: start it with --nrepl and connect any nREPL client. The window asks once whether that editor may evaluate as you. After that, every definition you evaluate lands as your own revision, in the file your buffer is in ( LISP.md ). Only that definition is rebuilt, and the app updates where it's read.

./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --nrepl Still under version control Each evaluation is a revision of one definition: it's kept in history, its diff names the view or function that changed, and it can be undone like any other change. An agent's code arrives as a proposal, rebuilt from its source and judged by the tree it builds. Once accepted, it still runs with the agent's authority, never yours. Your authority covers only what you typed. Text pasted in or written by someone else runs with less, unless you read it in a question the host draws, which no document or agent can draw or answer, and say yes. The language can't reach files, processes or the network. Its only ways out are the steps a host grants, each checked against who wrote the code that's running. An agent's hooks and advice run sealed, so they can't stop your commands from working. Use it in your app AffrescoUI is also a C++ library to embed. A host program loads a screen, adds any native code it needs, and can let other programs change the screen live:

# include int main () { affresco::Application app; affresco::Screen screen = affresco::Screen::fromFile ( " app.screen.json " ); screen. createWindow (app); screen. onAction ( " save " , [&](affresco::Panel&) { /* native code, if needed */ }); screen. listen (app, " /tmp/my-app/agent.sock " , " agent " ); // optional: let other programs change it live return app. run (); } find_package ( AffrescoUI REQUIRED ) # or add_subdirectory(AffrescoUI) / FetchContent target_link_libraries ( my_app PRIVATE affrescoui::affrescoui ) From C or another language, the C API ( affresco/affresco.h ) loads, drives and embeds a screen, and bindings/python wraps it for Python.

AffrescoUI started in December 2017 as sGLGUI , when I was 16 and teaching myself OpenGL and C++. I wrote nested panels, pixel and percent sizing, anchors and a signal/slot event system from scratch. In 2018 I added a text area that collected keystrokes but could never draw them, and the project stalled. A restart in 2020 rewrote the layout engine (that demo is on the right), then stalled too.

In 2026 I picked it up again with Claude Code. The first goal was a library you could actually use, so we ported it to OpenGL 4.1 core, rewrote it in C++23 and finally drew text. Then I started wondering: what if an AI agent could change a native app while it runs , and you approved every change? That took the project far past the original plan, to UIs described as documents, live revisions, version control and a two-way MCP bridge for agents.

How it was built. All of the 2026 code was written by Claude Code, through agent-driven development. My part was the direction and the architecture. I shaped it over many iterations, trying an idea, seeing what it did and changing course until it worked the way I wanted. The git history shows every step.

timeline 2017 : Started at 16 : nested panels, anchors, signal → slot events 2018 : A text area that can't draw text : the project stalls 2020 : Restarted : new layout engine, stalled again 2026 : Revived with Claude Code : C++23 · OpenGL 4.1 core · real text : live screens in Lisp and JSON · version control · MCP Loading License Apache License 2.0: free to use, modify and distribute, commercially or not. Anyone who distributes it must pass on the NOTICE file, which credits the author. See LICENSE and THIRD_PARTY_NOTICES.md .

If AffrescoUI interests you, a ⭐ helps other people find it.