{"slug": "why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run", "title": "Why stop at Emacs? Native apps you or an AI reprogram in Clojure while they run", "summary": "AffrescoUI v1.0.0 has been released as a native UI engine whose applications are defined in AffrescoUI Lisp, a sandboxed dialect of Clojure, with JSON also supported for the same document format. The engine builds an application's window, views, state, behaviour, commands, keys, settings and text into one document, draws it in C++ and OpenGL, and applies AI-agent-proposed revisions in place in milliseconds without a rebuild or restart, subject to each app's permissions and user approval. The v1.0.0 downloads are not yet code-signed, so macOS and Windows show developer-verification warnings; the project recommends building from source with CMake 3.25+ and a C++23 compiler.", "body_md": "### Any application, defined in one format and rendered natively.\n\nIts users reshape it live, just by asking an AI.\n\n**[Vision](#the-vision)** · **[Applications](#applications)** · **[Architecture](#architecture)** ·\n**[Lisp (Clojure)](#written-in-lisp-a-clojure-dialect)** ·\n**[How it works](#how-it-works)** · **[Quick start](#quick-start)** · [Documentation](#documentation)\n\n## affrescoui-demo-final-web.mp4\n\n<sub>The demo: an image editor given a 3D modeller's and a presentation app's features by asking its assistant, a new\napp made from a name and a description, a small change to a home app, and the Launcher with its apps.</sub>\n\nWarning\n\n**The v1.0.0 downloads are not code-signed yet**, so macOS and Windows warn that they can't verify the developer when you first open them. Signed builds will come in the next releases.\n\n**Best today: build from source.** It's one command, gives an optimised build for your machine, and never shows that warning (you need CMake 3.25+ and a C++23 compiler):\n\n```\ncmake -S . -B build && cmake --build build && ./build/affrescoui_launcher\n```\n\nAffrescoUI is a native UI engine whose applications are **defined in Lisp**. [AffrescoUI Lisp](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LISP.md), a sandboxed\ndialect of **Clojure**, is the standard: an application's window, views, state, behaviour, commands, keys, settings and\ntext are all named Lisp definitions, which the engine builds into one document, draws in C++ and OpenGL, and keeps\nrunning. If you write Clojure, you can already read and write these apps. **JSON is supported too:** the same document\ncan be written directly in JSON, and every example ships both. People and AI agents change an application while it runs:\neach change is checked against the app's permissions, previewed if it needs approval, and applied in place in\nmilliseconds, with no rebuild, no restart and nothing lost.\n\nSoftware is frozen at build time: it does what its makers shipped, and every change waits for the next release. AffrescoUI applications keep evolving while they are used, shaped by the people who use them.\n\n- **One format for every application.** A to-do list and a professional design tool are written the same way and\nrendered by the same native engine. A feature built for one application can move into another.\n- **Complex applications, built by anyone.** No programming needed: describe what you want, and an AI agent builds it\nwith you, step by step, from a simple board to a full workbench.\n- **The people who use an app can change it.** Ask the app itself, in plain words:*\"add a Blocked column\"* ,*\"dim\nthe lights at sunset\"* ,*\"warn me when a streak breaks\"* , or point at the part to change and ask. You see the change\nlive, then keep it or undo it, even after later changes. Nothing changes without your approval.\n- **Prototyping without stopping.** Every idea is tried in the running application: no rebuilding, no restarting, no\nreloading, and your work stays where it was. When the prototype is right, it is already the app.\n\nAn application starts from a document, then **grows by being talked to**: *\"add a filter to this list\"*, *\"make the\nsidebar collapsible\"*, *\"show the total in red when it's negative\"*. Each request becomes a reviewed revision. A run\nof revisions becomes a **change set**, a portable file that works like a **plugin**, and whole features move between\napplications: the planetarium below reuses the presentation editor's slide sorter. A person's own version of an app\nis shared as one file too, and every install is a proposal they review before it lands.\n\n```\nflowchart LR\n    app[\"📦 An application<br/>one live document\"]\n    ask[\"💬 You ask<br/>'add a filter to this list'\"]\n    propose[\"🤖 An agent proposes<br/>a revision\"]\n    approve[\"✅ You preview,<br/>accept or reject\"]\n    plugin[(\"🧩 Change set<br/>or feature\")]\n    catalogue[(\"🌍 Shared<br/>others can install\")]\n    app --> ask --> propose --> approve --> plugin --> catalogue\n    catalogue -. \"install\" .-> app\n\n    classDef step fill:#EEF2FF,stroke:#6366F1,color:#312E81\n    classDef win fill:#10B981,stroke:#047857,color:#fff\n    class app,ask,propose,approve step\n    class plugin,catalogue win\n```\n\nThe direction: applications as complex as the professional tools people use every day, in one format, rendered natively, and shaped by the people who use them while they run.\n\nThirteen applications, from everyday apps to professional tools, all in the same format. They are examples\n([`examples/`](https://github.com/RiccardoSottini/AffrescoUI/blob/master/examples/README.md)), not part of the library, and each carries the AI **assistant** in its bottom right\ncorner: ask for a change in plain words, or **Point** at the part to change first, then review the proposal it\nbecomes. Each is a Lisp program (`examples/<app>/lisp/`) in the dialect's idiomatic style, small named views and\nfunctions with their text in English, Spanish and French, and keeps the same app as a JSON document beside it\n(`examples/<app>/json/`): choose which opens in the Launcher's Settings. Calamaio, the text editor reprogrammed\n[from inside](#changed-from-inside-while-it-runs), is Lisp only.\n\n<sub>The AffrescoUI Launcher, itself one live document: every application one click away, your own apps, a new app\nmade blank, from an example or from a description, a catalogue of apps and features to install after review, and the\nAI provider every app's assistant uses.</sub>\n\n| **Forge** · an IDE<sub>Explorer, editor tabs and split editors, find and replace, quick open and a command palette, problems, output and a terminal, source control, a debugger and language servers, in dark, light and high-contrast themes. `examples/forge/lisp/index.screen.lisp`, with `--folder DIR` to open a folder</sub> | **Tempera** · an image editor<sub>Tools with flyouts and a context options bar, layers with masks, groups and adjustment layers, brushes, selections, history and a navigator, on a tiled image engine. Agents may only propose: every change is reviewed. `examples/tempera/lisp/index.screen.lisp`</sub> | \n| **Sinopia** · a presentation editor<sub>A ribbon with tabs and galleries, slide thumbnails in sections, a canvas with shapes, zoom and fit, speaker notes and undo. Its slide sorter is a part that other applications install. `examples/sinopia/lisp/index.screen.lisp`</sub> | **Modello** · a 3D modeller<sub>A lit 3D viewport with gizmos, an outliner, a properties editor, a timeline, search over every command and glTF import. Every scene edit is a revision, reviewed and undoable. No C++ of its own. `examples/modello/lisp/index.screen.lisp`</sub> | \n| **Quaderno** · a code editor<sub>Open files and folders, tabs, a minimap, a quick switcher over files, symbols and lines, Find in Files, a command palette and a console. `examples/code-editor/lisp/index.screen.lisp`</sub> | **Orrery** · a planetarium<sub>A 3D solar system, the sky from the ground, an orbit graph and a timeline of eclipses. Its bodies strip is Sinopia's slide sorter, installed from that app. Built by an outsider from the public docs. `examples/orrery/lisp/index.screen.lisp`</sub> | \n\n| **Haven** · a smart-home dashboard<sub>Rooms by floor, a floor plan, scenes, lights, climate, blinds and media, automations as a node graph with schedules, energy charts, security and notifications, on simulated devices. `examples/haven/lisp/index.screen.lisp`</sub> | **Tempo** · a music player<sub>Playlists, a 3,000-song library, albums and artists, a queue to reorder, now playing with a visualiser and lyrics, an equaliser and a mini player. Playback is simulated. `examples/tempo/lisp/index.screen.lisp`</sub> | \n| **Streak** · a habit tracker<sub>Daily habits with goals and schedules, scores, charts, a calendar, notes and reminders, all kept on disk, written as a Lisp program. `examples/streak/lisp/index.screen.lisp`</sub> | **Arcadia** · a game launcher<sub>A library and a store with carousels, game pages, downloads, a wishlist and a cart. Built by an outsider from the public docs. `examples/arcadia/lisp/index.screen.lisp`</sub> | \n| **Flow** · a Kanban board<sub>Boards with swimlanes, a table and a timeline of every card, a card drawer, a burndown, drag and drop with a keyboard alternative, undo and a command palette. `examples/flow/lisp/index.screen.lisp`</sub> | **Sign in** · accounts<sub>Sign in and sign up, two-step codes, a password reset, a sample external provider, an account page and session expiry, all validated in the document. `examples/sign-in/lisp/index.screen.lisp`</sub> | \n\nOpen them from the **Launcher** (`./build/affrescoui_launcher`), or run one with `./build/affrescoui_launcher <file>`.\nNone has native code of its own: files, the terminal and pixels are the library's. In Lisp, every app speaks\nEnglish, Spanish and French (Sign in: English, Italian and Arabic, right to left).\n\nAffrescoUI renders what it is told to: an application is a folder of documents (and, in a program that embeds the library, any native code it registers), and the engine knows nothing else about it. It is built in three layers, each made only of the one below:\n\n- **Apps** : folders of files (screen documents, data, assets) that the Launcher opens, with nothing compiled for them.\n- **Themes** (`modules/themes` ): the kits' components (toolbars, menus, docks, dialogs) and the themes' design\ntokens, as JSON files built into the library.\n- **Engine** (every other module): mechanisms only. It looks a component or token a document doesn't define up in the\ninstalled kits and themes, and knows none of them by name; a document's own components win over the kits'.\n\nA change travels down a stack of layers, each with one job.\n\n```\n%%{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\"}}}%%\nflowchart TB\n    studio([\"<b>You</b> · the app's assistant or a script\"])\n    agent([\"<b>AI agent</b> · Claude Code\"])\n\n    mcp[\"🤖 <b>MCP server</b> · mcp/<br/>connects AI agents, both ways\"]\n    channel[\"🔌 <b>Channel</b> · modules/channel, modules/net<br/>local sockets · processes · WebSocket · one session per peer\"]\n    vcs[\"🛡️ <b>Version control</b> · modules/vcs<br/>allow / ask / deny · proposals · commits · history\"]\n    format[\"📄 <b>Screen format</b> · modules/format<br/>checks the document · evaluates it · reconciles in place\"]\n    lisp[\"λ <b>Lisp language</b> · modules/lisp<br/>builds a program's tree · runs its functions\"]\n    render[\"🎨 <b>Renderer</b> · modules/render<br/>layout · shaped text · input · accessibility · OpenGL\"]\n    themes[\"🧩 <b>Kits and themes</b> · modules/themes<br/>components · design tokens · JSON\"]\n\n    agent --> mcp\n    mcp --> channel\n    studio --> channel\n    channel -- \"revision\" --> vcs\n    vcs -- \"accepted commit\" --> format\n    format -- \"panels\" --> render\n    themes -. \"components, tokens\" .-> format\n    lisp -. \"programs\" .-> format\n\n    classDef peer fill:#FFFFFF,stroke:#CBD5E1,color:#0F172A\n    classDef c_mcp fill:#F3E8FF,stroke:#9333EA,stroke-width:1.5px,color:#3B0764\n    classDef c_channel fill:#E0F2FE,stroke:#0284C7,stroke-width:1.5px,color:#0C4A6E\n    classDef c_vcs fill:#FEF3C7,stroke:#D97706,stroke-width:1.5px,color:#78350F\n    classDef c_format fill:#D1FAE5,stroke:#059669,stroke-width:1.5px,color:#064E3B\n    classDef c_render fill:#EDE9FE,stroke:#7C3AED,stroke-width:1.5px,color:#4C1D95\n    class studio,agent peer\n    class mcp c_mcp\n    class channel c_channel\n    class vcs c_vcs\n    class format c_format\n    class themes c_format\n    class lisp c_format\n    class render c_render\n```\n\n- **Written in Lisp.** An app is a program in AffrescoUI Lisp ([LISP.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LISP.md) ,[`modules/lisp`](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/README.md) ): named definitions (`defscreen` ,`defview` ,`defstate` ,`defn` ,`defcommand` ,`defkey` ,`defcustom` ,`add-hook` ,`advice` ), run by the library's own interpreter.\nEach definition is versioned on its own, so a diff names the view or function that changed, and a proposal is rebuilt\nand judged by the tree it builds. The language can't reach files, processes or the network. Its only ways out are\nthe steps a host grants, each checked against who wrote the code that is running.\n- **One document, drawn natively.** What a program builds is a screen document ([SCREEN_FORMAT.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/SCREEN_FORMAT.md) ,\nwith a[JSON Schema](https://github.com/RiccardoSottini/AffrescoUI/blob/master/schema/affrescoui-screen.schema.json) ): layout, components, themes, state, bindings, events,\ntimers, services and permissions. It can also be written directly in JSON, for data and tools. Behaviour that usually\nneeds code (wiring a button to a list, validating a form, filtering, drag and drop, shortcuts, navigation, calls to\nservices) is declared, so an agent changes it as safely as a colour.\n- **Compact for agents.** Edits address nodes by id (`{\"set\": {\"#title/text\": \"Q4\"}}` , stored as JSON Patch) and\nre-reads return only what changed: a typical edit is 28 tokens, a re-read after one commit 27\n([BENCHMARKS.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/BENCHMARKS.md) ). When the person points at a part, the agent reads only the definition that built\nit.\n- **Apps that agents can use.** An app's commands are tools: an agent lists them, runs one under its own name and the\napp's`run` rules, never the person's, and can undo its runs ([VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md#running-commands) ).\n- **Swappable layers.** Modules talk only through the interfaces in`modules/core` , and`affresco::Screen` plugs them\ntogether. No public header exposes OpenGL or GLFW, and each module links on its own (`affrescoui::render` ,`affrescoui::vcs` , ...) or all together (`affrescoui::affrescoui` ).\n- **Features travel.** A part declares the contribution points and contracts it needs, so one application installs\nanother's feature, checked before it lands. A feature can hold Lisp code, which runs with its author's authority,\nand a person's version of an app is shared as one file ([VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md#sharing-a-version-packages) ).\n\n```\nmodules/core/        the interfaces between modules: Executor, Channel, VersionControl, Services, Network\nmodules/render/      windows, panels, layout, shaped text, input, accessibility; OpenGL 4.1 core or ES 3.0\nmodules/format/      the screen format: rules, checker, {{expressions}}, the runtime that reconciles in place\nmodules/themes/      the kits' components and the themes' design tokens, as JSON built into the library\nmodules/notation/    documents read and written in JSON or in the Lisp notation\nmodules/lisp/        the Lisp language, a Clojure dialect: reader, interpreter, programs built purely into a document\nmodules/data/        an app's records in SQLite, kept apart from its document: models and migrations\nmodules/audio/       sound: voices of files, streams and generators, mixed to the system's output\nmodules/vcs/         version control: commits, proposals, permissions, history\nmodules/channel/     peers and the live protocol over local sockets and processes\nmodules/net/         HTTP(S), server-sent events, WebSocket, remote peers\nmodules/services/    language servers, local programs and folders the host grants\nmodules/intelligence/ the providers an app's assistant asks (APIs or a command line), behind the assistant capability\nmodules/screen/      affresco::Screen, the composition root, and the umbrella header affresco/affresco.hpp\nmodules/automation/  scenarios: scripted input, expectations, golden images\nmodules/imaging/     layered images on copy-on-write tiles\nmodules/scene3d/     3D scenes, glTF 2.0 in and out\nmodules/export/      panel trees as vector PDF\nmodules/capi/        the C API, affresco/affresco.h\nmcp/                 the MCP server for AI agents\napps/server/         the document server: shared, persistent documents over WebSocket\napps/host/           the stock host, affrescoui_launcher: it opens an app's folder and asks for what the app uses\nexamples/            the apps (each with a lisp/ and a json/ folder), the Launcher among them, the assistant add-on\ncatalogue/           the apps' versions and features the Launcher's Catalogue lists and installs\neditors/             a VS Code extension, and a clj-kondo configuration for the Lisp programs\nweb/                 the WebAssembly build\n```\n\nThe layers, the path of a revision and of an event, and the security boundary: [ARCHITECTURE.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/ARCHITECTURE.md).\n\nAn AffrescoUI app is a program in **AffrescoUI Lisp**, a sandboxed dialect of Clojure with its own runtime, built into\nthe library ([LISP.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LISP.md) has every definition and rule in tables; [`modules/lisp`](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/README.md), [RFC\n0005](https://github.com/RiccardoSottini/AffrescoUI/blob/master/rfcs/0005-lisp-language.md), [RFC 0006](https://github.com/RiccardoSottini/AffrescoUI/blob/master/rfcs/0006-clojure-dialect.md)). Its forms, functions and reader forms are\nClojure's: of 186 everyday Clojure forms, 163 give Clojure's own value and the other 23 are left out or differ on\npurpose ([everyday.lisp](https://github.com/RiccardoSottini/AffrescoUI/blob/master/tests/conformance/everyday.lisp), checked on every test run). It is measured against Clojure's\ncross-dialect test suite too ([CONFORMANCE.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/CONFORMANCE.md)), every difference is written down with\nwhat to write instead ([differences.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/reference/differences.md)), and clj-kondo lints the programs with\n[its configuration](https://github.com/RiccardoSottini/AffrescoUI/blob/master/editors/clj-kondo/README.md). Every example is written in its idiomatic style\n([style.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/reference/style.md)). The program is a folder of small, named definitions. Building it gives\nthe document the engine draws, and its functions run whenever a button is pressed, a key is typed or a bound value\nchanges. From Flow's own code (`examples/flow/lisp/flow.lisp`):\n\n```\n(ns flow.flow)\n\n(defn cards-of \"A column's cards, in their order.\" [c]\n  (:cards (column c)))\n\n(defn next-order \"The order that puts a card at the end of a column.\" [c]\n  (->> (cards-of c) (map :order) (reduce max -1) inc))\n\n(defn column-of \"The column that holds a card, or -1.\" [ref]\n  (or (first (keep-indexed (fn [c col]\n                              (when (some #(= (:ref %) ref) (:cards col)) c))\n                            computed.columns))\n      -1))\n```\n\n| You define | In AffrescoUI Lisp | \n|---|---|\n| The window, as an outline of its parts | `defscreen main` | \n| Its parts, small and named | `defview` ,`defcomponent` | \n| Its data | `defstate` ,`defcomputed` | \n| Its looks | `deftokens` ,`defstyle` ,`defmenu` | \n| What it does | `defn` ,`defcommand` | \n| Shortcuts and settings | `defkey` ,`defcustom` | \n| Extension points | `defhook` ,`add-hook` ,`advice` | \n| Its text, in every language | `(t \"key\")` and`locales/<language>.lisp` | \n| Its files | `(ns board.index (:require \"toolbar.lisp\" ...))` | \n\nThe document a program builds can also be written directly in JSON. The engine reads both: every example ships a\n`lisp/` and a `json/` folder, and the Launcher's Settings choose which one opens. The two are the same app. Their first\nframes match pixel for pixel, they pass the same scenarios, and they share one history, the same diffs and the same\npermissions. In tests of the same changes made both ways, an AI agent edited Lisp as accurately as JSON, at about the\nsame cost ([BENCHMARKS.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/BENCHMARKS.md)).\n\n| Lisp: the program you write | JSON: the document it builds | \n|---|---|\n| \n\n```\n(defview card-view \"One card, in bold when it is a bug.\" [card]\n  `(label#card :text ~card.title :bold ~(= card.tag \"bug\")))\n\n(defscreen main :window {:title \"Board\"}\n  (column#cards\n    ~(repeat [card state.cards] (card-view card))))\n```\n\n | \n\n```\n{ \"type\": \"column\", \"id\": \"cards\", \"children\": [\n  { \"type\": \"label\", \"id\": \"card\",\n    \"repeat\": { \"for\": \"card\", \"in\": \"state.cards\" },\n    \"text\": \"{{card.title}}\",\n    \"bold\": \"{{(card.tag == 'bug')}}\" } ] }\n```\n\n | \n\nA running app can be reprogrammed from inside. In **Calamaio**, the text editor among the examples, open the scratch\nbuffer (`C-x b *scratch* RET`), type a new definition of a command and evaluate it with `C-M-x`:\n\n```\n(defcommand kill-line \"Says so.\" :title \"Kill Line\" :category \"Killing\" [] (message \"redefined\"))\n```\n\nThe next `C-k` runs the new definition, and `C-x C-z` takes it back. `describe-key`, `apropos` and the `describe-*`\nfunctions inspect the running program.\n\nYour own editor can do the same in any Lisp app: start it with `--nrepl` and connect any nREPL client. The window asks\nonce whether to let that editor evaluate as you; then every definition you evaluate lands as your own revision, in the\nfile your buffer is ([LISP.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LISP.md#connecting-an-editor)).\n\n```\n./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --nrepl\n```\n\nOnly the definition that changed is rebuilt, and the running app is updated where that definition is read.\n\n- **Every change is a revision.** Each evaluation revises one definition: it is kept in history, shown in diffs and\nundone like any other change.\n- **An agent's code is reviewed.** It arrives as a proposal, rebuilt from its source and judged by what it builds.\nOnce accepted, it still runs with the agent's authority, never the person's.\n- **Your authority covers only what you typed.** Text pasted in or written by someone else runs with less, unless you\nread it in a question the app itself draws (no document or agent can draw or answer it) and say yes.\n- **Hooks and advice can't take your commands down.** An agent's hooks and advice run sealed: they can't stop a\nperson's command from working.\n\n| A from-scratch **C++23** engine on**OpenGL 4.1 core or ES 3.0** (WebGL2 in the browser). No browser engine, no web view. A change updates only what reads it, only what changed is redrawn, text is sharp at every display scale, and an idle window sleeps. | A whole app in one readable document: layout, components, state, `{{expressions}}` , events, services. Changes are**compact edits** by node id, atomic, and reconciled**in place** . | Content-addressed commits, proposals as branches with **live preview** , diff, and an**undo of any earlier change that keeps the later ones** ;`allow` /`ask` /`deny` rules and change budgets. An AI can change your app but**can never approve its own changes** . | \n| A **two-way MCP server** : requests from the app reach the agent, with what you pointed at, and its revisions and replies come back. Agents also run the app's commands as tools, under rules of their own. Works with Claude Code out of the box. | Clients, agents and scripts connect over local sockets, or over the network through the document server. Identity comes from the connection, never from what a peer claims. | Any run of revisions exports as a **change set** , a small portable file that anyone with the same application can review and install. A whole version of an app shares as one file, installed only after review. | \n\n```\n%%{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\"}}}%%\nflowchart LR\n    subgraph P[\"Who changes it\"]\n        direction TB\n        you[\"<b>You</b><br/>the app's assistant\"]\n        ai[\"<b>AI agent</b><br/>Claude Code · MCP\"]\n        any[\"<b>Scripts & apps</b><br/>any socket client\"]\n    end\n\n    subgraph V[\"Version control\"]\n        direction TB\n        rules{\"<b>Permission rules</b><br/>deny · ask · allow\"}\n        pr[\"<b>Proposal</b><br/>branch · live preview\"]\n        no[\"<b>Rejected</b><br/>nothing changes\"]\n    end\n\n    subgraph E[\"Engine\"]\n        direction TB\n        main[(\"<b>main</b><br/>SHA-256 commits\")]\n        rt[\"<b>Runtime</b><br/>reconcile in place\"]\n        gl[\"<b>Renderer</b><br/>C++23 · OpenGL\"]\n    end\n\n    app([\"<b>Your running app</b><br/>never restarts\"])\n\n    you & ai & any -- \"revision\" --> rules\n    rules -- \"allow\" --> main\n    rules -- \"ask\" --> pr\n    rules -- \"deny\" --> no\n    pr -- \"you accept\" --> main\n    main --> rt --> gl --> app\n\n    classDef peer fill:#FFFFFF,stroke:#CBD5E1,stroke-width:1px,color:#0F172A\n    classDef gate fill:#FFFBEB,stroke:#D97706,stroke-width:1.5px,color:#78350F\n    classDef wait fill:#FFFFFF,stroke:#D97706,stroke-width:1px,stroke-dasharray:4 3,color:#78350F\n    classDef stop fill:#FFFFFF,stroke:#E11D48,stroke-width:1px,color:#9F1239\n    classDef core fill:#EEF2FF,stroke:#6366F1,stroke-width:1.5px,color:#1E1B4B\n    classDef out fill:#0F172A,stroke:#0F172A,color:#FFFFFF\n    class you,ai,any peer\n    class rules gate\n    class pr wait\n    class no stop\n    class main,rt,gl core\n    class app out\n    style P fill:#F8FAFC,stroke:#E2E8F0,color:#64748B\n    style V fill:#F8FAFC,stroke:#E2E8F0,color:#64748B\n    style E fill:#F8FAFC,stroke:#E2E8F0,color:#64748B\n    linkStyle 0,1,2 stroke:#94A3B8\n    linkStyle 3 stroke:#16A34A,stroke-width:2px\n    linkStyle 4 stroke:#D97706,stroke-width:1.5px\n    linkStyle 5 stroke:#E11D48,stroke-width:1.5px\n    linkStyle 6 stroke:#16A34A,stroke-width:2px\n    linkStyle 7,8,9 stroke:#6366F1,stroke-width:2px\n```\n\n1. **Anyone can propose a change.** The host (`affrescoui_launcher` ) renders a screen and listens for peers on local\nsockets. You ask through the app's assistant, pointing at what to change if you like; the AI answers through the\nprovider chosen in the Launcher, or an agent connects through the MCP server, which works both ways; any script can\nconnect too. Every change is a**revision** of compact edits.\n2. **The permission rules decide:**`deny` refuses,`ask` sends the change to review,`allow` applies it. Rules judge\nwhat a change*does* , not how it is written. Flow's rules, for example, let the person's own client change anything, ask before\nan agent changes behaviour, and protect the status bar from everyone.\n3. **You review proposals.** A proposal is a branch, like a pull request: the agent can refine it while you preview it\nlive. Then**Accept** ,**Always allow** (don't ask again for that part of the screen) or**Reject** with a reason.\nThe modes*accept edits* and*plan* change how much is asked.\n4. **Accepted changes become commits on `main`** , with SHA-256 ids, the author and the approver. The runtime updates\nthe running app in place, keeping focus and typing. Any commit can be undone, keeping the changes made after it\n(where one was built on it, you choose), or restored ([VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md) ).\n\n```\ncmake -S . -B build && cmake --build build\n\n./build/affrescoui_launcher                  # the Launcher: every app, your own apps, the AI settings\n```\n\nIn the Launcher's **Settings**, choose the AI the assistants use: Anthropic, OpenAI, an OpenAI-compatible server\n(such as Ollama) or your Claude Code login, and a model. Keys stay in the system's keychain. Every app you open then\nhas a working assistant, with no MCP. To connect an AI agent through MCP instead ([mcp/README.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/mcp/README.md)):\n\n```\nclaude mcp add affrescoui -- python3 /path/to/AffrescoUI/mcp/affrescoui_mcp.py\nclaude --dangerously-load-development-channels server:affrescoui   # requests are pushed into the session\n```\n\nOpen Flow and ask *\"add a Blocked column between In progress and In review\"* in the board's assistant. Claude\nchanges the running board and the change comes back as a proposal: **Accept** it and the app updates in place, or\n**Always allow** to stop being asked about that part of the screen.\n\n```\n./build/affrescoui_launcher examples/haven/lisp/index.screen.lisp                # any application, no C++\n./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --mode acceptEdits # agent changes apply unless a rule asks\n./build/affrescoui_launcher examples/flow/lisp/index.screen.lisp --plugin my.json   # start with a change set applied\n```\n\nRequires CMake 3.25 or later and a C++23 compiler; CMake fetches the pinned dependencies\n([cmake/dependencies.json](https://github.com/RiccardoSottini/AffrescoUI/blob/master/cmake/dependencies.json)). CI builds and tests it on Linux, Windows and macOS, where it is\ndeveloped; [web/](https://github.com/RiccardoSottini/AffrescoUI/blob/master/web/README.md) builds it for the browser. `ctest --test-dir build` runs the unit\ntests, every application's scenarios and the rendering check, which compares each frame with a golden image, pixel\nfor pixel ([tests/render/README.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/tests/render/README.md)).\n\n```\n#include <affresco/affresco.hpp>\n\nint main() {\n\taffresco::Application app;\n\taffresco::Screen screen = affresco::Screen::fromFile(\"app.screen.json\");\n\tscreen.createWindow(app);\n\n\tscreen.onAction(\"save\", [&](affresco::Panel&) { /* native code, if needed */ });\n\tscreen.listen(app, \"/tmp/my-app/agent.sock\", \"agent\"); // optional: let other programs change it live\n\treturn app.run();\n}\nfind_package(AffrescoUI REQUIRED)   # or add_subdirectory(AffrescoUI) / FetchContent\ntarget_link_libraries(my_app PRIVATE affrescoui::affrescoui)\n```\n\nFrom C or another language, the C API (`affresco/affresco.h`) loads, drives and embeds a screen; `bindings/python`\nwraps it.\n\n## **Everything the engine does**\n\n- **Screen format:** layout (anchors, rows, columns, grids, splits, tabs, scrolling, overlays), styles, components\nwith parameters and slots, themes and tokens, fonts, screens and navigation, state,`computed` ,`watch` , JS-style`{{expressions}}` ,`repeat` /`when` /`let` /`check` , two-way`bind` , events with bubbling, commands, menus,\nkeybindings and settings, drag and drop, timers, animations, channels,`persist` , includes, strings with ICU plurals\nand locales.\n- **Nodes:** labels, text areas, a code editor with declarative languages and syntax trees, diffs, lists, trees and\nvirtualised tables, node graphs, timelines, calendars, vector paths, an editable canvas, images and image\noperations, raster layers, 3D scenes, native OpenGL surfaces, colour pickers, gradients and curves, plus a kit of\ndesktop and chat components.\n- **Live documents:** in-place reconciliation; revisions as compact edits or JSON Patch, atomic, by`#id` ; any number\nof peers over local sockets, processes or the network; request and reply relaying; asking the agents from inside\nthe app, pointing at what to change; updates that run only what read the change (dependency tracking).\n- **Version control:** SHA-256 commits, an append-only`main` , proposals as branches with merge commits, log, diff,\nblame, revert, restore, an undo that keeps later changes, three-way merges,`HEAD~1` names;`allow` /`ask` /`deny` rules judged by effect, modes, grants, budgets, reviewers, protected controls, approvals pinned to the version\nreviewed; change sets, packages of a whole app and a catalogue, each installed after review; history on disk.\n- **Services and network:** language servers and local programs the host allows, folders it grants, HTTP(S),\nserver-sent events, WebSocket, sign-in, and a document server that shares documents live.\n- **Agents:** a two-way MCP server with minified reads, outlines, single-node reads and changes-only re-reads,\nthe source of what the person pointed at, pictures of the screen, scenarios, leases on parts, an app's commands as\ntools with run rules and undo, and authors set by the connection, never self-declared.\n- **Lisp:** a sandboxed Clojure dialect, measured against Clojure's test suite; definitions versioned one by one, a\nchanged one rebuilt alone; an nREPL server for editors, paired by the person.\n- **Engine:** HarfBuzz shaping and FreeType glyphs with fallbacks, right-to-left text, colour emoji, display scales\nfrom 100% to 400% with text hinted sharp below 2×, damage redraws, the platform's accessibility API (VoiceOver,\nNarrator, Orca), headless windows for tests, vector PDF export.\n- **Tooling:** the`affrescoui` CLI (run, check, test, render, fmt, convert between JSON and Lisp, migrate, import from\nA2UI and Adaptive Cards, export, pack and install, a REPL), scenarios with golden images, a VS Code extension, a\nclj-kondo configuration, a C API with a Python binding, a WebAssembly build.\n\n| Document | What it covers | \n|---|---|\n| [LISP.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LISP.md) | AffrescoUI Lisp in tables: every definition, views and bindings, running, layout of an app, limits, tools | \n| [SCREEN_FORMAT.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/SCREEN_FORMAT.md) | The screen format, node by node | \n| [VERSION_CONTROL.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/VERSION_CONTROL.md) | Commits, proposals, permissions and review | \n| [modules/lisp/README.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/modules/lisp/README.md) | The Lisp language: its values, special forms, functions and limits | \n| [ARCHITECTURE.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/ARCHITECTURE.md) | The modules, the path of a revision and of an event, the security boundary | \n| [mcp/README.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/mcp/README.md) | The MCP server and its tools | \n| [BENCHMARKS.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/BENCHMARKS.md) | Speed, memory and token budgets, with every measurement | \n| [ACCESSIBILITY.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/ACCESSIBILITY.md) | What screen readers see and drive, on every platform | \n| [SECURITY.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/SECURITY.md) | The trust model, what is protected, and how to report a vulnerability | \n| [CHANGELOG.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/CHANGELOG.md) | What changed in each release | \n\nAffrescoUI started in **December 2017** as **sGLGUI**, when I was **16**, as a way to teach myself OpenGL and C++: nested panels,\npixel/percent sizing, anchors and a signal/slot event system, all from scratch. In 2018 I added a text area. It\ncollected keystrokes but **could never draw them**, and the project stalled. A restart in 2020 rewrote the layout\nengine (the image on the right is that demo), then stalled again.\n\nIn **2026** I revived it with **Claude Code**. The first goal was a library you could actually use: we ported it to\nOpenGL 4.1 core, rewrote it in C++23 and finally rendered text. Then an idea sparked: what if an AI agent could change\na native app *while it runs*, and you approved every change? That took it far beyond the original plan: UIs described\nin JSON, live revisions, version control and a two-way MCP bridge for AI agents.\n\n**How it was built.** To be clear about it: all of the 2026 code was written by Claude Code, through agent-driven\ndevelopment. What I brought is the direction and the architecture. I shaped it over many iterations, trying an idea,\nlooking at what it did and changing course, until it worked the way I wanted. The git history shows every step.\n\n```\ntimeline\n    2017 : Started at 16 : nested panels, anchors, signal → slot events\n    2018 : A text area that can't draw text : the project stalls\n    2020 : Restarted : new layout engine, stalled again\n    2026 : Revived with Claude Code : C++23 · OpenGL 4.1 core · real text : live JSON screens · version control · MCP\n```\n\n**Apache License 2.0**: free to use, modify and distribute, commercially or not. Anyone who distributes it must pass\non the [NOTICE](https://github.com/RiccardoSottini/AffrescoUI/blob/master/NOTICE) file, which credits the author. See [LICENSE](https://github.com/RiccardoSottini/AffrescoUI/blob/master/LICENSE) and\n[THIRD_PARTY_NOTICES.md](https://github.com/RiccardoSottini/AffrescoUI/blob/master/THIRD_PARTY_NOTICES.md).\n\n**Created by [Riccardo Sottini](https://github.com/RiccardoSottini)** · 2017–2026\n\n<sub>If AffrescoUI made you think \"wait, an AI can change a native app *while it runs*?\", leave a ⭐.</sub>", "url": "https://wpnews.pro/news/why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run", "canonical_source": "https://github.com/RiccardoSottini/AffrescoUI", "published_at": "2026-11-22 13:41:29+00:00", "updated_at": "2026-11-22 14:12:27.918531+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools"], "entities": ["AffrescoUI", "AffrescoUI Lisp", "Clojure", "OpenGL", "CMake"], "also_reported_by": [], "takeaway": "AffrescoUI defines an entire app — window, views, state, behaviour, commands, keys, settings and text — as one Lisp (Clojure-dialect) or JSON document that the C++/OpenGL engine renders and hot-applies AI-proposed revisions to in milliseconds, with each change gated by app permissions and user appro", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run", "markdown": "https://wpnews.pro/news/why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run.md", "text": "https://wpnews.pro/news/why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run.txt", "jsonld": "https://wpnews.pro/news/why-stop-at-emacs-native-apps-you-or-an-ai-reprogram-in-clojure-while-they-run.jsonld"}}