Desktop Apps
~8 min readUpdated: November 2026

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

AffrescoUI Live Clojure Lisp and C++23 OpenGL Native UI Architecture in Smoke Monkey

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.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

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.

Key Architectural Takeaways
Quick Implementation Exampleaffrescoui-mcp-agent.ts
affrescoui-mcp-agent.tstypescript
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);
Video Guides

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 DimensionElectron / Webview AppsAffrescoUI Engine
Rendering StackChromium + V8 + HTML/CSS DOMC++23 + OpenGL 4.1 / ES 3.0
Full-Frame Render Time~4–16 ms (DOM layout + paint)0.40 ms
App Definition LanguageJS/TS + Bundler + Native BridgeSandboxed Clojure Lisp or JSON
Live AI ReprogrammingRequires source rebuild / HMR reloadIn-place millisecond hot-patch + undo
Cross-App Feature ReuseCopy-paste / npm package refactorPortable Change Sets move features between apps
Agent ProtocolAd-hoc scriptsTwo-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.

bash
# 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.

Google Search Questions & Answers

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 guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness