PHP energy, C++ runtime
Make dynamic websites like it's 2006.
UCE is a direct web runtime: files are pages, templates live next to control flow,
nginx fronts the whole thing, and a request can compile into a wasm module on first hit.
It is built in the image of PHP's non-architecture, but with an explicit request object,
component rendering, and a built-in WebSocket broker.
render_signal("Files are routes", "A .uce page is the thing you edit and the thing nginx serves."); ?>
render_signal("Compile on demand", "First request builds a wasm module, later requests reuse it."); ?>
render_signal("WebSockets included", "Same runtime, same page path, broker-managed connection state."); ?>
Why UCE
The old web had the right instincts.
Put code where the page lives. Let runtime state die with the request. Keep deployment boring.
Treat server-rendered HTML as the default, and add richer behavior only where it pays for itself.
render_feature_card("templating", "Inline markup without framework tax", "UCE templates live directly inside handler code with escaped and raw output modes, so rendering stays local to the request logic that owns it."); ?>
render_feature_card("composition", "Components and sub-rendering", "Components are just .uce files. Props flow through context.props. Full pages can call other units without inventing a second application runtime."); ?>
render_feature_card("transport", "FastCGI for pages, HTTP for sockets", "Normal page renders stay on the FastCGI socket. Real WebSocket upgrades on .ws.uce endpoints are proxied to the built-in HTTP listener."); ?>
render_feature_card("operations", "nginx in front, systemd behind", "Static files stay static, nginx does the edge work, and the runtime handles compilation, request execution, and socket fan-out."); ?>
Non-architecture
It is not trying to save you from the web.
What it leans into
Files on disk, explicit request handlers, template tags, reusable partials, request-scoped state, and operationally plain deployment.
What it resists
Mandatory client-side hydration, giant application shells, hidden routing layers, and pretending every website is a desktop app in a trench coat.
What it adds
Built-in components, markdown rendering, current request data in one place, and a broker-backed WebSocket story that stays inside the same runtime.
Code first
Common things in UCE
The examples below are modeled on the current runtime API and the published demo pages.
The point is not abstraction depth. The point is that the code stays obvious.
render_code_example(context, "templating", "A page with request data", "Drop from C++ into markup, escape output by default, and keep request handling next to the HTML it controls.", snippet_minimal, "See the live demos for forms, headers, sessions, JSON, markdown, and more."); ?>
render_code_example(context, "forms", "POST + session flash", "Old-school dynamic websites still matter. UCE keeps form handling and page rendering in one file when that is the simplest thing.", snippet_forms, "Request data lives on context.get, context.post, context.cookies, and context.session."); ?>
render_code_example(context, "components", "Reusable UI without a second framework", "Components are ordinary .uce files. Pass props through context.props and choose when to render or return markup.", snippet_components, "Named handlers and component_render() are also available for direct output flows."); ?>
render_code_example(context, "content", "Markdown when you want it", "UCE also ships a markdown module, so content-heavy pages do not need an external rendering stack.", snippet_markdown, "The runtime supports markdown_to_ast() and markdown_to_html() for content pipelines and component hooks."); ?>
render_code_example(context, "realtime", "WebSockets with broker-owned state", "A .ws.uce page can render HTML and also accept live socket messages. Connection-local state lives on context.connection.", snippet_websocket, "The published demo includes a full chat example with reconnect logic and per-connection metadata."); ?>
render_code_example(context, "deploy", "nginx wiring", "Use FastCGI for ordinary requests and only send actual websocket upgrades to the runtime's built-in HTTP listener.", snippet_nginx, "Match .ws.uce before the generic .uce location so normal page loads and upgrades split correctly.", "nginx"); ?>
Deployment
Put nginx in front. Keep the runtime focused.
The intended shape
- nginx serves static files directly from `site/`
- ordinary `.uce` and plain `.ws.uce` page loads go through FastCGI
- real websocket upgrade traffic goes to the built-in HTTP listener
- systemd manages the runtime binary and restart policy
The practical settings
- `FCGI_SOCKET_PATH=/run/uce/fastcgi.sock` for normal requests
- `HTTP_PORT=8080` for `.ws.uce` websocket upgrades
- `scripts/systemd/manage-uce-service.sh` for build and service control
- published root should be `site/`, not the repo root
Explore
Go straight to the useful parts.
render_link_card("../demo/index.uce", "Demo Area", "Open the published UCE demo pages for strings, forms, sessions, JSON, components, markdown, and runtime behavior.", "Try things"); ?>
render_link_card("../demo/websockets.ws.uce", "WebSocket Demo", "See the built-in broker model in a real page that renders HTML, upgrades the same route, and broadcasts chat events.", "Realtime"); ?>
render_link_card("../doc/index.uce", "Reference Docs", "Browse the manual-style function and concept docs for the current runtime surface.", "Manual"); ?>
render_link_card("../doc/singlepage.uce", "Single-Page Docs", "Read the reference as one long page if you want the PHP-manual energy without the clicking.", "Reference"); ?>
render_link_card("../examples/uce-starter/index.uce", "UCE Starter", "Browse the larger example app built in UCE using components, themes, views, and richer page composition.", "Starter"); ?>
render_link_card("../README.md", "Repository README", "The repo README covers runtime shape, deployment, WebSockets, and the current project status in one place.", "Source"); ?>
Reality check
What this is and what it is not
Is UCE production ready?
The runtime is still experimental. The point of this site is to explain the model, show the current surface area, and make it easy to evaluate the demos and docs.
Why compare it to PHP?
Because the design instinct is similar: dynamic pages as files, shallow deployment, and a bias toward solving the request in front of you instead of building an application architecture altar.
What makes it different from old PHP?
The request object is explicit, components and named handlers are first-class, markdown support is built in, and WebSockets use a broker-owned connection model inside the runtime.