Skip to content
On this page

Web Development with Zolo

Zolo's web stack is built from ordinary language features instead of a separate template language. Verniz is the rendering and interactivity layer: components are functions, markup lowers to normal Zolo calls, and the server sends correct HTML before JavaScript starts.

The stack

Layer Use it for Current support
std::html / Verniz View, markup, escaping, islands, actions and scoped CSS VM, LLVM and Cranelift
std::http Routes, requests, responses, middleware and the native HTTP server VM, LLVM and Cranelift
std::web Request and Cookies effects with secure cookie envelopes VM only for now
zolo dev In-place server swaps, browser revalidation and the error overlay Development VM
zolo build Standalone production binaries LLVM or Cranelift

The VM-only boundary applies to the std::web effect/cookie layer, not to Verniz Views, islands, actions or scoped CSS.

A complete first page

use std::http
use std::html::{document, head, meta, title, body, main, h1, p, View}

fn page(_req) -> View {
    <document lang="en">
        <head>
            <meta charset="utf-8"/>
            <title>Hello from Zolo</title>
        </head>
        <body>
            <main>
                <h1>Hello from Verniz</h1>
                <p>This HTML was rendered by Zolo.</p>
            </main>
        </body>
    </document>
}

let app = http.router() |> http.get("/", page)
http.serve(3000, app)

Run it with live web development:

zolo dev src/main.zolo

When http.serve is reached, zolo dev enters web mode automatically. Open the URL printed by the CLI. Use zolo run for a one-shot VM run or zolo build for the production binary.

Choose the right entry point

  • Return a View when building pages or HTML fragments.
  • Return a map for JSON APIs and a string for plain text.
  • Use std::http when handlers explicitly receive the request.
  • Use std::web when nested code needs request or cookie access through effects.
  • Mark only interactive regions with @island; the rest stays server-rendered HTML.
  • Mark server-callable functions with @action; public functions are never exposed implicitly.

Try it in the browser

The Verniz Lab runs the Zolo compiler and VM through WebAssembly and renders the resulting document in an isolated preview. It supports Views, markup, scoped CSS and client-side island signals without installing anything.

The Lab does not emulate a listening TCP server. Routes, @action, cookies, databases and the zolo dev reload channel require the local CLI.

What is implemented today

Verniz currently includes server-rendered Views, HTML-like markup, escaped interpolation, raw style and script bodies, scoped CSS, @island, writable and derived signals, effects, DOM events, reactive attributes, bind:prop, @action, route revalidation and state-preserving development swaps.

Reactive list reconciliation, typed wire contracts, @secret leak checking and refinement-type forms remain future work. The examples directory keeps target examples separate from the programs that pass today.

Next: Verniz Views and Markup.

Search Zolo

9 results

enpt-br