Fullstack web framework
Weft
A fullstack web framework in Rust: a small template language, native Tailwind, WebGL, charts and an accessibility tree in every render.
state count = start ?? 0
let label = if count == 1 then "time" else "times"
on inc = count <- count + 1
Card(title: "Counter", class: "max-w-sm") {
p(class: "text-lg") "Clicked {count} {label}"
Button(variant: "gradient", @press: inc) "Click me"
}Weft is the framework this site is written in. Pages and components are templates that compile to WebAssembly; API routes run on actix-web or as Vercel functions from the same project; every page is prerendered at build, and pages with nothing interactive ship as plain HTML and CSS.
What's in it
- A template language with its own state, derived values, handlers, timers, window events, data loading and GSAP-style timelines, in a pure functional style. Handlers are Elm-style transitions: they say what the state becomes.
- A native Tailwind engine, written in Rust: no Node, no config, CSS generated for exactly the classes that render. Typos fail the tests.
- Graphics: 11 animated shader presets, a particle system, 2.5D depth photos made at build time with Depth Anything V2, and WebGL2 scenes in the style of React Three Fiber, with PBR materials, shadow maps, glTF models with skinning, text from font files and real DOM pinned into 3D.
- 131 accessible component families, shadcn-style, including 51 chart families that connect to CSV, JSON, GraphQL or SDMX with one
srcprop. - An accessibility tree on every render, including what's drawn on canvases, so tests click buttons by role and name like a person would.
- Tooling: a language server (diagnostics, hovers, completion, formatting), VS Code and Zed extensions, a tree-sitter grammar, and
weft migrate, which turns an existing site into a Weft project by running the CSS cascade and writing the result as Tailwind.
Numbers
1,277 native tests and 59 in-browser tests. Each example app is about 610 KB of gzipped wasm.
This site
Everything here is Weft: the woven threads on the home page are torus knots in a scene3d, the fugue in the lab is an audio element driving a canvas2d piano roll read from the same MIDI file, the portrait on the About page is a DepthImage, and the palette (press ⌘K) is a Dialog around a Command.
The documentation, the example apps and the live component catalogue are at weft.daletristanhutchinson.com. The source is view-only and shared on request.