Rat
A tiny web framework where one .rat file is a server, a page, and its styles.
What you write
A working reactive page in eight lines. The same file declares its state, its markup, and the handler that mutates it — no JS to write, no build step, one binary.
> server
name: 'Angelo'
count: 0
> page
<h1> hello [name]
<p> you've clicked [count] times
<button on_click[increment()]> click me
> increment[] >> count << count + 1 What it gives you
- Bracket interpolation —
[expr]anywhere a value goes, including attrs and CSS. - Reactive reads + writes — derived fields with
>>, assignments with<<, no manual subscriptions. - Components (pups) — any
.ratinpups/becomes a tag with attrs as props. - SSR + DB + handlers — built-in
SQLite, function-backed APIs, server-snapshot hydration.
It's fast
Four metrics across three project sizes, median of five runs. The number to look at is hot reload at 1000 pages — the loader's mtime cache reparses only the touched file, so even a project with a thousand pages bounces in 39 ms.
| project size | cold load | warm load | hot reload | full build |
|---|---|---|---|---|
| 10 pages | 1.5 ms | 0.5 ms | 0.5 ms | 5 ms |
| 100 pages | 9.8 ms | 3.6 ms | 3.1 ms | 54 ms |
| 1000 pages | 170.9 ms | 48.5 ms | 39 ms | 840 ms |
The docs walk through the dialect a piece at a time, with a runnable snippet for every feature. Start with the index or jump to setup.