Rust is a compiled systems language that guarantees memory safety through ownership rules checked at compile time, without a garbage collector. EOXLABS uses Rust only where it earns its place: CPU-bound work compiled to WebAssembly for Workers, the native core of Tauri apps, and embedded controller software on Raspberry Pi hardware. Everything else stays in TypeScript.
The Rust book puts the idea in one line: ownership "enables Rust to make memory safety guarantees without needing a garbage collector" (understanding ownership). That matters to buyers as well as engineers. In June 2025, CISA and the NSA published joint guidance on adopting memory safe languages, with recommendations aimed at critical infrastructure organizations. Rust is one of four languages in the EOXLABS stack.
Where does Rust earn its place in an EOXLABS system?
A job moves to Rust when at least one of these is true:
- The work is CPU-bound and runs often. Parsing large documents, hashing and chunking files, compression, image transforms, and entropy analysis across every block of a backup. Workers bills CPU time by the millisecond, so a tighter loop is cheaper as well as faster.
- The code must run as a native binary. The core of a Tauri app is Rust, and the interface calls into it through typed commands.
- A memory bug would be a security incident. Parsers for untrusted file formats are the usual case in security and resilience work.
The kind of function that qualifies is small, pure and hot. This one measures Shannon entropy, the signal behind the ransomware-resilient backups note, inside a Rust Worker:
use worker::*;
/// Shannon entropy in bits per byte, from 0.0 to 8.0.
fn entropy(bytes: &[u8]) -> f64 {
let mut counts = [0u64; 256];
for &b in bytes {
counts[b as usize] += 1;
}
let len = bytes.len() as f64;
counts.iter().filter(|&&c| c > 0).map(|&c| {
let p = c as f64 / len;
-p * p.log2()
}).sum()
}
#[event(fetch)]
async fn fetch(mut req: Request, _env: Env, _ctx: Context) -> Result<Response> {
let body = req.bytes().await?;
Response::from_json(&serde_json::json!({ "bits_per_byte": entropy(&body) }))
}
What does WebAssembly on Workers allow, and what does it limit?
Cloudflare Workers support Rust through the workers-rs crate, which compiles to WebAssembly and exposes bindings including KV, R2, D1, Durable Objects, Queues and Hyperdrive. The limits shape the design more than the language does:
- Memory. Each isolate gets 128 MB, and WebAssembly allocations count against it (Workers limits).
- No threads. Each Worker runs in a single thread; SIMD is available (WebAssembly on Workers).
- CPU per request. Workers Paid allows 30 seconds by default, configurable up to 5 minutes. Longer jobs belong in a queue or outside Workers.
- Startup and size. The global scope must finish within 1 second, and the bundle may not exceed 64 MiB uncompressed. Cloudflare warns that unoptimized Rust binaries can be large and slow to start, so EOXLABS builds Rust Workers with the release profile from Cloudflare's guide, and
wasm-optruns automatically:
[profile.release]
lto = true
strip = true
codegen-units = 1
Cloudflare's guide also notes that using wasm-bindgen output without workers-rs means patching the generated JavaScript by hand. EOXLABS avoids that by keeping routing, authentication and I/O in a TypeScript Worker and calling a separate Rust Worker through a service binding. Cloudflare describes service bindings as adding no overhead, with both Workers on the same thread by default. The Rust surface stays small and testable on its own.
What does Rust cost?
- Build time. The Rust project's 2025 compiler performance survey drew over 3,700 responses. 55% of respondents waited more than ten seconds for a rebuild, and about 45% of those who had stopped using Rust named long compile times among their reasons. EOXLABS keeps Rust crates small and outside the TypeScript build, so an interface change never waits on
cargo. - Hiring and handover. In Stack Overflow's 2025 Developer Survey, 14.5% of professional developers reported extensive work in Rust, against 48.8% for TypeScript and 17.4% for Go. In embedded engagements the client owns the code from day one, so EOXLABS confines Rust to modules with a narrow interface, tests and written rationale that another engineer can pick up.
- Learning time. Ownership rules reject patterns that compile in other languages. Engineers new to Rust spend real time learning them, and reviews take longer while they do.
Rust, Go or TypeScript for a CPU-bound job?
| Rust | Go | TypeScript | |
|---|---|---|---|
| Memory management | Ownership, checked at compile time; no garbage collector | Garbage collected, by design (Go FAQ) | Garbage collected by the engine |
| Inside a Cloudflare Worker | First-class through workers-rs | Through WebAssembly only | First-class |
| Parallelism | OS threads natively; one thread inside a Worker | Goroutines multiplexed onto OS threads | One thread inside a Worker |
| Build feedback | Slowest of the three | Designed for builds of a few seconds | Type check only |
| Professional developers using it (2025 survey) | 14.5% | 17.4% | 48.8% |
| Best fit at EOXLABS | Hot loops, parsers, Tauri cores | Long-running services and agents outside Workers | APIs, interfaces and orchestration |
When not to use Rust
- The handler spends its time waiting on databases and APIs. Faster CPU code changes little there, and the extra build still costs.
- A maintained JavaScript library already does the job fast enough. Measure first; rewrite only the loop that shows up in the profile.
- The client's team can't maintain it. A Rust module nobody on staff can change becomes a liability at handover.
- Inputs are small and requests are frequent. A large WebAssembly module can cost more in startup than it saves per request.
- The job needs more than one thread or 128 MB of memory. Inside a Worker, Rust gets neither; run it as a native service instead.