Contents
Tauri: A Fast Horse Called Rust
Desktop applications are back. Not because the web is inadequate, but because some things simply work better locally: offline access, filesystem access, system notifications and, above all, data privacy.
If you have tried Electron, you know what I mean: a simple TODO list can take up 200 MB and consume 500 MB of RAM because a full copy of Chromium runs behind it. Tauri takes a different approach.
Why Tauri instead of Electron?
| Metric | Electron | Tauri |
|---|---|---|
| Hello World size | ~200 MB | ~3–5 MB |
| RAM usage (idle) | ~150–300 MB | ~20–50 MB |
| Startup time | 2–5s | <1s |
| Rendering engine | Bundled Chromium | System WebView |
| Backend language | Node.js | Rust |
| Security model | Weaker | Strong (Rust + permissions) |
How does Tauri work?
Tauri application
├── Frontend (WebView)
│ └── React / Vue / Svelte / HTML: familiar web technologies
├── IPC bridge
├── Backend (Rust)
│ └── System APIs, files, shell, fast operations and security
└── System WebView (WRY)
├── Windows: WebView2 (Edge)
├── macOS: WKWebView (Safari)
└── Linux: WebKitGTKTauri does not bundle its own browser. It uses the system WebView available on each OS. You can write the frontend using web technologies such as React, Vue or Svelte. The backend is written in Rust: fast and safe, with a small memory footprint.
Rust: the fast horse
Rust is not in Tauri just for show. Here is one reason why:
// src-tauri/src/lib.rs
// Tauri command callable from the frontend
#[tauri::command]
fn process_large_file(path: String) -> Result<FileStats, String> {
let content = std::fs::read_to_string(&path)
.map_err(|e| e.to_string())?;
// Runs natively, not in a JavaScript engine
let stats = FileStats {
lines: content.lines().count(),
words: content.split_whitespace().count(),
chars: content.chars().count(),
size_bytes: content.len(),
};
Ok(stats)
}
// The frontend calls this command over IPC
// invoke('process_large_file', { path: '/data/huge.csv' })Rust gives you:
- Filesystem access without Node.js overhead
- Parallel processing with tokio/rayon
- Memory safety without a garbage collector
- Native performance for CPU-intensive operations
Frontend: familiar web technology
// src/App.tsx (React example)
import { invoke } from '@tauri-apps/api/core';
function App() {
const [stats, setStats] = useState<FileStats | null>(null);
const analyzeFile = async () => {
// Call the Rust backend via Tauri IPC
const result = await invoke<FileStats>('process_large_file', {
path: selectedFile,
});
setStats(result);
};
return (
<div>
<button onClick={analyzeFile}>Analyze file</button>
{stats && (
<div>
<p>Lines: {stats.lines}</p>
<p>Words: {stats.words}</p>
</div>
)}
</div>
);
}Nothing unfamiliar: ordinary React and TypeScript. Any web developer can quickly find their way around it.
When to use—and not use—Tauri
Use Tauri when:
- You want a native desktop app with a web UI
- Size and performance matter
- You need filesystem or OS API access
- You are building a privacy-first application where data stays local
Do not use Tauri when:
- Your team does not know Rust and the learning curve is a concern
- You need identical rendering on every platform, because WebViews differ
- Your app is essentially a website; a PWA may be more appropriate
In the next part, we will look at the interesting twist: bringing Python and LangGraph into a Tauri app so that a fast Rust engine and an AI brain can live in one package.