AffrescoUI: Live AI-Reprogrammable Native Apps in Clojure & OpenGL

AffrescoUI (`RiccardoSottini/AffrescoUI`) is an Apache-2.0 native UI engine written in C++23 and OpenGL 4.1 / ES 3.0 that renders applications defined in a sandboxed Clojure Lisp dialect or JSON. With a 0.40 ms full-frame render budget and a two-way MCP server, both humans and AI agents inspect and patch running desktop or web apps in place without rebuilding or restarting.
AffrescoUI: Live AI-Reprogrammable Native Apps in Clojure & OpenGL: AffrescoUI (`RiccardoSottini/AffrescoUI`) is an Apache-2.0 native UI engine written in C++23 and OpenGL 4.1 / ES 3.0 that renders applications defined in a sandboxed Clojure Lisp dialect or JSON. With a 0.40 ms full-frame render budget and a two-way MCP server, both humans and AI agents inspect and patch running desktop or web apps in place without rebuilding or restarting. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Zero-Browser Native Rendering: Draws directly via C++23 and OpenGL 4.1 / ES 3.0 across macOS, Linux, Windows, and Web in 0.40 ms per full frame.
- Single-Document Lisp & JSON Format: Define windows, views, state, commands, keybindings, and i18n strings (including RTL Arabic) in sandboxed Clojure Lisp or JSON.
- Millisecond Live Hot-Patching: AI assistants inspect UI regions via Point-to-Ask and apply permission-checked structural diffs in place with full undo/redo and portable change sets.
- Two-Way MCP Interoperability: Exposes live app AST and state over Model Context Protocol so external coding agents like Smoke Monkey Harness can modify running GUIs.
import { createAgent } from '@smoke-monkey/harness';const uiMutationAgent = createAgent({agentId: 'affrescoui-live-designer',provider: 'custom',baseUrl: 'http://127.0.0.1:8000/v1',model: 'qwen3.8:27b',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {affresco: {command: 'npx',args: ['-y', '@smoke-monkey/mcp-stdio-bridge', '--target', 'affrescoui-mcp'],},},});async function reshapeRunningApp() {const result = await uiMutationAgent.run('Inspect the running AffrescoUI Kanban Lisp document, add a Blocked column with high-contrast badge rules, and stage the change set for user approval.');console.log('AffrescoUI Live Patch:', result.summary);}reshapeRunningApp().catch(console.error);
Watch: Related Video Guides
What tipped the scales for Clojure - Brendan Foote (Clojure/Conj 2026)
Clojure in Academia - Jim Newton (Clojure/Conj 2026)
What Is AffrescoUI? Native Malleable Software Architecture
AffrescoUI is a cross-platform native UI runtime where every application is represented as a single live declarative document written in AffrescoUI Lisp (a sandboxed Clojure dialect) or JSON. The core C++23 engine interprets those named definitions—windows, views, reactive state, commands, keymaps, settings, and localized text—and draws them directly via OpenGL 4.1 / ES 3.0 without Electron or embedded web views.
Because the entire UI and behavioral graph lives in one inspectable document, AffrescoUI embeds an AI assistant and two-way MCP bridge inside every app. Users can point at any widget, request changes in plain language, preview the diff on the live running window, and commit or roll back changes in milliseconds without losing application state.
AffrescoUI Engine Specifications vs Electron & Webview Stacks
By eliminating browser DOM overhead and shipping 13 self-contained example applications (Forge IDE, Tempera image editor, Calamaio self-reprogrammable text editor, and a Launcher), AffrescoUI achieves deterministic native responsiveness.
| Architecture Dimension | Electron / Webview Apps | AffrescoUI Engine |
|---|---|---|
| Rendering Stack | Chromium + V8 + HTML/CSS DOM | C++23 + OpenGL 4.1 / ES 3.0 |
| Full-Frame Render Time | ~4–16 ms (DOM layout + paint) | 0.40 ms |
| App Definition Language | JS/TS + Bundler + Native Bridge | Sandboxed Clojure Lisp or JSON |
| Live AI Reprogramming | Requires source rebuild / HMR reload | In-place millisecond hot-patch + undo |
| Cross-App Feature Reuse | Copy-paste / npm package refactor | Portable Change Sets move features between apps |
| Agent Protocol | Ad-hoc scripts | Two-way MCP with permission gating |
Portable Change Sets as Cross-App Plugins
Reviewed AI edits in AffrescoUI export as portable change-set files. Features built for one app—such as a presentation slide sorter—can be previewed and installed directly inside another app like a planetarium.
Building AffrescoUI Locally & Inspecting Lisp/JSON Examples
Clone the Apache-2.0 repository to inspect the 13 Lisp and JSON example apps (examples/forge, examples/tempera, examples/calamaio) and wire the two-way MCP bridge into external coding agents.
# Clone AffrescoUI and explore Lisp + JSON application definitions
git clone https://github.com/RiccardoSottini/AffrescoUI.git
cd AffrescoUI
# Inspect dual Lisp/JSON definitions and MCP bridge docs
ls -la examples/forge/lisp examples/forge/json mcp/Connecting Smoke Monkey Harness to AffrescoUI via Two-Way MCP
With Smoke Monkey Harness, developers treat running AffrescoUI apps as live MCP targets. An agent reads the current Clojure view definitions, patches layout or keyboard shortcuts through AffrescoUI's permission gate, and verifies frame rendering without restarting the desktop process.
Frequently Asked Questions
Q:Do I have to write Clojure to build apps in AffrescoUI?
No. While AffrescoUI Lisp (a sandboxed Clojure dialect) is the primary format, the exact same declarative application document can be authored in JSON, and 12 of the 13 examples ship both formats.
Q:How fast is AffrescoUI rendering compared to web-based desktop frameworks?
AffrescoUI renders directly with C++23 and OpenGL 4.1 / ES 3.0—with zero browser engine or web view—achieving a 0.40 ms full-frame time.
Q:How does AffrescoUI keep AI-generated UI edits safe at runtime?
Every modification runs inside the sandboxed Lisp/JSON runtime, passes against the app's permission policy, previews live before commit, and retains full undo history.
Q:What is a Change Set in AffrescoUI?
A Change Set is a portable file capturing a sequence of reviewed UI and behavioral modifications that can be shared as a plugin or transplanted across different AffrescoUI apps.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.