Why Wisp, and When Not
Wisp is for server-rendered sites and apps in Rust. Numbers are in Benchmarks and Tokens.
What Each One Is
| What it is | Your code runs | |
|---|---|---|
| Wisp | File routes, .wisp templates compiled to Rust, form actions, one binary | On the server |
| Axum | A routing library on hyper and tower; you choose the rest | On the server |
| Leptos | Full-stack Rust components with fine-grained reactivity and server functions | Server, and the browser as WebAssembly |
| Dioxus | Web, desktop and mobile from one codebase, with rsx! | Server, WebAssembly, desktop or phone |
| SvelteKit, Next.js | JavaScript full-stack frameworks | Node or an edge runtime, plus the browser |
How Wisp Differs
- Your Rust runs only on the server. A page is HTML, and a form posts to an
#[action]that works with JavaScript off (Without JavaScript). - A folder is a URL, and
+page.wispholds the logic and the markup. Axum has no file routes, and Leptos and Dioxus declare routes in Rust. - The browser gets HTML, not a WebAssembly bundle, unless you add your own script.
#[model],#[validate]and<form fields>write inputs and error messages.- The app, styles and static files are one binary, or a build for static hosting, a container, or an edge or serverless host (Hosting).
When to Pick Something Else
- Axum: you want a library and your own choices, a service with no pages, or an existing tower stack. Wisp runs inside Axum through its
towerfeature (Embedding). - Leptos: you want Rust components in the browser, with fine-grained reactivity and server functions. It needs a WebAssembly bundle and
cargo-leptos. - Dioxus: you want one codebase for web, desktop and mobile.
- SvelteKit or Next.js: your team writes JavaScript or TypeScript, or you want the NPM component ecosystem. Wisp is Rust only.
- NPM components do not work as Wisp components, since a
.wispcomponent compiles to Rust. You can mount React, Vue, Svelte, Preact or web components as islands (Islands), bundle an NPM library and mount it from ause:action, import plain npm packages in browser code, usewisp ui addandwisp recipe add(Tooling), or share components as crates (Component Libraries). Expect to write more of your own UI. - A long track record: Wisp is new. Every file is audited line by line. See Security.
Numbers
Benchmarks compares Wisp with Axum, Actix Web and several JavaScript frameworks, with source file, date and machine. Tokens compares the same app in Wisp, SvelteKit and Next.js.
Instructions per request on the server thread (release 1.0.0-pre.3, Wisp 2362ec0d, callgrind, bench/rust-fastest/results/ir.txt): plaintext 14,341 for Leptos, 13,750 for Dioxus and 17,123 for Actix Web. Fortunes 165,437, 470,141 and 43,815. Wisp is not measured at pre.3, because the spread of its 3 reps was above 1% (details).
Is This Page Useful?